Frictional Games Forum (read-only)

Full Version: How do i spawn grunt in closet?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Can someone say to me how do i spawn grunt i closet? Everytime I try the grunt spawn with open door and start chasing me.
I literally don't understand what you are saying....
i guess he wants a grunt that's inactive and gets active by triggering, right?
(01-06-2012, 02:16 AM)Statyk Wrote: [ -> ]I literally don't understand what you are saying....
Same :/


I am sorry Sad little tired. I mean like Quotentote wrote.
Set the grunt inactive in level editor, resize the closet so the monster will fit in there. Put this in your .hps file for the map

void OnStart()
{
AddEntityCollideCallback("Player", "ScriptArea_1", "MonsterCloset", true, 1);
}

void MonsterCloset(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("grunt_name", true);
}

Put a ScriptArea near the closet.
No i got error instead when Sad something wrong with my code?
void OnStart()
{
AddUseItemCallback("", "keystudy_1", "Door_1", "KeyOnDoor", true);
}
void KeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("Door_1", false, false);
PlaySoundAtEntity("", "unlock_door", "Door_1", 0, false);


{
AddEntityCollideCallback("Player", "ScriptArea_1", "cabinet_nice_3", true, 1);
}

void MonsterCloset(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("grunt_name", true);
}
void OnLeave()
{

}
void OnStart()
{
AddUseItemCallback("", "keystudy_1", "Door_1", "KeyOnDoor", true);
AddEntityCollideCallback("Player", "ScriptArea_1", "MonsterCloset", true, 1);
}

void KeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("Door_1", false, false);
PlaySoundAtEntity("", "unlock_door", "Door_1", 0, false);
}


void MonsterCloset(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("grunt_name", true);
}


void OnLeave()
{

}




//___________________

Copy all and replace all.
Also make sure to place the proper "grunt_name" in the MonsterCloset function
Thanks manBig Grin YOu are my heroSmile
Remember to change the thread's prefix to solved.