Help with arrays and structures I think.
-
So I'm making a catching game kind of like Pokémon but when ever I get a monster I have it display the name of the monster along with the state of a bool. But the problem is it always displays the same line even if it's another monster. I'm using an array but I'm finding it hard to get to work.Video of problem
-
If I'm understanding right, it looks like
if c.zr and battleStarted and OrbRNG < 5 and NumMon < 3 and EnemyMonsters[0].id == 0 then
will always be true, therefore always changing battleStarted to false and so the next two ifs don't get read.
I'm guessing you have a variable that stores which enemy you've come across? In which case perhaps your ifs should look like this:if c.zr and battleStarted and OrbRNG < 5 and NumMon < 3 and EnemyMonsters[0].id == enemyEncountered then
-
Thanks a bunch I'll give it a try!
-
@kat hi sorry I'm having some trouble understanding how I would set up the enemy encounter variable
-
@poof92 apologies, I meant enemyEncountered to be a placeholder for a variable I'm guessing you have already. Do you have one which picks the enemy you encounter? For example in the video you shared it picks the Whisp.
-
@kat yes I think I do, I have a variable called R which is equal to random to randomly pick a monster
-
It works thanks so much for the help
-
@poof92 Great! You're welcome :) Glad I could help!