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
Can't get grunt to spawn upon item pickup
Rob21894 Offline
Junior Member

Posts: 4
Threads: 3
Joined: Nov 2013
Reputation: 0
#1
Can't get grunt to spawn upon item pickup

I'm new to hpl2 engine, and still trying to figure out how it works...

I am trying to get a grunt to spawn when I pick up an object,

Here is the code I've used to try execute this.

void OnStart()
{
SetEntityPlayerInteractCallback("flask01_aqua_regia_1", "Scriptspawnenemy1", true);
}
void Scriptspawnenemy1(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("grunt1", true);
AddEnemyPatrolNode("Enemy1", "PathNodeArea_1", 0.0, " ");
AddEnemyPatrolNode("Enemy1", "PathNodeArea_2", 0.0, " ");
AddEnemyPatrolNode("Enemy1", "PathNodeArea_3", 0.0, " ");


I have double checked everything to see if im using the correct names, even copy and pasted them into this,
I also have a "Script area" called, Scriptspawnenemy1,

Where am i going wrong? any help would be appriciated
(This post was last modified: 11-13-2013, 08:04 PM by Rob21894.)
11-13-2013, 07:48 PM
Find
daortir Offline
Senior Member

Posts: 422
Threads: 9
Joined: Sep 2013
Reputation: 18
#2
RE: Can't get grunt to spawn upon item pickup

Try (string &in asEntity) instead of (string &in asParent, string &in asChild, int alState)


If it works you owe me a cookie :3

This will just mean that the function "Scriptspawnenemy1" is called because of an entity, and not because of two entities colliding. For a function called by a timer you need to write (string &in asTimer), and so on.

(This post was last modified: 11-13-2013, 07:57 PM by daortir.)
11-13-2013, 07:56 PM
Find
Rob21894 Offline
Junior Member

Posts: 4
Threads: 3
Joined: Nov 2013
Reputation: 0
#3
RE: Can't get grunt to spawn upon item pickup

(11-13-2013, 07:56 PM)daortir Wrote: Try (string &in asEntity) instead of (string &in asParent, string &in asChild, int alState)


If it works you owe me a cookie :3

This will just mean that the function "Scriptspawnenemy1" is called because of an entity, and not because of two entities colliding. For a function called by a timer you need to write (string &in asTimer), and so on.

I owe you one cookie! thanks :3
(This post was last modified: 11-13-2013, 08:04 PM by Rob21894.)
11-13-2013, 08:03 PM
Find




Users browsing this thread: 3 Guest(s)