Jump to content

Scripting Organization Topic! <3


Amethyst

Recommended Posts

  • Administrators

Original post:

Okay so like yeah, little info on how this whole development thing works. It's not exactly a secret that I'm using the Pokemon Essentials program, but for those unfamiliar, it's basically a platform on which Pokemon games can be made.

So there's been a guy making the Essentials scripts, and then I've been using those scripts to make Reborn. He isn't directly involved in the project, but he's been doing all the pieces that make a game a Pokemon Game, and then I do everything that makes a Pokemon Game, Pokemon Reborn. If that makes sense.

So, for instance, when we get these bugs- Like Twister, or Moxie not working- that's not my department; that's on him. As Essentials is also a work in progress, it's only natural that it'll be incomplete. I forge ahead with Reborn anyway.

Now the problem is, the guy who does Essentials says he's getting bored of it- and that we shouldn't really expect anything from him in the future. This bodes poorly for the masses who want Moxie enabled- or, you know, anything from 6th gen. Mega Absol pls

So, if that stuff is going to get fixed, it'll need to be for Reborn itself. Here's another little-kept secret: I actually am terrible with programming. I don't have the stomach for it. I write stories and make things pretty and that's about it.

SO I figure I'll ask here- is there anyone among our audience who happens to be familiar with Ruby scriptng/RGSS and would be willing to help out on getting these features worked out?

Okay, so it turns out people do love me, and I love them in return.

I'm commandeering this topic to use for organizing script stuff. Currently two people, Woobowiz and Blind Guardian have volunteered to help and rather than having everyone blindly communicating with me, let's use this topic to keep everything tidy.

Blind brought up the idea of having a list of everything that needs doing, and I think that'll work pretty well. So far everyone has been doing well with kind of just picking out a thing that needs doing and free-lancing it. Such as the Moxie thing.

So, that list is going to be here:

Task list: (priority items have been italicized)

