(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: (03-05-2012, 05:59 PM)jessehmusic Wrote: (03-05-2012, 05:20 PM)Pyöveli Wrote: (03-05-2012, 04:20 PM)jessehmusic Wrote: 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
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//
}
dosnt work ;/
What do you have an error message or something?
The ghost dosnt spawn...and the sound start when i enter the area without the key