Chaos Project

RPG Maker => RPG Maker Scripts => Script Requests => Topic started by: MarkHest on April 24, 2012, 10:00:19 am

Title: Call Script for 'Erase Event' ?
Post by: MarkHest on April 24, 2012, 10:00:19 am
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.
Title: Re: Call Script for 'Erase Event' ?
Post by: LiTTleDRAgo on April 24, 2012, 10:54:57 am
$game_map.events[EVENT_ID].erase
Title: Re: Call Script for 'Erase Event' ?
Post by: ForeverZer0 on April 24, 2012, 11:33:25 am
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.
Title: Re: Call Script for 'Erase Event' ?
Post by: Calintz on April 24, 2012, 11:50:53 am
or you could use the set event location command and move his position on the map.
Title: Re: Call Script for 'Erase Event' ?
Post by: 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.

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

Thanks :)
Title: Re: Call Script for 'Erase Event' ?
Post by: LiTTleDRAgo on April 24, 2012, 11:32:21 pm
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
Title: Re: Call Script for 'Erase Event' ?
Post by: MarkHest on April 25, 2012, 11:03:27 am
Oh wow, hehe. 'erase' did just perfectly!
I can't believe it was THAT easy! :^_^':

Thanks once again!
Title: Re: Call Script for 'Erase Event' ?
Post by: Calintz on April 25, 2012, 05:56:49 pm
nice tip LittleDrago.