Current functions that need fixing:

  • Sucker Punch currently hits regardless of the opponent's move -- Woobowiz
  • Pokemon with Aftermath will award no EXP when KO'd
  • In double battles, it is possible to use an item without spending a turn
  • In double battles, if a partner's Pokemon uses Roll-Out (possibly other lock-in moves?) the player is unable to switch out their own Pokemon
  • Lightning Rod and Motor Drive currently do not absorb Thunder Wave (this can maybe be fixed with the same added flag as Sucker Punch? Or a specific exception)
  • Pokemon can be permanently deleted through cancellation in the PC (I haven't been able to reproduce this yet but other users have)
  • Guard Spec is a train wreck- details
  • Pokemart sound effects
  • Level up sound effects
  • Item use sound effects
  • Possible to give a Pokemon no name at all
  • Dream World abilities can't be obtained on Pokemon with 3 abilities
  • Selection on returning to battle from pokemon/item menu
  • Link Stone can be used on Shelmet and Karrablast (maybe)
  • Ditto should copy the original's PP rather than setting each move to 5

Functions that do not currently exist (and should):

  • Trick Room
  • Probably Wonder Room and Magic Room too
  • Sheer Force
  • Contrary
  • Defiant
  • Life Orb
  • Flame Burst effect

Bonus additions:

  • Ranomized Jukebox
  • Improving Bike Speed
  • EV judge-- Blind Guardian
  • Specific trainer AI (mwahahaha)

The following section is going to just be for my personal organization when collecting these scripts because I'm currently receiving PMs that I don't want to leave marked as 'read' but I'm not on the correct computer atm to do anything about these script segments. I'm storing them here and will apply them when I can:

Trainers to have DW abilities:

The changes made are on lines 40-48 of PokemonTrainers, which now reads as follows:

count=0 # Added to test Hidden Ability for trainers
for poke in trainer[3]
species=poke[TPSPECIES]
level=poke[TPLEVEL]
pokemon=PokeBattle_Pokemon.new(species,level,opponent)
# Added to test Hidden Ability for trainers
pokemon.abilityflag=pbGet(170+count) if 3>pbGet(170+count) && pbGet(170+count)>-1
count+=1
# end added code

For hidden power checker:

Snag Map23 from PM

Moxie:

So Moxie's code is applied directly after Mummy's code in the PokeBattle_Battle script. The code for Moxie should start at line 1966.

if isConst?(user.ability,PBAbilities,:MOXIE) && user.hp>0 && target.hp<=0

        if !user.pbTooHigh?(PBStats::ATTACK)

          user.pbIncreaseStatBasic(PBStats::ATTACK,1)

          pbCommonAnimation("StatUp",user,nil)

          pbDisplay(_INTL("{1}'s Moxie raised its Attack!",user.pbThis))

        end

end

IV checker:

Map 62

It's current position is at the tail end of my PokemonUtilities file, from lines 2328 to 2404

def pbJudgeStats(pkmn)
  
  health = pkmn.iv[PBStats::HP]
  attack = pkmn.iv[PBStats::ATTACK]
  defense = pkmn.iv[PBStats::DEFENSE]
  speed = pkmn.iv[PBStats::SPEED]
  spatk = pkmn.iv[PBStats::SPATK]
  spdef = pkmn.iv[PBStats::SPDEF]
  
  # Sum the values of the IVs
  potential=0
  potential=health + attack + defense + speed + spatk + spdef
  
  # Determine the potential from the sum of the IVs
  if potential >= 0 && potential <= 90
    overall = "decent"
  elsif potential >= 91 && potential <= 120
    overall = "above average"
  elsif potential >= 121 && potential <= 150
    overall = "relatively superior"
  elsif potential >= 151 && potential <= 186
    overall = "outstanding"
  end
  
  # Determine the Pokemon's best IV
  # (uses the same method as the characteristic determinant)
  
  bestiv=0
  tiebreaker=pkmn.personalID%6
 
  for i in 0...6
    if pkmn.iv[i] == pkmn.iv[bestiv]
     bestiv = i if i >= tiebreaker && bestiv < tiebreaker
    elsif pkmn.iv[i] > pkmn.iv[bestiv]
     bestiv=i
   end
  end 
 
  # Determine the Pokemon's best IV's statname
  statname = ""
  if bestiv == 0
    statname = "Hit Points"
  elsif bestiv == 1
    statname = "Attack"
  elsif bestiv == 2
    statname = "Defense"
  elsif bestiv == 3
    statname = "Speed"
  elsif bestiv == 4
    statname = "Special Attack"
  elsif bestiv == 5
    statname = "Special Defense"
  end
  
  # Determine the Pokemon's best stat 'weight'
  if pkmn.iv[bestiv] >= 0 && pkmn.iv[bestiv] <= 15
    statweight = "relatively good"
  elsif pkmn.iv[bestiv] >= 16 && pkmn.iv[bestiv] <= 25
    statweight = "very good"
  elsif pkmn.iv[bestiv] >= 26 && pkmn.iv[bestiv] <= 30
    statweight = "fantastic"
  elsif pkmn.iv[bestiv] == 31
    statweight = "flawless"
  end
  
  ret = [overall,statname,statweight]
  
  return ret
 
end

Magic Guard

Edit: Achievement unlocked: Magic Guard fixed!

Problem: Magic Guard script incomplete

Note: Life Orb recoil is currently unlisted, but will be fixed when required.
Many of these interactions are somewhat unnecessary as combinations like Clefable + Flare Blitz/Wild Charge are super illegal but they were coded in regardless.

Solution: There were a bunch of uncaught interactions with Magic Guard, here is the full listing:
Format is

Case (filename, lines shown)

Relevant code

Imposter's activation (PokeBattle_Battler, lines 914-919):

# Imposter
    if isConst?(ability,PBAbilities,:IMPOSTER) &&
      !isConst?(opponent.ability,PBAbilities,:MAGICGUARD) &&
      !isConst?(user.ability,PBAbilities,:MAGICGUARD) &&
      !@effects[PBEffects::Transform] && onactive
      choice=pbOppositeOpposing

Rough Skin damage (PokeBattle_Battle, lines 1913-14)

if isConst?(target.ability,PBAbilities,:ROUGHSKIN) &&
        !isConst?(user.ability,PBAbilities,:MAGICGUARD) && user.hp>0

Iron Barbs damage (PokeBattle_Battle, lines 1920-21)

if isConst?(target.ability,PBAbilities,:IRONBARBS) &&
        !isConst?(user.ability,PBAbilities,:MAGICGUARD) && user.hp>0

Aftermath damage (PokeBattle_Battle, lines 1927-28)

if isConst?(target.ability,PBAbilities,:AFTERMATH) && user.hp>0 && target.hp<=0
        if !pbCheckGlobalAbility(:DAMP) && !isConst?(user.ability,PBAbilities,:MAGICGUARD)

Rocky Helmet damage (PokeBattle_Battle, lines 1934-35)

if isConst?(target.item,PBItems,:ROCKYHELMET) &&
        !isConst?(user.ability,PBAbilities,:MAGICGUARD) && user.hp>0

Leech Seed damage (PokeBattle_Battle, lines 2821-22)

# if recipient exists
        if recipient && recipient.hp>0 && !isConst?(recipient.ability,PBAbilities,:MAGICGUARD)

Poison/Toxic damage (PokeBattle_Battle, lines 2840-41)

# Poison/Bad poison
      if i.status==PBStatuses::POISON && !isConst?(i.ability,PBAbilities,:MAGICGUARD)

Burn damage (PokeBattle_Battle, lines 2866-67)

# Burn
      if i.status==PBStatuses::BURN && !isConst?(i.ability,PBAbilities,:MAGICGUARD)

Nightmare damage (PokeBattle_Battle, lines 2876-77)

# Nightmare
      if i.effects[PBEffects::Nightmare] && !isConst?(i.ability,PBAbilities,:MAGICGUARD)

Curse damage (PokeBattle_Battle, line 2893)

if i.effects[PBEffects::Curse] && !isConst?(i.ability,PBAbilities,:MAGICGUARD)

Bad Dreams damage (PokeBattle_Battle, line 3170-71)

# Bad Dreams
      if i.status==PBStatuses::SLEEP && !isConst?(i.ability,PBAbilities,:MAGICGUARD)

1/4 move recoil damage (PokeBattle_MoveEffects, lines 6304-6306)

if opponent.damagestate.calcdamage>0 && !opponent.damagestate.substitute &&
       !isConst?(attacker.ability,PBAbilities,:ROCKHEAD) &&
       !isConst?(attacker.ability,PBAbilities,:MAGICGUARD)

1/3 move recoil damage (PokeBattle_MoveEffects, lines 6322-24)

if opponent.damagestate.calcdamage>0 && !opponent.damagestate.substitute &&
       !isConst?(attacker.ability,PBAbilities,:ROCKHEAD) &&
       !isConst?(attacker.ability,PBAbilities,:MAGICGUARD)

1/2 move recoil damage (PokeBattle_MoveEffects, lines 6340-42)

if opponent.damagestate.calcdamage>0 && !opponent.damagestate.substitute &&
       !isConst?(attacker.ability,PBAbilities,:ROCKHEAD) &&
       !isConst?(attacker.ability,PBAbilities,:MAGICGUARD)

1/3 move recoil damage + para (PokeBattle_MoveEffects, lines 6359-61)

if opponent.damagestate.calcdamage>0 && !opponent.damagestate.substitute &&
       !isConst?(attacker.ability,PBAbilities,:ROCKHEAD) &&
       !isConst?(attacker.ability,PBAbilities,:MAGICGUARD)

1/3 move recoil damage + burn (PokeBattle_MoveEffects, lines 6385-87)

if opponent.damagestate.calcdamage>0 && !opponent.damagestate.substitute &&
       !isConst?(attacker.ability,PBAbilities,:ROCKHEAD) &&
       !isConst?(attacker.ability,PBAbilities,:MAGICGUARD)

Poison damage while walking (PokemonField, lines 1361-1363)

if i.status==PBStatuses::POISON && i.hp>0 && !i.egg? &&
         !isConst?(i.ability,PBAbilities,:POISONHEAL) &&
         !isConst?(i.ability, PBAbilities,:MAGICGUARD)

I think I mentioned this to almost everyone, but when changing the script files, it's going to be imperative that everyone keeps proper documentation on all of the changes they make that way I can reapply them later (especially because in the unlikely chance the original developer decides to update, EVERYTHING will have to be re-added)

This topic will be adequate for now to maintain those segments.

[spoiler] [/spoiler]

^ these tags are nice. c:

Link to comment
Share on other sites

  • Replies 78
  • Created
  • Last Reply

Top Posters In This Topic

  • 3 weeks later...

I looked into Twister's coding,

what exactly is wrong with it? It's 3 functions are already coded correctly

20% chance to flinch (it's already defined as a flinching move)

2x Damage to pokemon using Bounce or Fly (it's listed as an exception for accuracy checking vs Fly/Bounce AND scripted for double damage)

Hits Both opponents in double battle (compared it to moves like Hyper Voice and their double-battle properties are similar therefore it works)

Until I'm informed of what exactly is wrong with it, I'll just move to and implement the coding for Sucker Punch, I think it's BS that they can still land that move even if you didn't use a move.

Edited by Woobowiz
Link to comment
Share on other sites

  • Administrators

Actually, Twister has already been fixed for the episode 10 release in a patch that the original scripter sent out.

I've edited the first post to suit our needs. Since there are now three people who've offered to work on this, it's going to be critical that we keep everyone on the same page.

I'm going to write out the beginnings of a needs-doing list in that first post-tomorrow. For now, sucker punch is an excellent choice of project... though I expect a difficult one.

Additionally, could you post the changes to the script that you made to enable Moxie? Spoiler and code tags are wondrous, and I can use this topic to keep track of everything before I add them to my chaotic document (which I will perhaps also merge into this thread eventually)

Again, I really appreciate everyone's help!

Afterthought regarding sucker punch:

This page describes how moves are defined in moves.txt in the PBS folder. Wowboowiz, I'm not sure you have that available to you presently, but I'll see if I can't make a zip of it for you.

http://pokemonessentials.wikia.com/wiki/Defining_a_move

Section 13 describes flags, and I think we may have to make a new flag to indicate if it will or will not trigger sucker punch

If that's the case, then someone will have to manually edit moves.txt to add that flag for each move. Yikes, talk about tedious...

Link to comment
Share on other sites

Bice Ryen signing in! Can't make any promises that I'll be of much help, but I'll sure as hell try my best.

I certainly understand the script itself. It's easy to read and figure out. I think my problem just lies with the initial syntax and how to add on to existing scripts with my own.

Anyway, happy to be of service, hopefully not a nuisance.

Link to comment
Share on other sites

Just woke up, got 1 class in the morning and I'll be happy to code all evening.

So Moxie's code is applied directly after Mummy's code in the PokeBattle_Battle script. The code for Moxie should start at line 1966.

[ code ] doesn't combo with Spoilers :(

if isConst?(user.ability,PBAbilities,:MOXIE) && user.hp>0 && target.hp<=0

        if !user.pbTooHigh?(PBStats::ATTACK)

          user.pbIncreaseStatBasic(PBStats::ATTACK,1)

          pbCommonAnimation("StatUp",user,nil)

          pbDisplay(_INTL("{1}'s Moxie raised its Attack!",user.pbThis))

        end

end
Edited by Woobowiz
Link to comment
Share on other sites

Hm, looks like I ended up being last to the party then, huh?

Guess this is a first forum post for me too, so hello everyone! I'll keep it short and sweet though, because there's more important stuff to discuss in this thread before it gets bombed by too many Russian weight loss spammers. Been playing Reborn for over a month now and I've really been enjoying the game. When Ame asked about help sorting out some scripting issues, I figured it was time to make an account and see what I could do to help out.

can't you just set DW abilities for trainer pokemon in trainers.txt in the PBS folder? or do you want it to be random :o

That random bit is the idea, though I suppose she could set it herself.

Trainers to have DW abilities:

The changes made are on lines 40-48 of PokemonTrainers, which now reads as follows:

count=0 # Added to test Hidden Ability for trainers
for poke in trainer[3]
species=poke[TPSPECIES]
level=poke[TPLEVEL]
pokemon=PokeBattle_Pokemon.new(species,level,opponent)
# Added to test Hidden Ability for trainers
pokemon.abilityflag=pbGet(170+count) if 3>pbGet(170+count) && pbGet(170+count)>-1
count+=1
# end added code

For hidden power checker:

Snag Map23 from PM

Moxie:

IV checker:

As far as an update as to things I've been working on, haven't messed with DW/breeding interaction, but IV checker's 'potential' is finished and Hidden Power checker is further optimized by removing a loop that was uneccesary. In another hour or so I can probably have the IV checker finished. I didn't really know where to put him, so I've docked him in the Half House in the Peridot Ward as it's somewhere rather easy to find and I'm sure you can move him to wherever you desire him to be. I think the Hidden Power checker is in a decent place though, personally. I'll PM you the Hidden Power checker as soon as I sort out the map number for the Half House.

I was planning on using the "What do you want to see in v10" thread where you wrote a big #dissapointmentInbound post, as I can probably spin much of it around! One example is bike speed - it's super easy to change movement speed of the player, I can show you how if you want. About the Jukebox, I'm not sure as I haven't messed with it at all yet but I'm sure it's manageable. I could probably help sort EV-related stuff too, but that's something mostly up to you. (Although, Azurine Island is a decent place to train SpA EVs, what with Oddish/Gloom and a few others roaming around over there)

Oh and another thing about the bike - currently in-game, running is actually about 26% faster than walking, but biking is only about 8% faster than running.

I think I mentioned this to almost everyone, but when changing the script files, it's going to be imperative that everyone keeps proper documentation on all of the changes they make that way I can reapply them later (especially because in the unlikely chance the original developer decides to update, EVERYTHING will have to be re-added)

Remembered something I was going to tell you! The parts that I've added to the scripts currently are just at the end of the PokemonUtilities script. I used the same code that Khayoz got from the thread you started on pokecommunity as a band-aid until I get some of the simpler issues ironed out. Eventually I may end up diving into the compiler, but I'd rather get more of the easier stuff sorted first.

Link to comment
Share on other sites

  • Administrators

[ quote ] tags are a thing if you're just referencing a previous post btw xP

Updated the first post with the beginnings of a task list. I'll add more sporadically.

The trainers ability stuff would ideally be random, yeah

Thanks, Woobowiz--- is there some kind of shortened name I can refer to you by because that's weird to type and Woo also sounds weird but idk

Regarding the bike I do know there's a built in increase player move speed function, but I assumed that was what the bike was already using and the stage six built in speed is like whoooooooooooosh and im not sure that level whooshosity is appropriate for a simple bike.

Am I missing something?

Link to comment
Share on other sites

[ quote ] tags are a thing if you're just referencing a previous post btw xP

Updated the first post with the beginnings of a task list. I'll add more sporadically.

The trainers ability stuff would ideally be random, yeah

Thanks, Woobowiz--- is there some kind of shortened name I can refer to you by because that's weird to type and Woo also sounds weird but idk

Regarding the bike I do know there's a built in increase player move speed function, but I assumed that was what the bike was already using and the stage six built in speed is like whoooooooooooosh and im not sure that level whooshosity is appropriate for a simple bike.

Am I missing something?

Woo and Woobo work, if that nickname feels uncomfortable (a lot of people think so) just go with Chris :)

Also, I believe the current bike speed setting is Acro-bike level, as for the WOOOSH speed setting, that's might be a Mach-bike or something, I would personally prefer something in the middle.

Edited by Woobowiz
Link to comment
Share on other sites

Just woke up, got 1 class in the morning and I'll be happy to code all evening.

So Moxie's code is applied directly after Mummy's code in the PokeBattle_Battle script. The code for Moxie should start at line 1966.

[ code ] doesn't combo with Spoilers :(

if isConst?(user.ability,PBAbilities,:MOXIE) && user.hp>0 && target.hp<=0

        if !user.pbTooHigh?(PBStats::ATTACK)

          user.pbIncreaseStatBasic(PBStats::ATTACK,1)

          pbCommonAnimation("StatUp",user,nil)

          pbDisplay(_INTL("{1}'s Moxie raised its Attack!",user.pbThis))

        end

end

That is EXACTLY the script I wrote myself at one point. So the added on scripts have to be in the right places for them to work? Or is that just for organization?

EDIT: Also, might I suggest something? Skype. And a shared Dropbox folder.

Edited by biceryen
Link to comment
Share on other sites

That is EXACTLY the script I wrote myself at one point. So the added on scripts have to be in the right places for them to work? Or is that just for organization?

EDIT: Also, might I suggest something? Skype. And a shared Dropbox folder.

I stated to put it after Mummy simply for the sake of convenience and order, I am certain though, that Mummy will activate first to negate Moxie regardless of the order. But I cannot test this because I'm too lazy, if you find a trainer with at least 2 pokemon and opens up with a pokemon with Mummy, be my guest to test if Moxie is negated.

Edited by Woobowiz
Link to comment
Share on other sites

I stated to put it after Mummy simply for the sake of convenience and order, I am certain though, that Mummy will activate first to negate Moxie regardless of the order. But I cannot test this because I'm too lazy, if you find a trainer with at least 2 pokemon and opens up with a pokemon with Mummy, be my guest to test if Moxie is negated.

That's not what I was asking. Earlier, when I was trying to script Moxie, I had made it a separate script from the others. Stand-alone, for my own organization's sake. However, it didn't work. And I tried the same with yours and it gives me an error or user,nil. So I guess it just doesn't have the reference available when it's on its own.

So, guess added scripts should be included within an already existing script.

Link to comment
Share on other sites

[ quote ] tags are a thing if you're just referencing a previous post btw xP

I'm most certainly aware of this, seeing as I used quote tags within the spoiler tags in order to note that they were from posts that were not my own. I used the spoiler tags in order to save space in terms of vertical length of the post, but perhaps this is not desirable. As such, I will try using this method of post-writing instead.

Updated the first post with the beginnings of a task list. I'll add more sporadically.

Excellent, thank you kindly. I did want to ask but I presume that the things you list here take precedence over things in the "Known Bugs" thread?

The trainers ability stuff would ideally be random, yeah

Good, as that is what it was scripted to do. Note that said script relies on a single global switch whose number can be changed to suit your purposes.

Thanks, Woobowiz--- is there some kind of shortened name I can refer to you by because that's weird to type and Woo also sounds weird but idk

Regarding the bike I do know there's a built in increase player move speed function, but I assumed that was what the bike was already using and the stage six built in speed is like whoooooooooooosh and im not sure that level whooshosity is appropriate for a simple bike.

Am I missing something?

I'm not sure if you understood what I meant, so I'll explain it more in-depth here:

Essentially, within the script files there is a section of the file called Walk_Run that literally gives numerical values attributed to the movespeed of the player under certain conditions. This section is a function definition for the Player called 'update' and is displayed below:

 def update
    if !moving? && !@move_route_forcing && $PokemonGlobal
      if $PokemonGlobal.bicycle
        @move_speed = $RPGVX ? 8 : 5.2 [b]# Movespeed of a player on a bike[/b]
      elsif pbCanRun?
        @move_speed = $RPGVX ? 6.5 : 4.8 [b]# Movespeed of a running player[/b]
      else
        @move_speed = $RPGVX ? 4.5 : 3.8 [b]# Movespeed of a walking player[/b]
      end
    end
    update_old
 end 
Currently, the player's movement is set to 5.2 units on a bike. I realize that the way this information is presented may be confusing to some of you, so here's a quick explanatory analysis of the bike section:

@move_speed is the value of the player's movespeed in-game.

= is an equals sign, in this case being used as an assignment operator to assign whatever value the right side has to the left side variable.

$RPGVX ? 8 : 5.2

The above is a special statement called the ternary operator, which means that it's a shortened form of an if statement. In short, the information is presented like:

condition ? true case : false case

In the above case, the game checks to see if this is the RPGVX Ace engine or not. If it is, the player's bike speed is 8 and if not then the speed is 5.2 - this is likely due to the fact that VX Ace and XP calculate their speeds differently.

Woo and Woobo work, if that nickname feels uncomfortable (a lot of people think so) just go with Chris :)

Also, I believe the current bike speed setting is Acro-bike level, as for the WOOOSH speed setting, that's might be a Mach-bike or something, I would personally prefer something in the middle.

This is assuredly a reasonable request, I think the sweet spot to test the feel of a speedier bike is around 5.8 to 6.2, though I have it as 5.8 in my game currently. Additionally, you/we/whomever should be careful not to set the speed too high, as going too quickly can cause the player to skip over events as the player arrives before the game has registered that they are there. Example: I set the speed to 10.2 to see how fun going that fast would be. I whoooooshed around faster than the mach bike, but when I tried to go under the Opal Bridge and ended up hitting the bridge tiles but not going under.

That's not what I was asking. Earlier, when I was trying to script Moxie, I had made it a separate script from the others. Stand-alone, for my own organization's sake. However, it didn't work. And I tried the same with yours and it gives me an error or user,nil. So I guess it just doesn't have the reference available when it's on its own.

So, guess added scripts should be included within an already existing script.

Erm.. yes and no. This post is already obscenely long so I'll try to make this one concise. Where a piece of code goes is entirely dependant on what it's purpose is. One example is the code used in band-aiding hidden ability pokemon being generated in the wild. Since this function is somewhat stand-alone (it checks to see if a switch is on, and if so does its thing) it can go at the bottom of the PokemonUtilities script and be fine. Scripts that have to do with battles and the like are heavily locked into place by a semi-complex series of if statements - it's not just for organization purposes, it's done in a way such that each item on the battle's checklist can be marked off and everything progresses smoothly. Last, the scripts are in an order such that the bottom-most (I can't think of any other phrase to explain this with) script is considered (which is why the Main script NEEDS to be the last script otherwise absolutely everything breaks).

