Frictional Games Forum (read-only)

Full Version: Game Logic Question and Script Help
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
After a monster has gone through all of it's pathnodes, will it disappear automatically?

And you'll be glad to know I'm this close |--| to completing the forth level (: Just gotta add little decor. tweaks like decals, furnature and storage decorations for that extra spice (;

Also, what's wrong with this script?

Spoiler below!

Code:
void OnStart()
{
SetEntityPlayerInteractCallback("ScareDoor_1", "ScareDoorScript", true);
AddUseItemCallback("ToTheNextLevelDoor_1", "ToTheNextLevelDoorKey_1", "UsedKeyOnDoor", true);
SetEntityPlayerInteractCallback("BooDoor_1", "BooSpawn", true);
}

void OnEnter()
{
}

void OnLeave()
{
}

void ScareDoorScript(string &in asEntity)
{
AddPropImpulse("ScareDoor_1", 0, 0, 5, "World");
    PlaySoundAtEntity("", "21_bang_door.snt", "ScareDoor_1", 0, false);
    PlaySoundAtEntity("", "21_intro_scream.snt", ScareDoor_1", 0, false);
SetSwingDoorLocked("SacreDoor_1", false, true);
}

void BooSpawn(string &in asEntity)
{
SetEntityActive("MrBoo_1", true);
    AddEnemyPatrolNode("MrBoo_1", "Node_1", 1, "");
    AddEnemyPatrolNode("MrBoo_1", "Node_2", 1, "");
    AddEnemyPatrolNode("MrBoo_1", "Node_3", 1, "");
    AddEnemyPatrolNode("MrBoo_1", "Node_4", 2, "");
    AddEnemyPatrolNode("MrBoo_1", "Node_5", 2, "");
}

void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("ToTheNextLevelDoor_1", false, true);
PlaySoundAtEntity("", "unlock_door.snt", 0, false);
}

Is there an error report for your script? Is there any specific part of your script that doesn't work?

The monster will disappear once it's out of the player's sight when it goes through all it's path nodes and waited the necessary time.
(08-01-2011, 08:52 PM)Kyle Wrote: [ -> ]Is there an error report for your script? Is there any specific part of your script that doesn't work?

The monster will disappear once it's out of the player's sight when it goes through all it's path nodes and waited the necessary time.


38, 2: Unexpected End Of File

EDIT: Basically the ending line of the .hps
Code:
void ScareDoorScript(string &in asEntity)
{
AddPropImpulse("ScareDoor_1", 0, 0, 5, "World");
    PlaySoundAtEntity("", "21_bang_door.snt", "ScareDoor_1", 0, false);
    PlaySoundAtEntity("", "21_intro_scream.snt", ScareDoor_1", 0, false);
SetSwingDoorLocked("SacreDoor_1", false, true);
}
You missed a quotation mark on the second PlaySoundAtEntity.
When I set an enemy for patrol, it doesn't disappear. I've never had them do that at the end of their nodes. When let's say my Grunt walks through a node path, comes to the end and stops. Mine repeats the same pathnode patrol by going to the first node again.