Changing an event name

Started by monkeydash, January 12, 2012, 02:33:02 pm

Previous topic - Next topic

monkeydash

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]')

KK20

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.

Other Projects
RPG Maker XP Ace  Upgrade RMXP to RMVXA performance!
XPA Tilemap  Tilemap rewrite with many features, including custom resolution!

Nintendo Switch Friend Code: 8310-1917-5318
Discord: KK20 Tyler#8901

Join the CP Discord Server!

monkeydash

Thanks for the fast response.

Unfortunately I am still getting a Syntax error even with the double slashes...

KK20

January 12, 2012, 03:08:28 pm #3 Last Edit: January 12, 2012, 04:21:16 pm by KK20
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]')

Other Projects
RPG Maker XP Ace  Upgrade RMXP to RMVXA performance!
XPA Tilemap  Tilemap rewrite with many features, including custom resolution!

Nintendo Switch Friend Code: 8310-1917-5318
Discord: KK20 Tyler#8901

Join the CP Discord Server!

monkeydash

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.