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
Freeze player?
Lizard Offline
Member

Posts: 174
Threads: 23
Joined: Jul 2012
Reputation: 5
#21
RE: Freeze player?

Here you go

void OnStart()
{
AddUseItemCallback("", "key_1", "mansion_1", "KeyOnDoor", true);
AddUseItemCallback("", "key_2", "mansion_2", "KeyOnDoor_2", true);
AddUseItemCallback("", "key_3", "mansion_5", "KeyOnDoor_5", true);
SetEntityPlayerInteractCallback("key_3", "ActivateMonster", true);
SetEntityCallbackFunc("key_3", "OnPickup");
AddTimer("StopLook", 2, "LookAtDoor");
AddEntityCollideCallback("Player","Music", "StartMusic", true, 1);
AddEntityCollideCallback("Player", "KillTheLights", "KillTheLights", true, 1);
}

void KeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("mansion_1", false, true);
PlaySoundAtEntity("", "unlock_door", "mansion_1", 0.0f, true);
RemoveItem("key_1");
}

void KeyOnDoor_2(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("mansion_2", false, true);
PlaySoundAtEntity("", "unlock_door", "mansion_2", 0.0f, true);
RemoveItem("key_2");
}

void KeyOnDoor_5(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("mansion_5", false, true);
PlaySoundAtEntity("", "unlock_door", "mansion_5", 0.0f, true);
RemoveItem("key_3");
}

void StartMusic(string &in asParent, string &in asChild, int alState)
{
PlayMusic("03_paper_daniel02.ogg", true, 0.8, 2, 0, true);

}

void OnPickup(string &in asEntity, string &in type)
{
SetSwingDoorClosed("mansion_3", true, true);
AddPropImpulse("mansion_3", 0, 0, 10, "World");
AddTimer("StopLook", 1, "LookAtDoor");
PlaySoundAtEntity("", "unlock_door.snt", "mansion_5", 0.0f, true);
StartPlayerLookAt("mansion_3", 10, 10, "");
}




void KillTheLights(string &in asParent, string &in asChild, int alState)
{
StartPlayerLookAt("wall_door_frame_6", 10, 10, "");
SetPlayerActive(false);
AddTimer("lights_out", 6, "lightkiller");
}

void lightkiller(string &in asTimer)
{
SetLampLit("candle_floor_1", false, true);
AddTimer("", 0.5, "Out2");
}

void Out2(string &in asTimer)
{
SetLampLit("candle_floor_2", false, true);
AddTimer("", 0.5, "Out3");
}

void Out3(string &in asTimer)
{
SetLampLit("candle_floor_3", false, true);
AddTimer("", 0.5, "Out4");
}

void Out4(string &in asTimer)
{
SetLampLit("candle_floor_4", false, true);
AddTimer("", 0.5, "Out5");
}

void Out5(string &in asTimer)
{
SetLampLit("candle_floor_5", false, true);
AddTimer("", 0.5, "Out6");
}

void Out6(string &in asTimer)
{
SetLampLit("candle_floor_6", false, true);
AddTimer("", 0.5, "Out7");
}

void Out7(string &in asTimer)
{
SetLampLit("candle_floor_7", false, true);
AddTimer("", 0.5, "Out8");
}

void Out8(string &in asTimer)
{
SetLampLit("candle_floor_8", false, true);
AddTimer("", 0.5, "Out9");
}

void Out9(string &in asTimer)
{
SetLampLit("candle_floor_9", false, true);
AddTimer("", 0.5, "Out10");
}

void Out10(string &in asTimer)
{
SetLampLit("candle_floor_10", false, true);
AddTimer("", 0.5, "Out11");
}

void Out11(string &in asTimer)
{
SetLampLit("candle_floor_11", false, true);
AddTimer("", 0.5, "Out12");
}

void Out12(string &in asTimer)
{
SetLampLit("candle_floor_12", false, true);
AddTimer("", 0.5, "ActivatePlayer");
}

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

////////////////////////////
// Run when leaving map
void OnLeave()
{
StopMusic(1,0);
}

void ActivateMonster(string &in item)
{
SetEntityActive("servant_grunt_1", true);
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_6", 0, "Idle");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_7", 0, "Idle");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_8", 0, "Idle");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_10", 0, "Idle");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_11", 0, "Idle");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_12", 0, "Idle");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_13", 0, "Idle");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_14", 0, "Idle");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_15", 3, "Idle");

}
void LookAtDoor(string &in asTimer)
{
StopPlayerLookAt();
}

CURRENT PROJECT:
A Fathers Secret == Just started
07-30-2012, 03:48 PM
Find
Hartmann Offline
Member