Finally, the Hidden Power checker and IV Judge are ready to go, but I would really rather optimize them first. Unfortunately, I can't really lag test them as I do have a decent machine at the moment. Going to see how many global variables I'd need and sort out an ideal way to code it.

Edited by Blind Guardian
Link to comment
Share on other sites

Thank you for the explanation. I guess I do have the ability to script, it's just figuring out where to put it exactly is my problem. Also maybe the syntax still. But it seems all new script will start with def unless it's added in with with an already existing defined script. Like with Moxie.

Link to comment
Share on other sites

Thank you for the explanation. I guess I do have the ability to script, it's just figuring out where to put it exactly is my problem. Also maybe the syntax still. But it seems all new script will start with def unless it's added in with with an already existing defined script. Like with Moxie.

Yes, a function needs to be defined before it can be used. That is a core element of writing functions.

And as much as I'd like to assign myself the EV Judge, I suppose I should look into the functionality of Magic Guard and Trick Room as they were significant in episode 9's storyline.

...which leads me to the query of which essentials version are we using Ame? v12? 12.1? 12.2?

Edited by Blind Guardian
Link to comment
Share on other sites

Yes, a function needs to be defined before it can be used. That is a core element of writing functions.

And as much as I'd like to assign myself the EV Judge, I suppose I should look into the functionality of Magic Guard and Trick Room as they were significant in episode 9's storyline.

