Jump to content

14.6: Trick-or-Treat is Broken.


ReddestDream

Recommended Posts

  • Administrators

Since this is an argument error, that actually shouldn't matter. This error would be consistent with any usage of the move. It's being called with an extra parameter, so likely all we need to do is remove it. The same will go for Forest's Curse, presumably.

Link to post
Share on other sites

Can you give a bit more context of the situation? What pokemon were you facing? What was their health like? Were they afflicted with a status? etc.

I was fighting a Pumpkaboo in Beryl Cemetery after I got the Soul Candle.

I was able to reproduce this every time Pumpkaboo used Trick-or-Treat, regardless of other conditions.

The effect of Trick-or-Treat never actually works and the turn is skipped.

Since this is an argument error, that actually shouldn't matter. This error would be consistent with any usage of the move. It's being called with an extra parameter, so likely all we need to do is remove it. The same will go for Forest's Curse, presumably.

That makes sense to me . . . Thanks! ^_^

Link to post
Share on other sites

Since this is an argument error, that actually shouldn't matter. This error would be consistent with any usage of the move. It's being called with an extra parameter, so likely all we need to do is remove it. The same will go for Forest's Curse, presumably.

I know but for some reason the specific lines of code that the error referred me to were pointing me in the direction of the move Psycho Shift..... so I was trying to pinpoint if things had been moved or what not, because I don't know what that'd have to do with this.

Link to post
Share on other sites

I know but for some reason the specific lines of code that the error referred me to were pointing me in the direction of the move Psycho Shift..... so I was trying to pinpoint if things had been moved or what not, because I don't know what that'd have to do with this.

I see what you mean, its almost like using trick or treat is trying to call another move, but I see nothing that would cause that. Now Im curious, gunna use the old school print to console and work my way from the inside out till we can find the exact real line thats causing the issue.

edit:

Hallelujah I have seen the light!

The error occurs when its checking for the multitype ability. Im not sure what the correct way to check it is, but however its doing it is certainly wrong. I tried commenting out the block of code in PokeBattle_MoveEffects lines 9110-9113 and the ability worked. Somethings wrong with the way isConst? is being called.

edit2: Forests curse does use the same line of code and has the exact same issue :)

edit3:

Got the proper fix from checking other moves. Change lines 9080 and 9110 to 'if isConst?(opponent.ability,PBAbilities,:MULTITYPE)'

obviously minus the qoutes. Youre basically just dropping the (true) from opponent.ability(true). May be worth checking if this bug exists elsewhere too

Link to post
Share on other sites

I see what you mean, its almost like using trick or treat is trying to call another move, but I see nothing that would cause that. Now Im curious, gunna use the old school print to console and work my way from the inside out till we can find the exact real line thats causing the issue.

edit:

Hallelujah I have seen the light!

The error occurs when its checking for the multitype ability. Im not sure what the correct way to check it is, but however its doing it is certainly wrong. I tried commenting out the block of code in PokeBattle_MoveEffects lines 9110-9113 and the ability worked. Somethings wrong with the way isConst? is being called.

edit2: Forests curse does use the same line of code and has the exact same issue :)

edit3:

Got the proper fix from checking other moves. Change lines 9080 and 9110 to 'if isConst?(opponent.ability,PBAbilities,:MULTITYPE)'

obviously minus the qoutes. Youre basically just dropping the (true) from opponent.ability(true). May be worth checking if this bug exists elsewhere too

I've just made this change. I'll come back and confirm that it fixes the issue for me in a bit . . . Thanks! ^_^

Edit: It no longer crashes when I use it, and it properly changes the opponent's type to Ghost. Seems to be working! Thanks! ^_^

Link to post
Share on other sites

So, is Trick-Or-Treat functioning properly? Or does the error message just not appear anymore?

It functions properly with my fix, not in vanilla Reborn. Ive tested it pretty thoroughly, same deal with Forests Curse. I posted the lines that need patched and to what in my last post.

Link to post
Share on other sites

It's as I thought. It DOES stop the error from functioning, however it does not add the type to pokemon's already existing type. It make's it into a pure ghost/grass respectively. I don't think there's anything coded in for the existence of a 3rd type right now. This is how it was for a while, before all of the errors were more obvious due to essentials v15

Link to post
Share on other sites

