Jump to content

Scripting Organization Topic! <3


Amethyst

Recommended Posts

  • Replies 78
  • Created
  • Last Reply

Top Posters In This Topic

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

Oh no.

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.

Which means that I'm running into problems that don't even exist in your versions? <_<

This is what I get for using the files I got from the episode 9 update.

..wait a second, what do you mean "sent 12.2 with RPG Maker" - did you send them the RPG Maker program?

I'm getting gypped over here. Welcome to Gypville, Population: 1

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...

(and that effect is blocked by Magic Guard)

Which brings me to my next point - Why is it that there is no concise list as to what qualifies as "indirect damage"?

From what I gather of the code, Magic Guard currently protects you from:

- Black Sludge damage to non-poison types
- Spikes damage
- Stealth Rock damage
- Sandstorm damage
- Hail damage
- Sticky Barb damage
From what I can recall/know of 'indirect damage' this means that I'd need to code:
- Burns (tested with Flame Orb)
- Poison (tested with Toxic Orb)
- Move recoil?
- Curse?
- Leech Seed?
- Life Orb recoil?

- Other things that I don't know of because there isn't a list of things Magic Guard blocks?

Edited by Blind Guardian
Link to comment
Share on other sites

Which brings me to my next point - Why is it that there is no concise list as to what qualifies as "indirect damage"?

From what I gather of the code, Magic Guard currently protects you from:

- Black Sludge damage to non-poison types
- Spikes damage
- Stealth Rock damage
- Sandstorm damage
- Hail damage
- Sticky Barb damage
From what I can recall/know of 'indirect damage' this means that I'd need to code:
- Burns (tested with Flame Orb)
- Poison (tested with Toxic Orb)
- Move recoil?
- Curse?
- Leech Seed?
- Life Orb recoil?

- Other things that I don't know of because there isn't a list of things Magic Guard blocks?

Magic Guard prevents:

Weather damage

Poison after every turn

Curse damage

Leech Seed Damage

Spikes

Recoil (Except Struggle)

Life Orb Recoil

Imposter Ability

Sticky Barb

Rough Skin

Magic Guard does NOT prevent:

Toxic Spikes entry hazard (the part where you send in a non-flying/levitate pokemon out on the field and they get poisoned because of it)

Trapping moves (Fire Spin, Wrap, etc)

Perish Song

Belly Drum

Substitute

"It hits itself in confusion"

Destiny Bond

Edited by Woobowiz
Link to comment
Share on other sites

Magic Guard prevents:

Weather damage

Poison after every turn You missed burn damage in your list even though I have it in mine..?

Curse damage

Leech Seed Damage

Spikes (and rocks)

Recoil (Except Struggle)

Life Orb Recoil

Imposter Ability Good call, I should probably special case this.

Sticky Barb

Rough Skin I presume Rocky Helmet by association?

I feel like there's more than we're missing still...

Also I don't need the list of things Magic Guard doesn't effect as I won't be adding anything there. I appreciate the effort though.

Edited by Blind Guardian
Link to comment
Share on other sites

I feel like there's more than we're missing still...

Also I don't need the list of things Magic Guard doesn't effect as I won't be adding anything there. I appreciate the effort though.

You are correct in what you stated in red.

also, Iron Barbs

Do remember that in the case of Burns, it should still apply the Attack reduction, even when the burn damage is prevented.

Link to comment
Share on other sites

You are correct in what you stated in red.

also, Iron Barbs √ check

Do remember that in the case of Burns, it should still apply the Attack reduction, even when the burn damage is prevented.

It's not like I have to hard code the attack reduction from burns, mate.

That stuff's already there, I just need to add a ifAbilityIsNotMagicGuard clause like how it is on the things it already protects you from.

Because double posting is in bad form, I'll just edit this in. I spent a few hours today entirely recoding the way that I made the IV Judge work, so now it doesn't rely on any global variables or switches. Now, it's process is (almost) entirely coded as a function in PokemonUtilities, for ease of access, manipulation, and so it runs smoothly. I believe that this would be an ideal solution. All that I need to do now is add in whatever Ame wants him to say or make something up on my own? But this also means that I have a basis on which to build the EV Judge if Ame still wants that.

