Hello!
Situation:
- the player (cEgo) is in room 53
- The NPC is in room 52
- When the time runs out and if the player is not in room 52, another character, cNPC, will take over in room 52
Here's the code in Global script:
Code: ags
The error I get is: "Character is not in current room".
I managed to change rooms with SetAsPlayer before, but in this case it's the Timer that triggers the switch and there's a cutscene following automatically.
Any ideas?
Thx!
EDIT : When I remove everything cutscene after cNPC.SetAsPlayer(); the switch works
Situation:
- the player (cEgo) is in room 53
- The NPC is in room 52
- When the time runs out and if the player is not in room 52, another character, cNPC, will take over in room 52
Here's the code in Global script:
if (IsTimerExpired (19))
{
if (cEgo.Room != 52)
{
cNPC.SetAsPlayer();
cNPC.Walk (1239, 458, eBlock, eWalkableAreas); // <<<< [b]ERROR HERE[/b]
cNPC.FaceDirection (eDirectionRight);
cNPC.Say ("Oh well...");
aElevatorOpen.Play();
// STUFF happening
}
}
The error I get is: "Character is not in current room".
I managed to change rooms with SetAsPlayer before, but in this case it's the Timer that triggers the switch and there's a cutscene following automatically.
Any ideas?
Thx!
EDIT : When I remove everything cutscene after cNPC.SetAsPlayer(); the switch works