Posts: 52
Threads: 18
Joined: Jun 2012
Reputation: 0
#22
RE: Freeze player?

(07-30-2012, 03:48 PM)ZereboO Wrote: Here you go

void OnStart()
{
AddUseItemCallback("", "key_1", "mansion_1", "KeyOnDoor", true);
AddUseItemCallback("", "key_2", "mansion_2", "KeyOnDoor_2", true);
AddUseItemCallback("", "key_3", "mansion_5", "KeyOnDoor_5", true);
SetEntityPlayerInteractCallback("key_3", "ActivateMonster", true);
SetEntityCallbackFunc("key_3", "OnPickup");
AddTimer("StopLook", 2, "LookAtDoor");
AddEntityCollideCallback("Player","Music", "StartMusic", true, 1);
AddEntityCollideCallback("Player", "KillTheLights", "KillTheLights", true, 1);
}

void KeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("mansion_1", false, true);
PlaySoundAtEntity("", "unlock_door", "mansion_1", 0.0f, true);
RemoveItem("key_1");
}

void KeyOnDoor_2(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("mansion_2", false, true);
PlaySoundAtEntity("", "unlock_door", "mansion_2", 0.0f, true);
RemoveItem("key_2");
}

void KeyOnDoor_5(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("mansion_5", false, true);
PlaySoundAtEntity("", "unlock_door", "mansion_5", 0.0f, true);
RemoveItem("key_3");
}

void StartMusic(string &in asParent, string &in asChild, int alState)
{
PlayMusic("03_paper_daniel02.ogg", true, 0.8, 2, 0, true);

}

void OnPickup(string &in asEntity, string &in type)
{
SetSwingDoorClosed("mansion_3", true, true);
AddPropImpulse("mansion_3", 0, 0, 10, "World");
AddTimer("StopLook", 1, "LookAtDoor");
PlaySoundAtEntity("", "unlock_door.snt", "mansion_5", 0.0f, true);
StartPlayerLookAt("mansion_3", 10, 10, "");
}




void KillTheLights(string &in asParent, string &in asChild, int alState)
{
StartPlayerLookAt("wall_door_frame_6", 10, 10, "");
SetPlayerActive(false);
AddTimer("lights_out", 6, "lightkiller");
}

void lightkiller(string &in asTimer)
{
SetLampLit("candle_floor_1", false, true);
AddTimer("", 0.5, "Out2");
}

void Out2(string &in asTimer)
{
SetLampLit("candle_floor_2", false, true);
AddTimer("", 0.5, "Out3");
}

void Out3(string &in asTimer)
{
SetLampLit("candle_floor_3", false, true);
AddTimer("", 0.5, "Out4");
}

void Out4(string &in asTimer)
{
SetLampLit("candle_floor_4", false, true);
AddTimer("", 0.5, "Out5");
}

void Out5(string &in asTimer)
{
SetLampLit("candle_floor_5", false, true);
AddTimer("", 0.5, "Out6");
}

void Out6(string &in asTimer)
{
SetLampLit("candle_floor_6", false, true);
AddTimer("", 0.5, "Out7");
}

void Out7(string &in asTimer)
{
SetLampLit("candle_floor_7", false, true);
AddTimer("", 0.5, "Out8");
}

void Out8(string &in asTimer)
{
SetLampLit("candle_floor_8", false, true);
AddTimer("", 0.5, "Out9");
}

void Out9(string &in asTimer)
{
SetLampLit("candle_floor_9", false, true);
AddTimer("", 0.5, "Out10");
}

void Out10(string &in asTimer)
{
SetLampLit("candle_floor_10", false, true);
AddTimer("", 0.5, "Out11");
}

void Out11(string &in asTimer)
{
SetLampLit("candle_floor_11", false, true);
AddTimer("", 0.5, "Out12");
}

void Out12(string &in asTimer)
{
SetLampLit("candle_floor_12", false, true);
AddTimer("", 0.5, "ActivatePlayer");
}

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

////////////////////////////
// Run when leaving map
void OnLeave()
{
StopMusic(1,0);
}

void ActivateMonster(string &in item)
{
SetEntityActive("servant_grunt_1", true);
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_6", 0, "Idle");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_7", 0, "Idle");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_8", 0, "Idle");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_10", 0, "Idle");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_11", 0, "Idle");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_12", 0, "Idle");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_13", 0, "Idle");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_14", 0, "Idle");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_15", 3, "Idle");

}
void LookAtDoor(string &in asTimer)
{
StopPlayerLookAt();
}
thank you very much
07-30-2012, 03:55 PM
Find




Users browsing this thread: 1 Guest(s)