...which leads me to the query of which essentials version are we using Ame? v12? 12.1? 12.2?

It's 12.2.

Also, my bad for double post.

Edited by biceryen
Link to comment
Share on other sites

It's 12.2.

Also, my bad for double post.

Double posting is poor form - editing is best!

Thank you for the info though, I would rather spend time sorting out magic guard then searching for a version number within the codebase. It also means that I can use 12.2's changelog to see things that may/may not have been fixed, but are we certain 12.2 is used in ep9 (ie Twister issues are fixed in 12.2 iirc?)

Link to comment
Share on other sites

Still working on Sucker Punch, was sidetracked by EV training.

At the same time, why don't one of us look into the coding for double battles?

If we understand the logic behind those scripts, we can easily trace out a few methods we can piece together to fix Flame Burst, perhaps use/define a method that checks if the move is used during a double battle and a conditional checking that there are no nil placeholders (on the case that the receiving side has 1 pokemon left on the field).

Pseudo code could be as follows in flame burst's defined method (should not be additionaleffect, because we want to apply only burn damage, not base damage + burn damage)

If double battle is in effect
         Apply damage equal to 1/16th of the respective pokemon's total HP
         UNLESS : the side receiving the attack does have a nil placeholder
Link to comment
Share on other sites

Well 'Woobowiz' is supposed to be working on getting Sucker Punch's function to work as it does in-game, Ame is likely mapping things and doing story-related stuff, and I'm currently working on Hidden Power checker, IV Judge, and Magic Guard.

