Frictional Games Forum (read-only)
Game Logic Question and Script Help - Printable Version

+- Frictional Games Forum (read-only) (https://www.frictionalgames.com/forum)
+-- Forum: Amnesia: The Dark Descent (https://www.frictionalgames.com/forum/forum-6.html)
+--- Forum: Custom Stories, TCs & Mods - Development (https://www.frictionalgames.com/forum/forum-38.html)
+---- Forum: Development Support (https://www.frictionalgames.com/forum/forum-39.html)
+---- Thread: Game Logic Question and Script Help (/thread-9541.html)



Game Logic Question and Script Help - ObsidianLegion - 08-01-2011

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);
}




RE: Game Logic Question and Script Help - Kyle - 08-01-2011

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.


RE: Game Logic Question and Script Help - ObsidianLegion - 08-01-2011

(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


RE: Game Logic Question and Script Help - Your Computer - 08-01-2011

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.


RE: Game Logic Question and Script Help - Angerpull - 08-02-2011

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.