Call Script for 'Erase Event' ?

Started by MarkHest, April 24, 2012, 10:00:19 am

Previous topic - Next topic

MarkHest

April 24, 2012, 10:00:19 am Last Edit: April 24, 2012, 10:01:26 am by MarkHest
This is just going to a small request, is it possible to use the "Erase Event" command with a call script instead of the event?
The reason for this is because i want to use this at the end of a customized move route on an event.

They are going to patroll and once they reach their destination they just disapear. I used to turn off the graphic for the event after they reached their destination but you could still press the character because the event is still there.
Then i started using switches to turn them off/on at random occasions that makes them patroll some part of a town.

This is tricky and a bit timeconsuming so i wanna ask if i can actually use Erase Event in a script call at the end of the move route command to make the event disapear from the map untill you zone out and in to make it respawn.
   

LiTTleDRAgo


ForeverZer0

Since the call will be interpreted within the Interpreter class, as long as the call is made within the event it affects, you can use this call:

$game_map.events[@event_id].erase


...without having to know the EVENT_ID ahead of time or hard-coding it in there.
I am done scripting for RMXP. I will likely not offer support for even my own scripts anymore, but feel free to ask on the forum, there are plenty of other talented scripters that can help you.

Calintz

or you could use the set event location command and move his position on the map.

MarkHest

@Calintz, it's not possible since i am doing all of this within the 'custom Movement' section of an event. So i decide a path that the event will walk and you will still be able to talk with him/her etc.
That is why i need a call script to erase an event as i already have a command that lets you talk to them.

I'll check out those call scripts you have for me and hopefully won't encounter any problems ^^

Thanks :)
   

LiTTleDRAgo

Quote from: MarkHest on April 24, 2012, 08:45:55 pm
@Calintz, it's not possible since i am doing all of this within the 'custom Movement' section of an event. So i decide a path that the event will walk and you will still be able to talk with him/her etc.
That is why i need a call script to erase an event as i already have a command that lets you talk to them.


that's also possible to do it in move route command
$game_map.events[EVENT_ID].moveto(x,y)

or just for the selected event
moveto(x,y)



also you don't have to call $game_map.events[EVENT_ID].erase in move route to erase the selected event

just
erase

it will do the same

MarkHest

Oh wow, hehe. 'erase' did just perfectly!
I can't believe it was THAT easy! :^_^':

Thanks once again!
   

Calintz