So, to add to the completed list:

- Hidden Power checker

- IV Judge

..back to sorting Magic Guard then.. yaay.

Edited by Blind Guardian
Link to comment
Share on other sites

  • Administrators

I can deal with these guys' text myself easily, and an EV judge would be cool too (I've seen people asking for such a thing on here) but again, it's not a high priority. If you want to? Go for it

Bice is dropping out; he doesn't feel he'll be much help, so it's just you two now (unless anyone else joins in)

Now that I'm finally on the right computer, let me attach moves.txt for you, Woobo. You can probably see how to add a flag using this page and the entries on the text document

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

So it looks like we're on flag m. I'll probably have to do the tedium of adding the flags to each move myself (unless I can enlist another user to help me with that) but you can at least see what you're referencing here.

moves.txt

Link to comment
Share on other sites

I can deal with these guys' text myself easily,

Aw maaan, well hopefully the little bits of writing I did for them is at least somewhat helpful.

and an EV judge would be cool too (I've seen people asking for such a thing on here) but again, it's not a high priority. If you want to? Go for it

This is definitely something within my power to do, but for the moment Magic Guard is my top priority.

Bice is dropping out; he doesn't feel he'll be much help, so it's just you two now (unless anyone else joins in)

Well, I'm sad to lose Bice as a ..scripting-teammate? It seemed like he was understanding the scripts but there doesn't seem to be much I can do there.

Now that I'm finally on the right computer, let me attach moves.txt for you, Woobo. You can probably see how to add a flag using this page and the entries on the text document

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

So it looks like we're on flag m. I'll probably have to do the tedium of adding the flags to each move myself (unless I can enlist another user to help me with that) but you can at least see what you're referencing here.

Don't think that I want to put too much on my plate, so I'll let Woobowiz field this one unless you guys need my help.

Also currently on my list of things to script/clean up later:

* Magic Guard *

- Trick Room

- EV Judge

- sorting out DW ability normalization

- move tutor? (my friends keep asking me for this one hahah)

- selection issues (noticed when I made IV Judge)

- some battle mechanics not working as they should which I've been noticing when testing for Magic Guard

I eagerly await Woobowiz's next scripting update (and will try to get as much as I can done before Ame's next game content update)

Link to comment
Share on other sites

This thread makes me feel dumb, how do I even access the actual game script?

I'm not sure if this is supposed to be some kind of secret or not..?

If you have a copy of RPG Maker and the game's project file, you can open it in RPG Maker. Once you've done that, there are 3 ways to get to the script:

1 - Hitting F11 when looking at the main window

2 - The 'Script Editor' button under the menu bar

3 - Tools>Script Editor in the menu bar

You can't actually access the script when in-game though, if that's what you were asking?

Edited by Blind Guardian
Link to comment
Share on other sites

Does the trial version of RPG Maker give me enough to seriously tinker with this?

I guess? The trial version doesn't have much of anything different from the full version except for a timer of 30 days to use it iirc.

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)

Revised list of things to script/clean up later:

- Magic Guard

- Stored Power

- Trick Room

- EV Judge

- sorting out DW ability normalization

- move tutor?

- selection issues (noticed when I made IV Judge)

- some battle mechanics not working as they should which I've been noticing when testing for Magic Guard

- most notably, spikes and stealth rocks don't have a damage effect

Edited by Blind Guardian
Link to comment
Share on other sites

  • 2 weeks later...

Sorry for the long disappearance, I had a week long camping trip (still a miracle all my college professors was cool with the short notice)

The short moments where I have time to myself I had to balance coding with college work, so unfortunately not much has been done.

I did however got to work on Sucker Punch for a bit, do note that this is NOT complete yet

