I haven't made a thread in here for so long, but I can't seem to find this. I'm trying to find a way to make it so that if two events are the same colour and touching each other, it triggers another event. But, I really don't know how to make a conditional branch for the colour of an event. I don't even know if there's a script call out there for that (believe me, I've looked), so what I figured was I could instead use the event's name, because I actually found a couple of sites for that. But, when I tried to insert the script call into the conditional branch, it said "undefined method 'character_name = '".
Here was the script call I used: $ game_map.events[ID].character_name
So, yeah, I'm currently looking for a new script call that either checks colour or name.
Thanks in advance.
Events don't have colours. You will need to give more of an explanation about how they're set up. Events also don't trigger when touching other events.
Did you use = or ==? = is assignment, == is comparison. But that will not check their 'colour' - it just says whether they're using the same character sprite or not. And if your character sprites are the 8-in-1 type, the name could be the same even though they are different sprites.
That is also not the event name, but the spritesheet/charactersheet name, which is different.
What does "touching each other" mean? Are they just side by side? Or does one of them need to try and move onto the tile that the other one occupies? The latter is what causes an Event Touch or Player Touch trigger.
You can give your event a name, and do $game_map.events[id].event.name == $game_map.events[id].event.name to see if two events have the same name. This could be 'green' and 'blue' and have nothing to do with the character sprite.
As for triggering when they're just beside each other - I don't know - it depends on what the script can do.
I have to test the script a bit more, but thank you. I will test this when I get the chance. Which'll probably be tomorrow.
EDIT: Doesn't work. It says "undefined method 'event'" now.