Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

[XP] Custom Movement: "Repeat Action" OFF when 2 conditions

Hi!

I've made a really bad mistake. :] I've put all certain events' custom movement on "Repeat Action", throughout the entire game. More than 200 events, and I don't even know where they all are specifically.

So, I hope, is it possible to turn Repeat Action off or ignore it's settings when the following two conditions are met:

1 - event name is 'enemy'
2 - self switch B is on

That would be so great~

(I'm open to other suggestions, too. ;))

Thanks! ^_^

PS: It'd be great if I could put the frequency and speed of the event on 6, too, if those above two conditions are met.
 
ilu

[rgss]class Game_Event
  alias_method :seph_repeatoff_gmevt_refresh, :refresh
  def refresh
    seph_repeatoff_gmevt_refresh
    return if @erased || @list == nil
    if @event.name.downcase.include?('enemy') ||
       $game_self_switches[[$game_map.map_id, @id, 'B']]
      @move_route.repeat = false
    end
  end
end
[/rgss]

That should do the trick. :thumb:
 
Thanks. :D

Can I put move_speed and frequency at 6, too?
But I want those settings to change when I turn the self switch B off, of course. :)
E.g. on page 0 the move_speed = 3, then it goes to switch B and move_speed is set to 6 by script and then when I turn self switch B off the move_speed goes to 3 for page 0. Though I believe this is standard I'm just making sure.
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top