RE: Custom Story Script Problems
Actually this one:
PlaySoundAtEntity("", "unlock_door", "KeyOnDoor", 0, false);
You cannot call a function in this place. That is where you specify where the sound should be played.
In this case i guess it would be "castle_1"
PlaySoundAtEntity("", "unlock_door", "castle_1", 0, false);
But this would not solve the problem...
What if the script isn't done, if it is below OnLeave?
Then it should be:
////////////////////////////
// Run when starting map
void OnStart()
{
AddUseItemCallback("", "key_1", "castle_1", "KeyOnDoor", true);
SetEntityPlayerInteractCallback("key_1", "ActivateMonster", true);
}
void ActivateMonster(string &in asItem)
{
SetEntityActive("servant_grunt_1", true);
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_2", 0, "Idle");
}
void KeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("castle_1", false, true);
PlaySoundAtEntity("", "unlock_door", "KeyOnDoor", 0, false);
RemoveItem("key_1");
}
////////////////////////////
// Run when entering map
void OnEnter()
{
}
////////////////////////////
// Run when leaving map
void OnLeave()
{
}
Trying is the first step to success.
|