Alright so the problem here with Trick-or-treat seems to be the same problem as present, where the error pops up, but then the battle proceeds as if you used your turn. Am I correct? Because when present is used, an error like this happens, and it does no damage/healing whatsoever. It seems here, the same kind of error pops up, no type is added and the battle continues. Are there any other moves like this? Does Forest's Curse work?

Link to post
Share on other sites

Alright so the problem here with Trick-or-treat seems to be the same problem as present, where the error pops up, but then the battle proceeds as if you used your turn. Am I correct? Because when present is used, an error like this happens, and it does no damage/healing whatsoever. It seems here, the same kind of error pops up, no type is added and the battle continues. Are there any other moves like this? Does Forest's Curse work?

The error in Trick or Treat is a typo/didnt get changed when a function updated + Essentials doesnt support having a third type, so ToT simply acts as a ghost type Soak, same with Forests Curse. I fixed the typo, but I can look at present and see what its issue is.

Link to post
Share on other sites

It's as I thought. It DOES stop the error from functioning, however it does not add the type to pokemon's already existing type. It make's it into a pure ghost/grass respectively. I don't think there's anything coded in for the existence of a 3rd type right now. This is how it was for a while, before all of the errors were more obvious due to essentials v15

My bad. I thought it was supposed to change the type completely, not just add the type . . .

You are right. It doesn't just add the type, and it is supposed to . . .

http://bulbapedia.bulbagarden.net/wiki/Trick-or-Treat_(move)

Edit: Thank you madf0x for looking into this! If you can fix Present too, that would be awesome! ^_^

Link to post
Share on other sites

Trying to add support for a third type properly would require a lot of unstable changes, so thats not territory Im gunna dive into.

Im having no issues with Present, probably should be its own topic, but do you have a screenshot of the error and the exact situation in which it occurs?

Edit: Ok, theres a bug when it heals, and I know the line its messing up on, working on something to fix it now. And now I cant get it to appear. Hmm, I hate phantom bugs like these.

edit: Aha! Got it!. the bug occurs when present tries to heal when doing no damage first! It tries to use an empty variable :>) I have a fix, just need to test it to make sure.

Ok so move the line '@calcbasedmg=1' so that its under line 4041 to ensure that it gets calculated when pbEffect is called. And whamo Present is fixed.

Link to post
Share on other sites

Trying to add support for a third type properly would require a lot of unstable changes, so thats not territory Im gunna dive into.

Im having no issues with Present, probably should be its own topic, but do you have a screenshot of the error and the exact situation in which it occurs?

Edit: Ok, theres a bug when it heals, and I know the line its messing up on, working on something to fix it now. And now I cant get it to appear. Hmm, I hate phantom bugs like these.

edit: Aha! Got it!. the bug occurs when present tries to heal when doing no damage first! It tries to use an empty variable :>) I have a fix, just need to test it to make sure.

Ok so move the line '@calcbasedmg=1' so that its under line 4041 to ensure that it gets calculated when pbEffect is called. And whamo Present is fixed.

So like this, right?

4034: class PokeBattle_Move_094 < PokeBattle_Move

4035: def pbBaseDamage(basedmg,attacker,opponent)
4036: return @calcbasedmg
4037: end
4038:
4039: def pbEffect(attacker,opponent,hitnum=0,alltargets=nil,showanimation=true)
4040: r=@battle.pbRandom(10)
4041: if r<4
4042: @calcbasedmg=1
4043 @calcbasedmg=40
Link to post
Share on other sites

No ya moved it a bit too far, I shoulda been more clearer, move it above r=@battle.pbRandom(10) so its:

4039: def pbEffect(attacker,opponent,hitnum=0,alltargets=nil,showanimation=true)
4040: @caclbasedmg=1
4041: r=@battle.pbRandom(10)
Link to post
Share on other sites

No ya moved it a bit too far, I shoulda been more clearer, move it above r=@battle.pbRandom(10) so its:

4039: def pbEffect(attacker,opponent,hitnum=0,alltargets=nil,showanimation=true)
4040: @caclbasedmg=1
4041: r=@battle.pbRandom(10)

Thanks! I've made this change. I don't have any way to test it right now, but the game still loads at least . . .

Link to post
Share on other sites

For testing purposes, the debug menu lets you teach a move to any pokemon. Thats how I played with it.

I've never used the Debug Menu before, but I'll look into it. I'm just using Gemini to edit the Scripts.rxdata file . . .

Link to post
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...