RE: How to breath heavily
void OnStart()
void OnStart()
{
AddEntityCollideCallback("Player", "ScriptArea_3", "PlayerInBreathArea", false, 0);
}
void PlayerInBreathArea(string &in asParent, string &in asChild, int alState)
{
if (alState == 1)
{
PlaySoundAtEntity("", "react_breath_slow.snt", "Player", 0.0f, false);
AddTimer("BreathTimer", 2.0f, "BreathTimer");
}
else
{
RemoveTimer("BreathTimer");
}
}
{
ShowEnemyPlayerPosition("Grunty1");
AddUseItemCallback("", "Key_1", "castle_1", "KeyOnDoor", true);
AddEntityCollideCallback("Player", "ScriptArea_1", "CloseDoorFunc", true, 1);
AddEntityCollideCallback("Player", "ScriptArea_2", "CloseDoorFunc2", true, 1);
}
void CloseDoorFunc(string &in asParent, string &in asChild, int alState)
{
SetSwingDoorClosed("castle_1", true, true);
SetSwingDoorLocked("castle_1", true, false);
PlaySoundAtEntity("", "react_breath_slow.snt", "Player", 0, false);
PlaySoundAtEntity("", "react_scare", "Player", 0, false);
PlaySoundAtEntity("", "close_door.snt", "Player", 0, false);
GiveSanityDamage(40.0f, true);
}
void CloseDoorFunc2(string &in asParent, string &in asChild, int alState)
{
SetSwingDoorClosed("castle_2", true, true);
SetSwingDoorLocked("Magical Apples", true, false);
PlaySoundAtEntity("", "react_breath_slow.snt", "Player", 0, false);
PlaySoundAtEntity("", "react_scare", "Player", 0, false);
PlaySoundAtEntity("", "close_door.snt", "Player", 0, false);
GiveSanityDamage(40.0f, true);
}
void KeyOnDoor(string &in item, string &in door)
{
SetSwingDoorLocked("castle_1", false, true);
PlaySoundAtEntity("", "unlock_door", "castle_1", 0, false);
RemoveItem("Key_1");
}
void OnEnter()
{
}
void OnLeave()
{
}
Error says:
FATAL ERROR: Could not load script file 'custom_stories/Morfar's House/maps/01.hps
main (3,1) : ERR : Expected',' or ';'
main (21,1) : ERR: Unexoected token '{'
Special Custom Story for 2 special people!
|