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
HPL level editor Need help now!
Fanstetic Offline
Junior Member

Posts: 8
Threads: 2
Joined: Aug 2012
Reputation: 0
#1
HPL level editor Need help now!

Hello, I'm having a scripting problem, basically I have a monster spawning in one spot using a playerstart and a script that you walk through, I wanted to make another one but it keeps spawning at the wrong playerstart. Here is the script

void OnStart()
{
SetEntityConnectionStateChangeCallback("lever", "unlockdoor");
AddEntityCollideCallback("Player", "script_slam", "func_slam", true, 1);
AddEntityCollideCallback("Player","start","monster",true,1);
AddEntityCollideCallback("grunt","stop","monsterend",true,1);
AddEntityCollideCallback("Player","start2","monster",true,1);
}

void unlockdoor(string &in asEntity, int alState) {
if(GetLeverState("lever")==1){ SetSwingDoorLocked("door", false, true);
}
}

void func_slam(string &in asParent, string &in asChild, int alState)
{
SetPropHealth("door1", 0.0f);


PlaySoundAtEntity("", "react_breath_slow.snt", "Player", 0, false);


PlaySoundAtEntity("", "react_scare", "Player", 0, false);


PlaySoundAtEntity("", "close_door.snt", "Player", 0, false);


GiveSanityDamage(5.0f, true);
}

void monster(string &in asParent, string &in asChild, int alstate){
SetEntityActive("grunt",true);
AddEnemyPatrolNode("grunt","node",0,"");
}

void monsterend(string &in asParent, string &in asChild, int alstate){
SetEntityActive("grunt",false);
}

void monster2(string &in asParent, string &in asChild, int alstate){
SetEntityActive("crawler",true);
AddEnemyPatrolNode("crawler","node2",0,"");
}

Please note I'm very new so if you notice any fails, anything I am doing wrong please point it out. Thanks.
08-24-2012, 08:36 AM
Find
Adny Offline
Posting Freak

Posts: 1,766
Threads: 6
Joined: Mar 2012
Reputation: 173
#2
RE: HPL level editor Need help now!

void OnStart()
{
SetEntityConnectionStateChangeCallback("lever", "unlockdoor");
AddEntityCollideCallback("Player", "script_slam", "func_slam", true, 1);
AddEntityCollideCallback("Player", "start", "monster", true, 1);
AddEntityCollideCallback("grunt", "stop", "monsterend", true, 1);
AddEntityCollideCallback("Player", "start2", "monster", true, 1);
}

The second bolded AddEntityCollideCallback should call the function "monster2"; it just calls the same function as the AddEntityCollideCallback for the first monster.

AddEntityCollideCallback("Player", "start2", "monster2", true, 1);



Hope that helped!

I rate it 3 memes.
08-24-2012, 08:45 AM
Find
Fanstetic Offline
Junior Member

Posts: 8
Threads: 2
Joined: Aug 2012
Reputation: 0
#3
RE: HPL level editor Need help now!

(08-24-2012, 08:45 AM)andyrockin123 Wrote: void OnStart()
{
SetEntityConnectionStateChangeCallback("lever", "unlockdoor");
AddEntityCollideCallback("Player", "script_slam", "func_slam", true, 1);
AddEntityCollideCallback("Player", "start", "monster", true, 1);
AddEntityCollideCallback("grunt", "stop", "monsterend", true, 1);
AddEntityCollideCallback("Player", "start2", "monster", true, 1);
}

The second bolded AddEntityCollideCallback should call the function "monster2"; it just calls the same function as the AddEntityCollideCallback for the first monster.

AddEntityCollideCallback("Player", "start2", "monster2", true, 1);



Hope that helped!
Thank you sooo much!!!!!
08-24-2012, 08:50 AM
Find




Users browsing this thread: 2 Guest(s)