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
#11
RE: How to get Grunt to open cabinet doors

Ok so what you want to do for this case is delete the AddTimer("", 1.0, "MonsterPath"); in the void OnStart
and replace it with this
SetEntityPlayerInteractCallback("name of your key in here", "MonsterPath", false);
and then change your void MonsterPath from
void MonsterPath(string &in asTimer)
to
void MonsterPath(string &in asEntity)
leave everything else in this void the same.
06-22-2012, 06:46 PM
Find
Bridge Offline
Posting Freak

Posts: 1,971
Threads: 25
Joined: May 2012
Reputation: 128
#12
RE: How to get Grunt to open cabinet doors

(06-22-2012, 06:46 PM)drunkmonk Wrote: Ok so what you want to do for this case is delete the AddTimer("", 1.0, "MonsterPath"); in the void OnStart
and replace it with this
SetEntityPlayerInteractCallback("name of your key in here", "MonsterPath", false);
and then change your void MonsterPath from
void MonsterPath(string &in asTimer)
to
void MonsterPath(string &in asEntity)
leave everything else in this void the same.
Just FYI, it's called a function. Void is the return type (which means the function doesn't return anything).
06-22-2012, 07:32 PM
Find
drunkmonk Offline
Member

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

I know but being that Jagsrs28 is really new to scripting and that I didn't want to confuse him
06-22-2012, 07:37 PM
Find
Jagsrs28 Offline
Member

Posts: 101
Threads: 25
Joined: Jun 2012
Reputation: 0
#14
RE: How to get Grunt to open cabinet doors

(06-22-2012, 07:37 PM)drunkmonk Wrote: I know but being that Jagsrs28 is really new to scripting and that I didn't want to confuse him
I would like to thank you for understanding this. We all have to start somewhere. Now when you say "name of your key here" does the key mean the area the player has to walk into?

////////////////////////////
// Run first time starting map
void OnStart()
{
SetEntityPlayerInteractCallback("name of your key in here", "MonsterPath", false);
AddEntityCollideCallback("Grunty1", "monster_opendoor_area", monster_opendoor", true, 1);
}

void MonsterPath(string &in asEntity)
{
AddEnemyPatrolNode("Grunt1", "PathNodeArea1", 0, "");
AddEnemyPatrolNode("Grunt1", "PathNodeArea1", 0, "");
AddEnemyPatrolNode("Grunt1", "PathNodeArea2", 0, "");
AddEnemyPatrolNode("Grunt1", "PathNodeArea3", 0, "");
AddEnemyPatrolNode("Grunt1", "PathNodeArea4", 0, "");
AddEnemyPatrolNode("Grunt1", "PathNodeArea5", 0, "");
}
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("Grunt1", false);
}
////////////////////////////
// Run when leaving map
void OnEnter()
{

}

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

}

Special Custom Story for 2 special people!

[Image: LWFcAl]


(This post was last modified: 06-23-2012, 07:00 AM by Jagsrs28.)
06-23-2012, 06:59 AM
Find
DragonRuins Offline
Junior Member

Posts: 19
Threads: 4
Joined: Mar 2012
Reputation: 1
#15
RE: How to get Grunt to open cabinet doors

(06-23-2012, 06:59 AM)Jagsrs28 Wrote:
(06-22-2012, 07:37 PM)drunkmonk Wrote: I know but being that Jagsrs28 is really new to scripting and that I didn't want to confuse him
I would like to thank you for understanding this. We all have to start somewhere. Now when you say "name of your key here" does the key mean the area the player has to walk into?

////////////////////////////
// Run first time starting map
void OnStart()
{
SetEntityPlayerInteractCallback("name of your key in here", "MonsterPath", false);
AddEntityCollideCallback("Grunty1", "monster_opendoor_area", monster_opendoor", true, 1);
}

void MonsterPath(string &in asEntity)
{
AddEnemyPatrolNode("Grunt1", "PathNodeArea1", 0, "");
AddEnemyPatrolNode("Grunt1", "PathNodeArea1", 0, "");
AddEnemyPatrolNode("Grunt1", "PathNodeArea2", 0, "");
AddEnemyPatrolNode("Grunt1", "PathNodeArea3", 0, "");
AddEnemyPatrolNode("Grunt1", "PathNodeArea4", 0, "");
AddEnemyPatrolNode("Grunt1", "PathNodeArea5", 0, "");
}
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("Grunt1", false);
}
////////////////////////////
// Run when leaving map
void OnEnter()
{

}

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

}
The key should be the actual 'Key' that the player picks up. So whatever you called the key that is placed in the map, that is what you would use.

[Image: 76561198012068277.png]
06-24-2012, 01:51 AM
Website Find




Users browsing this thread: 1 Guest(s)