Advertiser Content

Error self-fulfilling IF conditions?

Started by kwaiipotato 3 Weeks Ago 10:54 AM
  • 664 views
  • 4 replies
Seen 2 Weeks Ago
Posted 2 Weeks Ago
6 posts
1.4 Years
I'm using 16.x (I don't know if 17.x has an elite battle system equivalent, if it does please tell me so I can switch)
I do not know why or how, but some IF lines in my essentials are making the conditions true before checking said contidions. and it even modifies pokemon.PBS when I run the game.

for example:
if pokemon.ballused = 26
makes the pokemon's ballused value 26 and then checks if the value is 26.

and also
if opponent.hasWorkingAbility(:STURDY)
replaces the pokemon in question's ability for sturdy before checking, modifying the pokemon.PBS

this wrecked my PBS file and I had to remake it, please halp u.u

Maruno

Lead Dev of Pokémon Essentials

England
Seen 6 Days Ago
Posted 6 Days Ago
5,199 posts
11.9 Years
One = means "set the variable on the left to the value of what's on the right". Two == is what you use to compare two values.

Your examples really shouldn't have altered anything in the PBS files. How were you using this code to make that happen?
Go to the Essentials Docs Wiki

Essentials Docs Wiki

Follow me on Twitter: @maruno42


Luka S.J.

Jealous Croatian

Age 26
Male
Croatia
Seen 4 Days Ago
Posted 1 Week Ago
1,148 posts
11 Years
(I don't know if 17.x has an elite battle system equivalent, if it does please tell me so I can switch)
EBS is compatible with v17.x out of the box.

http://resources.luka-sj.com/
Advertiser Content