Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
The "IF" with HasItem
jessehmusic Offline
Senior Member

Posts: 423
Threads: 102
Joined: Dec 2011
Reputation: 8
#21
RE: The "IF" with HasItem

(04-10-2012, 01:12 PM)Apjjm Wrote: Can you upload your map with script file?

void OnStart()
{
AddEntityCollideCallback("Player", "ScriptArea_1", "MusicStart", true, 1);
AddEntityCollideCallback("Player", "ScriptArea_2", "MonsterAttack", true, 1);
AddEntityCollideCallback("Player", "door_slam", "DoorSlam", true, 1);
AddEntityCollideCallback("Player", "Light_area", "Lights", true, 1);
AddEntityCollideCallback("Player", "ScriptArea_3", "Lights1", true, 1);
AddEntityCollideCallback("Player", "ScriptArea_4", "Scary1", true, 1);
SetEntityPlayerInteractCallback("ptest_cellar_wood01_1", "Bang1", true);
AddUseItemCallback("", "Key_3", "ptest_cellar_wood01_4", "KeyOnDoor2", true);
AddUseItemCallback("", "key_4", "ptest_cellar_wood01_3", "keyondoor4", true);
AddUseItemCallback("", "key_laboratory_1", "freedom_door", "keyondoor3", true);
AddUseItemCallback("", "The_gone_key", "Lockeddoor_1", "KeyOnDoor1", true);

}
void Scary1(string &in asParent, string &in asChild, int alState)
{
if(HasItem("The_gone_key"))
{
SetEntityActive("agrippa_headless_1", true);
PlaySoundAtEntity("", "alois_amb_idle.snt", "Player", 0, false);
}
}


void Lights1(string &in asParent, string &in asChild, int alState)
{
SetLampLit("bridge_torch_2", true, true);
SetLampLit("bridge_torch_3", true, true);
PlaySoundAtEntity("", "Scary_sound.snt", "Player", 0, false);
}
void Lights(string &in asParent, string &in asChild, int alState)
{
SetLampLit("torch_static01_3", true, true);
SetLampLit("torch_static01_4", true, true);
}
void DoorSlam(string &in asParent, string &in asChild, int alState)
{
SetSwingDoorClosed("door2", true, true);
PlaySoundAtEntity("", "05_event_door_bang.snt", "Player", 0, false);
PlaySoundAtEntity("", "react_breath_slow.snt", "Player", 0, false);
PlaySoundAtEntity("", "react_scare", "Player", 0, false);
PlaySoundAtEntity("", "close_door.snt", "Player", 0, false);
GiveSanityDamage(15.0f, true);
}

void keyondoor3(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("freedom_door", false, true);
PlaySoundAtEntity("", "unlock_door", "freedom_door", 0, false);
RemoveItem("key_laboratory_1");
}


void MonsterAttack(string &in asParent, string &in asChild, int alState)
{
StartPlayerLookAt("grunt", 5.0f, 2.0f, "");
SetEntityActive("grunt", true);
ShowEnemyPlayerPosition("grunt");
AddTimer("", 4.0f, "stoplookenemy1");
GivePlayerDamage(99.0f, "", true, false);
SetPlayerActive(false);
}


void stoplookatenemy1(string &in asTimer)
{
StopPlayerLookAt();
SetPlayerActive(true);

}

void keyondoor4(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("ptest_cellar_wood01_3", false, true);
PlaySoundAtEntity("", "unlock_door", "ptest_cellar_wood01_3", 0, false);
RemoveItem("key_4");
}

void KeyOnDoor1(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("Lockeddoor_1", false, true);
PlaySoundAtEntity("", "unlock_door", "Lockeddoor_1", 0, false);
RemoveItem("The_gone_key");
}

void KeyOnDoor2(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("ptest_cellar_wood01_4", false, true);
PlaySoundAtEntity("", "unlock_door", "ptest_cellar_wood01_4", 0, false);
RemoveItem("Key_3");
}

void Bang1(string &in asEntity)
{

}

void MusicStart(string &in asParent, string &in asChild, int alState)

{
PlayMusic("Ominous Noises - The Tortured Soul Scary Sound Effects.ogg", true, 0.8f, 1, 0, true);
}

http://www.moddb.com/mods/jessehmusic - Hospital of horror , WIP
04-10-2012, 03:40 PM
Website Find




Users browsing this thread: 1 Guest(s)