RE: Message on locked doors
In the lever editor ("PlayerEntityCallback" in this door where message should be).
And in script file (Here's all script. I used bold to show the script message)
////////////////////////////
// Run when starting map
void OnStart()
{
AddUseItemCallback("", "basementkey_1", "basement_1", "KeyOnDoor", true);
AddUseItemCallback("", "corridorkey", "corridor_1", "KeyOnDoor_2", true);
AddEntityCollideCallback("Player", "tp_1", "DeadOne", true, 1);
AddEntityCollideCallback("Player", "tp_2", "ColinBody", true, 1);
SetEntityCallbackFunc("corridorkey", "OnPickup");
AddEntityCollideCallback("stevie_1", "fade_1", "fade1", true, 1);
}
void KeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("basement_1", false, true);
PlaySoundAtEntity("", "unlock_door", "basement_1", 0, false);
}
void DeadOne(string &in asParent, string &in asChild, int alStates)
{
SetEntityActive("GhostOne", true);
AddPropForce("GhostOne", 0, 0, -100000, "world");
PlaySoundAtEntity("", "24_iron_maiden.snt", "GhostOne", 0, false);
}
void ColinBody(string&in asParent, string &in asChild, int alStates)
{
SetEntityActive("ColinBody", true);
AddPropForce("ColinBody", 0, 0, 0, "world");
PlaySoundAtEntity("", "24_burn.snt", "ColinBody", 0, false);
}
void OnPickup(string &in asEntity, string &in type)
{
SetEntityActive("stevie_1", true);
AddEnemyPatrolNode("stevie_1", "PathNodeArea_1", 0.1, "");
AddEnemyPatrolNode("stevie_1", "PathNodeArea_2", 0.1, "");
AddEnemyPatrolNode("stevie_1", "PathNodeArea_3", 0.1, "");
AddEnemyPatrolNode("stevie_1", "PathNodeArea_4", 0.1, "");
AddEnemyPatrolNode("stevie_1", "PathNodeArea_5", 0.1, "");
}
void fade1(string &in asParent, string &in asChild, int alState)
{
FadeEnemyToSmoke("stevie_1", true);
}
void KeyOnDoor_2(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("corridor_1", false, true);
PlaySoundAtEntity("", "unlock_door", "corridor_1", 0, false);
}
void Messagedoor(string &in entity)
{
if(GetSwingDoorLocked("sierociniec") == true)
{
SetMessage("Messages", "zamkniete", 0);
}
}
|