class PokeBattle_Move_116 < PokeBattle_Move
  def pbEffect(attacker,opponent)
    if !(opponent.currentMove.pbIsPhysical? || opponent.currentMove.pbIsSpecial?)
      @battle.pbDisplay(_INTL("But it failed!"))
      return -1
    elsif opponent.currentMove.priority > 0
      @battle.pbDisplay(_INTL("But it failed!"))
      return -1
    end
    return 0
  end
end

If Blind Guardian can assist me on figuring out whether or not a variable indicating "The move the opponent used on the exact turn you use Sucker Punch" exists, and if so where? If not, that will just take longer and a LOT more coding.

Literally all that needs to be replaced for the move to work is to switch out "currentMove" with whatever variable used to point at the move the opponent is using....

Edited by Woobowiz
Link to comment
Share on other sites

  • Administrators

If it isn't your place to ask, which I don't know why it wouldn't be, then I'll ask:

Can something be done about battle speed? I'm legitimately unsure if there are arbitrary wait commands inserted into the script to pace it, or if it's really just processing speed

Link to comment
Share on other sites

Oh wow, you asked me this two days ago and I hadn't even seen it yet! My bad, I've got a new job and have been pretty busy balancing school/job stuff.
I will definitely set aside some time for this during downtime(s) at work although I'm sort of writing my own story? ...it's a thing.

Sorry for the long disappearance, I had a week long camping trip (still a miracle all my college professors was cool with the short notice)

The short moments where I have time to myself I had to balance coding with college work, so unfortunately not much has been done.

I did however got to work on Sucker Punch for a bit, do note that this is NOT complete yet

class PokeBattle_Move_116 < PokeBattle_Move
  def pbEffect(attacker,opponent)
    if !(opponent.currentMove.pbIsPhysical? || opponent.currentMove.pbIsSpecial?)
      @battle.pbDisplay(_INTL("But it failed!"))
      return -1
    elsif opponent.currentMove.priority > 0
      @battle.pbDisplay(_INTL("But it failed!"))
      return -1
    end
    return 0
  end
end
If Blind Guardian can assist me on figuring out whether or not a variable indicating "The move the opponent used on the exact turn you use Sucker Punch" exists, and if so where? If not, that will just take longer and a LOT more coding.

Literally all that needs to be replaced for the move to work is to switch out "currentMove" with whatever variable used to point at the move the opponent is using....


Hmm, I'm not sure that I remember one offhand, but I can look into this shortly. Let me go find my external with Reborn on it and I'll check this out in just a sec.

It probably isn't my place to ask, but can something be done about the battles' speed?

If it isn't your place to ask, which I don't know why it wouldn't be, then I'll ask:
Can something be done about battle speed? I'm legitimately unsure if there are arbitrary wait commands inserted into the script to pace it, or if it's really just processing speed

I uh.. I'm not sure? I'll look for any 'wait' type commands, but I wasn't aware that it was any slower that console games are (unless you encounter lag for some unspecified reason)?
...unless you're asking me to make it faster than console games in which case I can see what I can do?

The last thing I was working on was the EV checker, but I got completely caught up in my own devices and big splash of worldbuilding... I'll reel it all back in and see what I can do here though (as it appears as if I'm pretty behind on stuff).

Edit1: Quickly checked over the PokeBattle_Battle file and I don't see any "wait" type commands. I do see a ton of raw processing that needs to be done in a battle, more than I had expected. Needless to say that much of it (likely all of it) is necessary in order for the game to run smoothly. I'm not even sure how I'd go about improving the battle's speed right now, but I can think about it overnight and see if I can come up with anything.. I guess. No promises though -- for the moment consider my answer to be that there is no way to increase the game's speed internally without seriously compromising it (via removal of many edge cases or something). Onto the 'currentMove' deal.

Edit2: Initial estimate makes me think it's one of the following:

attr_accessor :lastMoveUsed
attr_accessor :lastMoveUsedSketch
attr_accessor :lastMoveCalled

