You should consider joining our Discord to ask for support.

We created a support channel using the new Discord Forum feature!

You can also visit our new website, it has a help section in English and French

0 like 0 dislike
690 views
in Script help by (570 points)
closed by
Hi,

I'm trying to create a new battle status. It's like "attracted to" but the pokemon is attracted with 100% chances at every turn.

It's a for a tutorial battle against our mom. I found the script 01700 States.rb where I think I should enter a new state. But I don't figure what to do after...

Also I want to give this status at the beggining of the battle, is this something possible ?

Maybe there is another way to make a battle like this without being forced to create a new state...

Thanks for your help.
closed with the note: solved

1 Answer

1 like 0 dislike
by (28.0k points)
selected by
 
Best answer

You can do something like this:

Battle::Scene.register_event(:logic_init) do |scene|

  actor = scene.logic.battler(0, 0)

  enemy = scene.logic.battler(1, 0)

  effect = Battle::Effects::Attract.new(scene.logic, actor, enemy)
  def effect.bchance?(n)

    return true

  end

  actor.effects.add(effect)

end

Be careful though, each side should have only 1 Pokémon otherwise the effect will vanish during switch.

by (570 points)
Thanks, so I should use this as a custom script, then call it in rmxp and it should works ?
by (17.1k points)
Not as a custom script. You need to create a new file in Data/Event/Battle, give it a number (example : 00003 Fight_Mom.rb), then assign 3 as the battle_id for the battle_info of the battle.
by (570 points)
It works ! Thanks a lot !
...