Chaos Project

RPG Maker => Tutorials => Topic started by: monkeydash on January 12, 2012, 02:33:02 pm

Title: Changing an event name
Post by: monkeydash on January 12, 2012, 02:33:02 pm
I'm trying to do something quite simple. (At least I thought it would be)

I have a Border Guard who won't let you through a gate unless you have a pass.
I want it so that if you try and make a run for the gate without a pass he becomes an enemy and attacks you.

I have tried creating an event triggered by actor touch that changes a switch. The switch should then make the Border Guard become an enemy. I was trying to do this by having the Border Guards name change from 'Border Guard' to 'Border Guard \e[6] \g[18]'.

I don't think I have the correct script code to change the name though as it doesn't seem to be working. I put in this:

$game_map.rename_event (008, 'Town Border Guard \e[6]\g[18]')
Title: Re: Changing an event name
Post by: KK20 on January 12, 2012, 02:38:42 pm
Quote from: User ManualKeep in mind that you have to use \\ (double backslash) if you want \ (backslash) to appear in the event's name. i.e. suddenly turning an event into an enemy would need a new name looking like '\\e[45]'. Keep in mind that those renamings are temporary and reset after you re-enter the map.
Title: Re: Changing an event name
Post by: monkeydash on January 12, 2012, 02:46:37 pm
Thanks for the fast response.

Unfortunately I am still getting a Syntax error even with the double slashes...
Title: Re: Changing an event name
Post by: KK20 on January 12, 2012, 03:08:28 pm
EDIT: Hold up. What I just said was stupid.

EDIT 2: Okay, so I can guess what your problem is. Your string is broken up. Try this instead:
$game_map.rename_event(8, 
'Town Border Guard \\e[6] \\g[18]')
Title: Re: Changing an event name
Post by: monkeydash on January 13, 2012, 10:20:02 am
Thanks.

For some reason the problem seemed to be that I put 008 rather than just 8.
Not sure why that makes a difference, but that has solved it.