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.
|