Script Call Support Boards

@Heirukichi Thank you.
Okay, so I am trying to have an event (with an extra, but that does not matter) move after an route of regions.
Means my event, a mine cart, moves simply forward on straight tiles that lead up/down or left/right, and when it encounters a corner, then turns left/right/up/down depending on the corner it is standing on and then just simply moves forward again.
Problem is that for this I have to figure out on which region the event is standing right now, as the player is standing in a dummy location while the cart moves.

I do know the call to get the players region ID (so $game_player.region_id<=40 or whatever ID you want), but can not find out or figure how to get the region ID of my event.


Edit: I got it! For future references and so that maybe others who seek such things may find it, too:

$game_map.events[39].region_id == 4
I have the following script call if I want all the followers to turn in a particular direction:
$game_player.followers.each {|follower|follower.set_direction(2)}

However, in this instance I want followers 1-3 to face up and follower 4 (there are 5 in the party) to turn right.

Can anyone give me the correct script calls for that please?
Thank you.
$game_player.followers[3].set_direction(6)
first follower is 0
@Roninator2 Thank you.
Hello.

I would to know if there is a way to "false" ALL the self switches AT ONCE of the CURRENT map only. Because is a farming dongeon and I want to reinitialyse all the events for a new run.

Because of this... one to one is just a pain, and I have 3 maps with more and more events...
$game_self_switches[[32, 1, "A"]] = false
$game_self_switches[[32, 1, "B"]] = false
$game_self_switches[[32, 1, "C"]] = false
$game_self_switches[[32, 1, "D"]] = false
$game_self_switches[[32, 2, "A"]] = false
$game_self_switches[[32, 2, "B"]] = false
... and is going for over 50 events per maps.

Thank you.
Don't set them to false, delete them instead.
Hello Kyonides.

You saying this is doing the job :
Character Erase Event
Description
Temporarily clears an executing event. There are no settings to be made for this command. The cleared state will continue until the party moves to another map.

Notes
• This command cannot be used in battle events.
I meant delete the $game_self_switches you no longer need. How exactly did you connect that suggestion with erasing an event!?
Code:
$game_map.events.keys.each do |event_id|
  $game_self_switches[[$game_map.map_id, event_id, 'A']] = false
  $game_self_switches[[$game_map.map_id, event_id, 'B']] = false
  $game_self_switches[[$game_map.map_id, event_id, 'C']] = false
  $game_self_switches[[$game_map.map_id, event_id, 'D']] = false
end
Edit:
Well, TheoAllen's code might be helpful only if you do wanna set ALL of them to false for the current map.

What if you need it for another map? Well, here's what you can use there.

Code:
target_map_id = 2 or 3 or whatever you need here
map = load_data(sprintf("Data/Map%03d.rvdata2', target_map_id))
map.events.keys.each do |event_id|
  $game_self_switches[[target_map_id, event_id, 'A']] = false
  $game_self_switches[[target_map_id, event_id, 'B']] = false
  $game_self_switches[[target_map_id, event_id, 'C']] = false
  $game_self_switches[[target_map_id, event_id, 'D']] = false
end
I would expect the script call will be used in the CURRENT map. Why would it affect other maps?
Yeah, got it wrong. I will edit my previous post in case people need it for ANOTHER map instead so it makes sense as I first intended.
=_= I hate midnight.
Thank you TheoAllen !
It looks to work perfectely and only on the current map.

Happy to see you're still around here, since is my first return from over 2 years.

@kyonides
Thank you too to have tryed to help me
Well, just in case you missed the edits, I left a version of that code that will handle other maps instead.
Is there a script call that can inflict a buff on a particular enemy in battle, or will it have to be done via a state?
Thanks.
Code:
$game_troop.members[index].add_buff(param_id, turn)
Code:
class Game_Troop
  def add_buff(index, param_id, turn)
    members[index].add_buff(param_id, turn)
  end
end

Just in case you want to paste that piece of code in your editor and just call:

Code:
$game_troop.add_buff(index, param_id, turn)
@TheoAllen That was what I originally tried. I copy/pasted your version in case I had made a typo (here it is with the various IDs in case I've done the same thing again)

Code:
$game_troop.members[1].add_buff(2, 2)

and in both instances I got this error message
1598335751160.png


@kyonides I then tried your method and got the same error message. Once more, in case there is a typo, here is my script call.

Code:
$game_troop.add_buff(1, 2, 2)
@Kes index started at 0.

Original thread: https://forums.rpgmakerweb.com/threads/script-call-support-boards.25767/