Attempting to figure out the specifics of each at the moment (there's always tomorrow morning for database homework, right?)
Edited by Blind Guardian
Link to comment
Share on other sites

I doubled the speed of a few animations during the battle phase, such as fade ins and fade outs, nothing much I can do about the animations for losing HP though.

It's quite a bit of changes, but it will speed up your battles a tad.

This is in PokeBattle_ActualScene

Change Line 559

self.x-=16

Change line 807 to

self.x-=12

Change line 810 to

self.x+=16

Change line 842 and 957 to

STARTZOOM=0.25

Change Lines 1053 - 1059 to

    @sprites["trainer"].x+=16
    @sprites["trainer2"].x+=16 if @sprites["trainer2"]
    @sprites["partybase1"].x+=16
    @sprites["partybase1"].opacity-=24
    for i in 0...6
      @sprites["enemy#{i}"].opacity-=24
      @sprites["enemy#{i}"].x+=16 if @frame>=i*4

Change lines 1085 - 1092 to

    @sprites["player"].x-=16
    @sprites["playerB"].x-=16 if @sprites["playerB"]
    @sprites["partybase2"].x-=16
    @sprites["partybase2"].opacity-=24
    for i in 0...6
      if @sprites["player#{i}"]
        @sprites["player#{i}"].opacity-=24
        @sprites["player#{i}"].x-=16 if @frame>=i*4

Change lines 1533 and 1541 to

    10.times do

Change line 1536 to

      @sprites["trainer"].x-=12

Change line 1544 to

      @sprites["trainer"].x+=12

Change line 1834 and 1835 to

        @viewport.rect.y-=8
        @viewport.rect.height+=16

Change line 1841 to

      appearspeed=16

Change line 2518 and 2519 to

    10.times do
      tempsprite.y+=16
Edited by Woobowiz
Link to comment
Share on other sites

Oh wow, you asked me this two days ago and I hadn't even seen it yet! My bad, I've got a new job and have been pretty busy balancing school/job stuff.

I will definitely set aside some time for this during downtime(s) at work although I'm sort of writing my own story? ...it's a thing.

Hmm, I'm not sure that I remember one offhand, but I can look into this shortly. Let me go find my external with Reborn on it and I'll check this out in just a sec.

I uh.. I'm not sure? I'll look for any 'wait' type commands, but I wasn't aware that it was any slower that console games are (unless you encounter lag for some unspecified reason)?

...unless you're asking me to make it faster than console games in which case I can see what I can do?

The last thing I was working on was the EV checker, but I got completely caught up in my own devices and big splash of worldbuilding... I'll reel it all back in and see what I can do here though (as it appears as if I'm pretty behind on stuff).

Edit1: Quickly checked over the PokeBattle_Battle file and I don't see any "wait" type commands. I do see a ton of raw processing that needs to be done in a battle, more than I had expected. Needless to say that much of it (likely all of it) is necessary in order for the game to run smoothly. I'm not even sure how I'd go about improving the battle's speed right now, but I can think about it overnight and see if I can come up with anything.. I guess. No promises though -- for the moment consider my answer to be that there is no way to increase the game's speed internally without seriously compromising it (via removal of many edge cases or something). Onto the 'currentMove' deal.

Edit2: Initial estimate makes me think it's one of the following:

attr_accessor :lastMoveUsed
attr_accessor :lastMoveUsedSketch
attr_accessor :lastMoveCalled

Attempting to figure out the specifics of each at the moment (there's always tomorrow morning for database homework, right?)

Just for hindsight's sake,

I'm 80% sure you should ignore the "return 0" line, because otherwise the move won't work at all.

Again, just hindsight.

Link to comment
Share on other sites

I've worked on a fix for the Item abuse bug in double battles.

I am 80% sure this works, but again this HASN'T been tested (I did all the double battles you can do in my save file, so I'll need someone else's)

This is in PokeBattle_Battle

After Line 2363 add

       usedItem=false

At line 2403 add

                  usedItem=true

Change line 2426 to

            elsif cmd==-1 && !usedItem  # Go back to first battler's choice

EDIT: Doesn't work, looking for another way.

Edited by Woobowiz
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...