Skirata

Villager
Member
Joined
Nov 8, 2017
Messages
5
Reaction score
0
First Language
German
Primarily Uses
RMMV
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
 
Last edited:

Kes

Veteran
Veteran
Joined
Aug 3, 2012
Messages
22,305
Reaction score
11,731
First Language
English
Primarily Uses
RMVXA
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.
 

Roninator2

Gamer
Veteran
Joined
May 22, 2016
Messages
2,984
Reaction score
665
First Language
English
Primarily Uses
RMVXA
$game_player.followers[3].set_direction(6)
first follower is 0
 
  • Like
Reactions: Kes

Fridjah

Veteran
Veteran
Joined
Jan 13, 2015
Messages
155
Reaction score
7
First Language
French
Primarily Uses
RMVXA
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.
 
Last edited:

kyonides

Reforged is laughable
Veteran
Joined
Nov 17, 2019
Messages
294
Reaction score
73
First Language
English
Primarily Uses
RMXP
Don't set them to false, delete them instead.
 

Fridjah

Veteran
Veteran
Joined
Jan 13, 2015
Messages
155
Reaction score
7
First Language
French
Primarily Uses
RMVXA
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.
 

kyonides

Reforged is laughable
Veteran
Joined
Nov 17, 2019
Messages
294
Reaction score
73
First Language
English
Primarily Uses
RMXP
I meant delete the $game_self_switches you no longer need. How exactly did you connect that suggestion with erasing an event!?
 

TheoAllen

Self-proclaimed jack of all trades
Veteran
Joined
Mar 16, 2012
Messages
6,135
Reaction score
7,325
First Language
Indonesian
Primarily Uses
RMVXA
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
 

kyonides

Reforged is laughable
Veteran
Joined
Nov 17, 2019
Messages
294
Reaction score
73
First Language
English
Primarily Uses
RMXP
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
 
Last edited:

TheoAllen

Self-proclaimed jack of all trades
Veteran
Joined
Mar 16, 2012
Messages
6,135
Reaction score
7,325
First Language
Indonesian
Primarily Uses
RMVXA
I would expect the script call will be used in the CURRENT map. Why would it affect other maps?
 

kyonides

Reforged is laughable
Veteran
Joined
Nov 17, 2019
Messages
294
Reaction score
73
First Language
English
Primarily Uses
RMXP
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.
 

Fridjah

Veteran
Veteran
Joined
Jan 13, 2015
Messages
155
Reaction score
7
First Language
French
Primarily Uses
RMVXA
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
 

kyonides

Reforged is laughable
Veteran
Joined
Nov 17, 2019
Messages
294
Reaction score
73
First Language
English
Primarily Uses
RMXP
Well, just in case you missed the edits, I left a version of that code that will handle other maps instead.
 

Kes

Veteran
Veteran
Joined
Aug 3, 2012
Messages
22,305
Reaction score
11,731
First Language
English
Primarily Uses
RMVXA
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.
 

TheoAllen

Self-proclaimed jack of all trades
Veteran
Joined
Mar 16, 2012
Messages
6,135
Reaction score
7,325
First Language
Indonesian
Primarily Uses
RMVXA
Code:
$game_troop.members[index].add_buff(param_id, turn)
 
  • Like
Reactions: Kes

kyonides

Reforged is laughable
Veteran
Joined
Nov 17, 2019
Messages
294
Reaction score
73
First Language
English
Primarily Uses
RMXP
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)
 
  • Like
Reactions: Kes

Kes

Veteran
Veteran
Joined
Aug 3, 2012
Messages
22,305
Reaction score
11,731
First Language
English
Primarily Uses
RMVXA
@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)
 

TheoAllen

Self-proclaimed jack of all trades
Veteran
Joined
Mar 16, 2012
Messages
6,135
Reaction score
7,325
First Language
Indonesian
Primarily Uses
RMVXA
@Kes index started at 0.
 
  • Like
Reactions: Kes

Latest Threads

Latest Posts

Latest Profile Posts

[CM]
5VaUMjAFpz1I6fSsgDrfJc.jpg

Title is star.
Dam, does the night get to me, I sound and look like a monster. Its 3:54 am right now...I need sleep...or...coffee.
It has nothing to do with my project, but I'm in love with voxels
If you feel like your story isn't that great, just look at final fantasy.
Nightmare Traveler: A game where we play as... the bad guy?

Forum statistics

Threads
110,483
Messages
1,053,608
Members
143,572
Latest member
Sparyx
Top