From the above list, is there anything you think you can handle looking into? Perhaps making it so Thunder Wave triggers Lightningrod and Motor Drive?

Link to comment
Share on other sites

Still working on Sucker Punch, was sidetracked by EV training.

At the same time, why don't one of us look into the coding for double battles?

If we understand the logic behind those scripts, we can easily trace out a few methods we can piece together to fix Flame Burst, perhaps use/define a method that checks if the move is used during a double battle and a conditional checking that there are no nil placeholders (on the case that the receiving side has 1 pokemon left on the field).

Pseudo code could be as follows in flame burst's defined method (should not be additionaleffect, because we want to apply only burn damage, not base damage + burn damage)

If double battle is in effect
         Apply damage equal to 1/16th of the respective pokemon's total HP
         UNLESS : the side receiving the attack does have a nil placeholder

Just looked into it. Looks like there's something similar with the move Encore in PokeBattle_Battle. So, shouldn't be too difficult.

Link to comment
Share on other sites

  • Administrators

Actually, I've messed up a bit here in regards to the version everyone has.

I sent 12.2 with RPG Maker to Bice and Woobo, but Episode 9/9.5 is 12.1. My working copy of episode 10, though, has already been updated to 12.2, however the 12.2's that the others have won't work with my copy because I've already made a bunch of other modifications from previous episodes.

Hence why we just have to record whatever changes are made.

I'll add Flame Burst to the list in the first post- I didn't even know it did that, lol...

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.

×
×
  • Create New...