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
#1
Exclamation  Need help...

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

http://www.moddb.com/mods/jessehmusic - Hospital of horror , WIP
03-05-2012, 04:20 PM
Website Find
Red Offline
Posting Freak

Posts: 1,757
Threads: 49
Joined: Feb 2012
Reputation: 54
#2
RE: Need help...

(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//
}

03-05-2012, 05:20 PM
Find
jessehmusic Offline
Senior Member

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

(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 ;/



http://www.moddb.com/mods/jessehmusic - Hospital of horror , WIP
03-05-2012, 05:59 PM
Website Find
Red Offline
Posting Freak

Posts: 1,757
Threads: 49
Joined: Feb 2012
Reputation: 54
#4
RE: Need help...

(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?



03-05-2012, 07:29 PM
Find
Strembitsky Offline
Senior Member

Posts: 254
Threads: 37
Joined: Feb 2012
Reputation: 3
#5
RE: Need help...

He probably just copy and pasted that whole script without changing anything.

The Nightmares v1.0 - Dreadful Fires WIP
03-05-2012, 07:35 PM
Find
jessehmusic Offline
Senior Member

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

(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

http://www.moddb.com/mods/jessehmusic - Hospital of horror , WIP
(This post was last modified: 03-05-2012, 09:17 PM by jessehmusic.)
03-05-2012, 09:17 PM
Website Find
jessehmusic Offline
Senior Member

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

need help Sad

http://www.moddb.com/mods/jessehmusic - Hospital of horror , WIP
03-06-2012, 07:06 AM
Website Find
Datguy5 Offline
Senior Member

Posts: 629
Threads: 25
Joined: Dec 2011
Reputation: 12
#8
RE: Need help...

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.


(This post was last modified: 03-06-2012, 04:53 PM by Datguy5.)
03-06-2012, 04:53 PM
Find
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
Nevicar Offline
Junior Member

Posts: 37
Threads: 4
Joined: Mar 2012
Reputation: 0
#10
RE: Need help...

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?
(This post was last modified: 03-06-2012, 05:32 PM by Nevicar.)
03-06-2012, 05:28 PM
Find




Users browsing this thread: 1 Guest(s)