Eggsteps-like variable for Pokemon

arukhan

Rookie
Member
Joined
Aug 16, 2018
Posts
2
Hi.

I'm experimenting lately with variables. I did a small exercise to create an eggsteps-like variable not for Eggs but for Pokemon which value would increase/decrease with each step in the overworld. After reaching a given value, a message would be displayed for each individual Pokemon in the party. Since this variable would be accounted at different times(depending on the Pokemon withdrawn/deposited with the use of PC, newly caught etc.), the messages would be then displayed at different times. Unfortunately, so far the value of the variable is treated globally for all of the Pokemon in the party and it doesn't matter when the Pokemon was put in the party - the messages pop out at the same exact time.

It may be a simple thing but I seem to be at a loss? Do you guys have some idea for creating one like this?

I tried to get some inspiration by going through Poison Effect, Happiness(Steps) and Eggs Hatching but it doesn't seem to give me any idea how to proceed.

Any help will be appreciated ;)
 

arukhan

Rookie
Member
Joined
Aug 16, 2018
Posts
2
Maybe make something like this
Code:
class PokemonGlobalMetadata
  attr_accessor :talksteps

  def talksteps
    talksteps=0 if !@talksteps
  end
end

Thanks for your answer!
Unfortunately, it doesn't seem to solve the problem.

Maybe let me show you the code I have as of now:

Code:
# Talk after Step
Events.onStepTaken+=proc {
  $PokemonGlobal.newSteps = 0 if !$PokemonGlobal.newSteps
  $PokemonGlobal.newSteps += 1
  for i in $Trainer.ablePokemonParty
    end
  if $PokemonGlobal.newSteps==200
    for i in $Trainer.ablePokemonParty
      Kernel.pbMessage(_INTL("{1}, new text.",i.name))
    end
  end
}

Def and attr_accessor are in the PokemonGlobalMetadata class with the rest.

I tried with different variable types and def of the newSteps but it doesn't seem to change much. The message pops up after 200 steps as constructed, however, as mentioned before, it pops up for each Pokemon in the party at the same time, no matter when the Pokemon was put into the party. If a Pokemon was put in the party after the message popped up once, it doesn't pop up for that Pokemon at all.

My understanding of rgss language is so far basic at most, so I wouldn't be surprised if I mixed something or missed an important part.

Do you have some idea of how to proceed? I'll go through the codes for happiness, poison and egg hatching, maybe some of the dex categories as well in my free time but if you have anything in mind, I'd be grateful for help.
 
Last edited:
Top