Script Call Equivalent of Events

Alright, this might be a good place to ask:

What would be a script equivalent of Move Route -> Change Graphic for an event?

I have an event on the map, I want it's sprite to change.
$game_map.events[id].set_graphic("character_name", character_index)id is the id of the event you want to change."character_name" is the name of the graphic file you want to change to (make sure to keep the quotation marks).

character_index is the index on the character sheet (it starts counting at 0).
Perfect, exactly what I needed. Thank you!
Can anyone tell me how I can use a script call to limit the number of steps an actor can take.

eg. Actor can only take 200 steps, at the end of which the actor has to 'sleep' and the steps reset after every sleep.

Needs to work for multiple actors at a time.

There isn't an option I can find in the system for it.
I don't see why this needs to be scripted?


After each rest and at the start of the game:


Variable[sleepCount] = Game Data -> Steps + 200


Then have a parallel process that sets a temporary variable to the current number of steps, compares it with the previous variable, and runs your event when they are equal.


If for some reason you need the step count and you don't want to use set variable, the command is $game_party.steps btw.
I didn't even realise you could do that with variables.  I couldn't find step count anywhere and it was really annoying. But thank you so much!

Um, this might sound really stupid, but how can you set the steps to be a specific number? I can't seem to get it working!

Never mind. Figured it out!
hey guys 🙂

can i please get the script equivalent of remove picture? >.<
screen = $game_party.in_battle ? $game_troop.screen : $game_map.screenscreen.pictures[number].eraseThe first line is not required if you're using this in an event on the map.Replace number in the second line with the number of the picture you would like to erase.
thanks for your help 🙂

ooh, i've been reading a tut on ruby today and i sorta understood some of that yay!

thanks again >.<
I would like a way to put player #1s experience that they get from a battle sequence into a variable and then use that variable to give other players in the party

the equivalent experience.  I am looking for a script call that will do both of these actions. 
I would like a way to put player #1s experience that they get from a battle sequence into a variable and then use that variable to give other players in the party


the equivalent experience.  I am looking for a script call that will do both of these actions.
By default all actors in Battle get the same experience, and the experience for reserve members can be switched on/off in the database.
Do you want to give the other actors a lower experience? then you might be better off using the experience rate (EXR) Parameter.
By default all actors in Battle get the same experience, and the experience for reserve members can be switched on/off in the database.

Do you want to give the other actors a lower experience? then you might be better off using the experience rate (EXR) Parameter.
Thanks for the reply Andar.   What I have here is one character the heavy duty guy, is doing a bit of MMA style fighting.  He is the only one involved.  I want the other characters in the group, though not involved in the fighting, to get the same level of experience as the fighter.  In similar situations where the other members of the team will be doing their "thing" whatever that may be, when the fighter is not present.  I want him to get the same level of experience.  I hope this makes sense.  I think for this I need direct access to the experience parameter for each player.
What I have here is one character the heavy duty guy, is doing a bit of MMA style fighting.  He is the only one involved.  I want the other characters in the group, though not involved in the fighting, to get the same level of experience as the fighter.
If you're using the default battle system, you'll have to go in a slightly different way at it - and then the problem is solved by the game automatically...
In default, the battlegroup is sized as four actors, and everyone beyond the first four actors is considered "reserve" and not involved in fighting.


If you want to limit the fights to one actor only, you either have to use a different battle script, remove all other actors from the party (which will cause other problems) or use scripting to change the number of maximum battlers to one.


(it is possible to script the number of battlers to a variable, allowing you to change that number during game).


However, if you reduce the number of battlers to 1 and allow EXP for reserve members in the database, you automatically have what you want by default: only the first actor fights, but all get EXP.


And if you want to give EXP for non-battles, that is eventing anyway and you just use the event command for EXP Gain for the entire party.
Andar.  How simple a solve it was.  I thank you again very much.

Admen you may close this topic as it most definitely has been solved.
No we can't, 'cause it's not actually your topic 😉
No we can't, 'cause it's not actually your topic 😉
Sorry, way too tired when I should have been paying better attention.
What would be the equivalent of the "Change Level..." command?
Code:
$game_actors[id].change_level(new_level, show_flag)
If you want to change the level relative to the actor's current level:
Code:
$game_actors[id].change_level($game_actors[id].level + change, show_flag)
You'll need to replace id, new_level, and change with appropriate values. show_flag needs to be replaced with either true or false, which is basically just if you want the level up message to show or not.
Is there a script call for the "Wait x frames" feature?
@wait_count = rand(95) + 1

@wait_count = 60

I used these in move routes
I am working on trying to change the the self switch of one event with another event.  AKA I want to change / enable self switch A on event 1 from event 2.  I think the answer to my problem lies in this code. Im just not smart enough yet to decode it in to a usable script.

key = [@map_id, @event_id, @params[1]]  result = ($game_self_switches[key] == (@params[2] == 0)) Its it takes in the event id so it seems I should be able to call it and alter any self switch of any event from any event.
@irandom = rand(10)

if @irandom == 1 then $game_self_switches[[@map_id, self.id, "A"]] = true end

This includes a little extra.  These scripts are in the routing command.  Each time it runs over the command it has

a random chance to trigger the switch.

This setup is self sufficient: The event identifies

What map it belongs to @map_id

Which event it is self.id

*Note this is a little different than the oringal question

Original thread: https://forums.rpgmakerweb.com/threads/script-call-equivalent-of-events.6248/