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 How to get Grunt to open cabinet doors
drunkmonk Offline
Member

Posts: 109
Threads: 7
Joined: Jun 2012
Reputation: 4
#2
RE: How to get Grunt to open cabinet doors

(06-22-2012, 05:11 PM)Jagsrs28 Wrote: I am TERRIBLE at writing script. I scrapped my idea of having the Grunt hide in a cabinet (Mainly because I am terrible at writing script.) and decided to just have the Grunt come up to the cabinet open it then vanish. Can you just give me the script and where to put it? Please this will help me out A LOT.

Grunt Name: Grunty1

Cabinet Name: Cabby1

Where in here do I put the script?


////////////////////////////
// Run first time starting map
void OnStart()
{

}
////////////////////////////
// Run when leaving map
void OnEnter()
{

}

////////////////////////////
// Run when leaving map
void OnLeave()
{

}

You guys are the best so I know you can answer this Smile
////////////////////////////
// Run first time starting map
void OnStart()
{
AddEntityCollideCallback("Grunt1", "monster_opendoor_area", monster_opendoor", true, 1);
}
void monster_opendoor(string &in asParent, string &in asChild, int alState)
{
AddPropImpulse("Cabby1", -10.0 , 0, 0, "World");
AddTimer("", 1.0, monsterdisable);
}
void monsterdisable(string &in asTimer)
{
SetEntityActive("servant_grunt_1", false);
}
////////////////////////////
// Run when leaving map
void OnEnter()
{

}

////////////////////////////
// Run when leaving map
void OnLeave()
{

}


it should look something like this, you will also have to add path nodes for the monster and you may need to play around with the AddImpulse settings.

This website will tell you everything you need to know, it is alot of information but you will get the hang of it
http://wiki.frictionalgames.com/hpl2/amn..._functions
(This post was last modified: 06-22-2012, 05:32 PM by drunkmonk.)
06-22-2012, 05:25 PM
Find


Messages In This Thread
RE: How to get Grunt to open cabinet doors - by drunkmonk - 06-22-2012, 05:25 PM



Users browsing this thread: 1 Guest(s)