![]() |
[LVL ED] Need help... - Printable Version +- Frictional Games Forum (read-only) (https://www.frictionalgames.com/forum) +-- Forum: Amnesia: The Dark Descent (https://www.frictionalgames.com/forum/forum-6.html) +--- Forum: Custom Stories, TCs & Mods - Development (https://www.frictionalgames.com/forum/forum-38.html) +---- Forum: Development Support (https://www.frictionalgames.com/forum/forum-39.html) +---- Thread: [LVL ED] Need help... (/thread-13778.html) Pages:
1
2
|
Need help... - jessehmusic - 03-05-2012 hello, i need help with lvl edtiors areas... I want like this you walk throw the area...nothing happend...then you pick the key...and then go throw it then it will happend how do i do that.... :/ any tip RE: Need help... - Red - 03-05-2012 (03-05-2012, 04:20 PM)jessehmusic Wrote: hello,You should use "has item func" example: void OnStart() { AddEntityCollideCallback("Player","callback","callbackfunc",true, 1); } void callbackfunc(string &in asParent,string &in asChild,int alState) { if(HasItem("keyname"))//Do stuff// } RE: Need help... - jessehmusic - 03-05-2012 (03-05-2012, 05:20 PM)Pyöveli Wrote:dosnt work ;/(03-05-2012, 04:20 PM)jessehmusic Wrote: hello,You should use "has item func" RE: Need help... - Red - 03-05-2012 (03-05-2012, 05:59 PM)jessehmusic Wrote:What do you have an error message or something?(03-05-2012, 05:20 PM)Pyöveli Wrote:dosnt work ;/(03-05-2012, 04:20 PM)jessehmusic Wrote: hello,You should use "has item func" RE: Need help... - Strembitsky - 03-05-2012 He probably just copy and pasted that whole script without changing anything. RE: Need help... - jessehmusic - 03-05-2012 (03-05-2012, 07:35 PM)Strembitsky Wrote: He probably just copy and pasted that whole script without changing anything.Here is the hps void OnStart() ////CALLBACKS START { AddUseItemCallback("", "Study Key", "sutdy door", "KeyOnDoor", true); AddUseItemCallback("", "Room Key1", "Room_1", "KeyOnDoor1", true); AddUseItemCallback("", "Room Key2", "Room_2", "KeyOnDoor2", true); AddUseItemCallback("", "Room Key3", "Room_3", "KeyOnDoor3", true); AddUseItemCallback("", "Bathroom_Key", "Bathroom_Door", "KeyOnDoor4", true); AddEntityCollideCallback("Player", "Ghost_Horror1", "GhostHorror", true, 1); AddEntityCollideCallback("Ghost2", "MonsterRemove", "RemoveMonster", true, 1); AddEntityCollideCallback("Player", "text_1", "Text", true, 1); AddEntityCollideCallback("Player", "Ghost_area", "Horror1", true, 1); SetEntityPlayerInteractCallback("Note_Dead1" ,"Text_1" , true); SetEntityPlayerInteractCallback("Note_Dead2" ,"Text_2" , true); SetEntityPlayerInteractCallback("Note_Dead3" ,"Text_3" , true); SetEntityPlayerInteractCallback("Note_Dead4" ,"Text_4" , true); SetEntityPlayerInteractCallback("Note_Dead5" ,"Text_5" , true); SetEntityPlayerInteractCallback("Scary Key", "KeyHorror", true); } ////CALLBACKS ENDS ////KEY ON DOORS void KeyOnDoor(string &in asItem, string &in asEntity) { SetLevelDoorLocked("sutdy door", false); PlaySoundAtEntity("", "unlock_door", "sutdy door", 0, false); RemoveItem("Study Key"); } void KeyOnDoor1(string &in asItem, string &in asEntity) { SetSwingDoorLocked("Room_1", false, true); PlaySoundAtEntity("", "unlock_door", "Room_1", 0, false); RemoveItem("Room Key1"); } void KeyOnDoor2(string &in asItem, string &in asEntity) { SetSwingDoorLocked("Room_2", false, true); PlaySoundAtEntity("", "unlock_door", "Room_2", 0, false); RemoveItem("Room Key2"); } void KeyOnDoor3(string &in asItem, string &in asEntity) { SetSwingDoorLocked("Room_3", false, true); PlaySoundAtEntity("", "unlock_door", "Room_3", 0, false); RemoveItem("Room Key3"); } void KeyOnDoor4(string &in asItem, string &in asEntity) { SetSwingDoorLocked("Bathroom_Door", false, true); PlaySoundAtEntity("", "unlock_door", "Bathroom_Door", 0, false); RemoveItem("Bathroom_Key"); } ////KEY ON DOORS END ////HORROR EVENTS void GhostHorror(string &in asParent, string &in asChild, int alState) { if(HasItem("Scary Key"))//Do stuff// AddTimer("T4", 1.0f, "Timer_4"); AddTimer("T5", 3.5f, "Timer_5"); } void Timer_4(string &in Timer) { SetEntityActive("alexander_3", true); PlayGuiSound("react_pant.snt", 22.4f); PlayGuiSound("enemy_hallucination_disappear.snt", 15.5f); } void Timer_5(string &in Timer) { SetEntityActive("alexander_3he", false); PlaySoundAtEntity("", "react_pant.snt", "Player", 0.0f, false); AddTimer("timerReleasePlayer7", 1, "timerReleasePlayer7"); } void timerReleasePlayer7(string &in asTimer) { SetMessage("Messages", "what7", 2); } void RemoveMonster(string &in asParent, string &in asChild, int alState) { SetEntityActive("Ghost2", false); } void KeyHorror(string &in asEntity) { StartScreenShake(0.2, 0.2, 2, 1.5f); PlaySoundAtEntity("", "04_scream.snt", "Player", 0.0f, false); SetSwingDoorClosed("Bloody Door", true, true); PlaySoundAtEntity("", "react_breath_slow.snt", "Player", 0, false); PlaySoundAtEntity("", "react_scare", "Player", 0, false); PlaySoundAtEntity("", "close_door.snt", "Player", 0, false); PlayGuiSound("react_pant.snt", 22.4f); PlaySoundAtEntity("", "react_pant.snt", "Player", 0.0f, false); GiveSanityDamage(5.0f, true); SetSwingDoorLocked("Bloody Door", true, true); AddTimer("timerReleasePlayer6", 5, "timerReleasePlayer6"); SetEntityActive("Ghost2", true); AddEnemyPatrolNode("Ghost2", "Ghoost_Node_1", 2, ""); AddEnemyPatrolNode("Ghost2", "Ghost_Node_2", 2, ""); } void timerReleasePlayer6(string &in asTimer) { SetMessage("Messages", "what6", 2); } void Horror1(string &in asParent, string &in asChild, int alState) { AddTimer("T2", 1.0f, "Timer_2"); AddTimer("T3", 1.5f, "Timer_3"); } void Timer_2(string &in Timer) { SetEntityActive("alexander_2", true); PlayGuiSound("react_pant.snt", 22.4f); PlayGuiSound("enemy_hallucination_disappear.snt", 15.5f); } void Timer_3(string &in Timer) { SetEntityActive("alexander_2", false); PlaySoundAtEntity("", "react_pant.snt", "Player", 0.0f, false); AddTimer("timerReleasePlayer", 1, "timerReleasePlayer"); } void timerReleasePlayer(string &in asTimer) { SetMessage("Messages", "what", 2); } ////HORROR EVENTS END ////MUSIC EVENTS void Music1(string &in asParent, string &in asChild, int alState) { PlayMusic("ambience_voice.ogg", true, 0.8f, 1, 0, true); } void StopMusic(string &in asParent, string &in asChild, int alState) { StopMusic(1 , 0); } ////MUSIC EVENTS END ////Text START void Text_1(string &in asEntity) { AddTimer("timerReleasePlayer1", 1, "timerReleasePlayer1"); } void timerReleasePlayer1(string &in asTimer) { SetMessage("Messages", "what1", 2); } void Text_2(string &in asEntity) { AddTimer("timerReleasePlayer2", 1, "timerReleasePlayer2"); } void timerReleasePlayer2(string &in asTimer) { SetMessage("Messages", "what2", 2); } void Text_3(string &in asEntity) { AddTimer("timerReleasePlayer3", 1, "timerReleasePlayer3"); } void timerReleasePlayer3(string &in asTimer) { SetMessage("Messages", "what3", 2); } void Text_4(string &in asEntity) { SetEntityActive("Ghost_1", true); AddTimer("timerReleasePlayer4", 1, "timerReleasePlayer4"); } void timerReleasePlayer4(string &in asTimer) { SetMessage("Messages", "what4", 2); } void Text_5(string &in asEntity) { AddTimer("timerReleasePlayer5", 1, "timerReleasePlayer5"); } void timerReleasePlayer5(string &in asTimer) { SetMessage("Messages", "what5", 10); } ////TEXT END void OnEnter() { AddEntityCollideCallback("Player", "MusicStart_1", "Music1", true, 1); AddEntityCollideCallback("Player", "MusicStop", "StopMusic", true, 1); } void OnLeave() { } (03-05-2012, 07:29 PM)Pyöveli Wrote:The ghost dosnt spawn...and the sound start when i enter the area without the key(03-05-2012, 05:59 PM)jessehmusic Wrote:What do you have an error message or something?(03-05-2012, 05:20 PM)Pyöveli Wrote:dosnt work ;/(03-05-2012, 04:20 PM)jessehmusic Wrote: hello,You should use "has item func" RE: Need help... - jessehmusic - 03-06-2012 need help ![]() RE: Need help... - Datguy5 - 03-06-2012 Do you really have it like this if(HasItem("keyname"))//Do stuff// I think it should be like this if(HasItem("keyname"))//true// or false.Try them both. RE: Need help... - jessehmusic - 03-06-2012 (03-06-2012, 04:53 PM)Datguy5 Wrote: Do you really have it like this if(HasItem("keyname"))//Do stuff//Still not work tryed both... :/ void OnStart() ////CALLBACKS START { /////ADDUSEITEM START AddUseItemCallback("", "Study Key", "sutdy door", "KeyOnDoor", true); AddUseItemCallback("", "Room Key1", "Room_1", "KeyOnDoor1", true); AddUseItemCallback("", "Room Key2", "Room_2", "KeyOnDoor2", true); AddUseItemCallback("", "Room Key3", "Room_3", "KeyOnDoor3", true); AddUseItemCallback("", "Bathroom_Key", "Bathroom_Door", "KeyOnDoor4", true); ////ADDUSEITEM END AddEntityCollideCallback(" ", "Ghost_Start_Area_Event", "Ghost_Horror_Ghost_Event1", true, 1); AddEntityCollideCallback("Ghost2", "MonsterRemove", "RemoveMonster", true, 1); AddEntityCollideCallback("Player", "text_1", "Text", true, 1); AddEntityCollideCallback("Player", "Ghost_area", "Horror1", true, 1);; ////COLLIDE END ////INTERACT START SetEntityPlayerInteractCallback("Note_Dead1" ,"f_1" , true); SetEntityPlayerInteractCallback("Note_Dead2" ,"Text_2" , true); SetEntityPlayerInteractCallback("Note_Dead3" ,"Text_3" , true); SetEntityPlayerInteractCallback("Note_Dead4" ,"Text_4" , true); SetEntityPlayerInteractCallback("Note_Dead5" ,"Text_5" , true); SetEntityPlayerInteractCallback("Scary_key", "KeyHorror", true); /////INTERACT END ////CALLBACKS ENDS } ////KEY ON DOORS void KeyOnDoor(string &in asItem, string &in asEntity) { SetLevelDoorLocked("sutdy door", false); PlaySoundAtEntity("", "unlock_door", "sutdy door", 0, false); RemoveItem("Study Key"); } void KeyOnDoor1(string &in asItem, string &in asEntity) { SetSwingDoorLocked("Room_1", false, true); PlaySoundAtEntity("", "unlock_door", "Room_1", 0, false); RemoveItem("Room Key1"); } void KeyOnDoor2(string &in asItem, string &in asEntity) { SetSwingDoorLocked("Room_2", false, true); PlaySoundAtEntity("", "unlock_door", "Room_2", 0, false); RemoveItem("Room Key2"); } void KeyOnDoor3(string &in asItem, string &in asEntity) { SetSwingDoorLocked("Room_3", false, true); PlaySoundAtEntity("", "unlock_door", "Room_3", 0, false); RemoveItem("Room Key3"); } void KeyOnDoor4(string &in asItem, string &in asEntity) { SetSwingDoorLocked("Bathroom_Door", false, true); PlaySoundAtEntity("", "unlock_door", "Bathroom_Door", 0, false); RemoveItem("Bathroom_Key"); } ////KEY ON DOORS END ////HORROR EVENTS void Ghost_Horror_Ghost_Event1(string &in asParent, string &in asChild, int alState) { if(HasItem("Scary_key"))//false// AddTimer("T4", 1.0f, "Timer_4"); AddTimer("T5", 1.5f, "Timer_5"); } void Timer_4(string &in Timer) { SetEntityActive("alexander_3", true); PlayGuiSound("enemy_hallucination_disappear.snt", 15.5f); } void Timer_5(string &in Timer) { SetEntityActive("alexander_3", false); PlaySoundAtEntity("", "react_pant.snt", "Player", 0.0f, false); } void RemoveMonster(string &in asParent, string &in asChild, int alState) { SetEntityActive("Ghost2", false); } void KeyHorror(string &in asEntity) { StartScreenShake(0.2, 0.2, 2, 1.5f); PlaySoundAtEntity("", "04_scream.snt", "Player", 0.0f, false); SetSwingDoorClosed("Bloody Door", true, true); PlaySoundAtEntity("", "react_breath_slow.snt", "Player", 0, false); PlaySoundAtEntity("", "react_scare", "Player", 0, false); PlaySoundAtEntity("", "close_door.snt", "Player", 0, false); PlayGuiSound("react_pant.snt", 22.4f); PlaySoundAtEntity("", "react_pant.snt", "Player", 0.0f, false); GiveSanityDamage(5.0f, true); SetSwingDoorLocked("Bloody Door", true, true); AddTimer("timerReleasePlayer6", 5, "timerReleasePlayer6"); SetEntityActive("Ghost2", true); AddEnemyPatrolNode("Ghost2", "Ghoost_Node_1", 2, ""); AddEnemyPatrolNode("Ghost2", "Ghost_Node_2", 2, ""); } void timerReleasePlayer6(string &in asTimer) { SetMessage("Messages", "what6", 2); } void Horror1(string &in asParent, string &in asChild, int alState) { AddTimer("T2", 1.0f, "Timer_2"); AddTimer("T3", 1.5f, "Timer_3"); } void Timer_2(string &in Timer) { SetEntityActive("alexander_2", true); PlayGuiSound("react_pant.snt", 22.4f); PlayGuiSound("enemy_hallucination_disappear.snt", 15.5f); } void Timer_3(string &in Timer) { SetEntityActive("alexander_2", false); PlaySoundAtEntity("", "react_pant.snt", "Player", 0.0f, false); AddTimer("timerReleasePlayer", 1, "timerReleasePlayer"); } void timerReleasePlayer(string &in asTimer) { SetMessage("Messages", "what", 2); } ////HORROR EVENTS END ////MUSIC EVENTS void Music1(string &in asParent, string &in asChild, int alState) { PlayMusic("ambience_voice.ogg", true, 0.8f, 1, 0, true); } void StopMusic(string &in asParent, string &in asChild, int alState) { StopMusic(1 , 0); } ////MUSIC EVENTS END ////Text START void Text_1(string &in asEntity) { AddTimer("timerReleasePlayer1", 1, "timerReleasePlayer1"); } void timerReleasePlayer1(string &in asTimer) { SetMessage("Messages", "what1", 2); } void Text_2(string &in asEntity) { AddTimer("timerReleasePlayer2", 1, "timerReleasePlayer2"); } void timerReleasePlayer2(string &in asTimer) { SetMessage("Messages", "what2", 2); } void Text_3(string &in asEntity) { AddTimer("timerReleasePlayer3", 1, "timerReleasePlayer3"); } void timerReleasePlayer3(string &in asTimer) { SetMessage("Messages", "what3", 2); } void Text_4(string &in asEntity) { SetEntityActive("Ghost_1", true); AddTimer("timerReleasePlayer4", 1, "timerReleasePlayer4"); } void timerReleasePlayer4(string &in asTimer) { SetMessage("Messages", "what4", 2); } void Text_5(string &in asEntity) { AddTimer("timerReleasePlayer5", 1, "timerReleasePlayer5"); } void timerReleasePlayer5(string &in asTimer) { SetMessage("Messages", "what5", 10); } ////TEXT END void OnEnter() { AddEntityCollideCallback("Player", "MusicStart_1", "Music1", true, 1); AddEntityCollideCallback("Player", "MusicStop", "StopMusic", true, 1); } void OnLeave() { } RE: Need help... - Nevicar - 03-06-2012 Last time I checked, if statements need a pair of brackets for their own statements. i.e. void Ghost_Horror_Ghost_Event1(string &in asParent, string &in asChild, int alState) { if(HasItem("Scary_key") == true)//false// { AddTimer("T4", 1.0f, "Timer_4"); AddTimer("T5", 1.5f, "Timer_5"); } Maybe that? |