Hi!
What I'm trying to achieve is a scene where a character who is not the player walks from point A to B, and if they reach point B, the player loses the game,
so that the player has to be able to interact with the character before they reach that point.
But all scripts and functions I find are about the player character, so I wonder if it's possible
to have a script trigger when a specific non player character cross a region or walkable area?
#define TRIGGER_REGION 3 // whatever number that region has
function repeatedly_execute()
{
if(Region.GetAtRoomXY(walkingCharacter.X, walkingCharacter.Y) == region[TRIGGER_REGION] && Game.DoOnceOnly("Reached point B"))
{
// do stuff
}
}
I tried the script, but I get the error message:
room2.asc(27): Error (line 27): undefined symbol 'walkingCharacter'
What shall I do?
Where he put walkingcharacter you need to supply the character object such as cEgo
If your NPC character is named Charlie then use cCharlie.
Everything seems to be working, thank you both!