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
Level Editor Help Need help...
jessehmusic Offline
Senior Member

Posts: 423
Threads: 102
Joined: Dec 2011
Reputation: 8
#9
RE: Need help...

(03-06-2012, 04:53 PM)Datguy5 Wrote: 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.
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()
{
}

http://www.moddb.com/mods/jessehmusic - Hospital of horror , WIP
03-06-2012, 05:21 PM
Website Find


Messages In This Thread
Need help... - by jessehmusic - 03-05-2012, 04:20 PM
RE: Need help... - by Red - 03-05-2012, 05:20 PM
RE: Need help... - by jessehmusic - 03-05-2012, 05:59 PM
RE: Need help... - by Red - 03-05-2012, 07:29 PM
RE: Need help... - by Strembitsky - 03-05-2012, 07:35 PM
RE: Need help... - by jessehmusic - 03-05-2012, 09:17 PM
RE: Need help... - by jessehmusic - 03-06-2012, 07:06 AM
RE: Need help... - by Datguy5 - 03-06-2012, 04:53 PM
RE: Need help... - by jessehmusic - 03-06-2012, 05:21 PM
RE: Need help... - by Nevicar - 03-06-2012, 05:28 PM
RE: Need help... - by jessehmusic - 03-07-2012, 09:59 PM
RE: Need help... - by Red - 03-07-2012, 10:25 PM
RE: Need help... - by jessehmusic - 03-08-2012, 09:13 AM
RE: Need help... - by Red - 03-08-2012, 09:30 AM
RE: Need help... - by jessehmusic - 03-09-2012, 07:55 AM
RE: Need help... - by jessehmusic - 03-09-2012, 07:57 PM
RE: Need help... - by Red - 03-11-2012, 03:18 PM
RE: Need help... - by Strembitsky - 03-11-2012, 03:34 PM
RE: Need help... - by jessehmusic - 03-15-2012, 11:20 AM



Users browsing this thread: 1 Guest(s)