Ohai there, i dont think my "Script Areas" work.. Not sure if its a problem in the level editor, or in the code so ill post pic's of the editor and the code.
I tried to make a "Flying jesus" scare but when i walk into that area, nothing happends..
The code is a bit messy.. it is my first map.. hopefully you can make something out of it
/////////////////////Run when starting mapvoid OnStart(){ AddUseItemCallback("", "OutKey", "OutDoor", "UseKey1", true); AddUseItemCallback("", "Room1_key", "Room1_door", "UseKey2", true); AddEntityCollideCallback("Player", "Scriptarea_1", "Chairmode", true, 1);
AddEntityCollideCallback("Player", "FlyingJesus_1", "HolyJesus", true, 1); AddEntityCollideCallback("Jesus_1", "FlyingJesus_1", "Sound", true, 1); AddEntityCollideCallback("Player", "Scary_Area_4", "Scary_4", true, 1); SetPlayerLampOil(0);}
void d2(string &in asItem, string &in asEntity){ SetSwingDoorLocked("door2", false, true); PlaySoundAtEntity("", "unlock_door", "d2", 0, false); RemoveItem("OutKey");}void UseKey1(string &in asitem, string &in Door){ SetSwingDoorLocked("OutDoor", false, true); PlaySoundAtEntity("", "unlock_door", "door", 0, false); RemoveItem(asitem); SetMessage("M", "v1", 3); SetEntityActive("Mansion_Monster1", true); AddEnemyPatrolNode("Mansion_Monster1", "Mansion_monster_path_1", 0.1, ""); SetEntityActive("Mansion_Monster1_1", true); AddEnemyPatrolNode("Mansion_Monster1_1", "Mansion_monster_path_1", 0.1, ""); SetEntityActive("Mansion_Monster1_2", true); AddEnemyPatrolNode("Mansion_Monster1_2", "Mansion_monster_path_1", 0.1, ""); GiveSanityDamage(20, true); StartScreenShake(0.10f, 0.1f, 0.10f, 0.1f); PlaySoundAtEntity("", "react_scare.snt", "Player", 0.0, false);}void UseKey2(string &in asitem, string &in Door){ SetSwingDoorLocked("Room1_Door", false, true); PlaySoundAtEntity("", "unlock_door", "door", 0, false); RemoveItem(asitem);}
void Chairmode(string &in asItem, string &in asEntity) { SetLampLit("candlestick_wall_1", true, false); PlaySoundAtEntity("", "chair.ogg", "MrChair", 0, false); }
void HolyJesus(string &in asParent, string &in asChild, int alState){SetEntityActive("Jesus_1", true);AddPropForce("Jesus_1", 0, 30000, 0, "World");} void Sound(string &in asParent, string &in asChild, int alState){PlaySoundAtEntity("", "24_iron_maiden.snt", "FlyingJesus_1", 0, false);}