- 5
- Posts
- 4
- Years
- Seen Aug 5, 2023
Nvm, I see what the problem is. You're trying to apply Trick Room with the:effect
key, but Trick Room isn't a battler effect, it's a field effect. So you have to use the:field
key to implement this.
As the tutorial states:
:effect
is only used for effects that apply to a specific battler.
:team
is only used for effects that apply to a specific side of the field (hazards, screens, etc).
:field
is only used for effects that apply to the entire battlefield (Rooms, Gravity, etc).
Ah yes sorry you're right, although by replacing effect: with field: I am now getting an almost identical error?
Exception: NoMethodError
Message: undefined method `first' for 0:Integer
Backtrace:
[Essentials Deluxe] Midbattle_Main.rb:521:in `block in midbattle_FieldEffects'
[Essentials Deluxe] Midbattle_Main.rb:519:in `each'
[Essentials Deluxe] Midbattle_Main.rb:519:in `midbattle_FieldEffects'
[Essentials Deluxe] Midbattle_Main.rb:126:in `block (2 levels) in dx_midbattle'
[Essentials Deluxe] Midbattle_Main.rb:64:in `each'
[Essentials Deluxe] Midbattle_Main.rb:64:in `block in dx_midbattle'
[Essentials Deluxe] Midbattle_Main.rb:37:in `each'
[Essentials Deluxe] Midbattle_Main.rb:37:in `dx_midbattle'
[Essentials Deluxe] Battle.rb:118:in `pbCommandPhase'
148:Battle_StartAndEnd:334:in `block (2 levels) in pbBattleLoop'