Facebook Twitter YouTube Frictional Games | Forum | Newsletter | Dev Blog | Dev Wiki | Support | Shelf | Store

Privacy Policy


Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Monster multiple node path problem.
Author Message
AlexRobillard Offline
Junior Member

Posts: 41
Joined: Jun 2011
Reputation: 0
Post: #1
Monster multiple node path problem.
I want to make a single monster walk on the path I choose, which involves going around corners then stopping, then going back. How would I do this?
This is the code that I am using (Monster2):
void OnStart()
{
AddEntityCollideCallback("Player" , "Monster_Walk_Trigger" , "MonsterWalk1" , true , 1);
AddEntityCollideCallback("Player" , "Monster_Walk_Trigger2" , "MonsterWalk2" , true , 1);
AddEntityCollideCallback("Player" , "Monster_Walk_Trigger" , "AddEnemyPatrolNode" , true , 1);
AddEntityCollideCallback("Player" , "Monster_Walk_Trigger2" , "AddEnemyPatrolNode2" , true , 1);
}

void MonsterWalk1(string &in asParent , string &in asChild , int alState)
{
SetEntityActive("Monster1" , true);
AddEnemyPatrolNode("Monster1", "PathNodeArea_35", 3, "");
}

void MonsterWalk2(string &in asParent , string &in asChild , int alState)
{
SetEntityActive("Monster2" , true);
AddEnemyPatrolNode2("Monster2", "PathNodeArea_20", 3, "");
AddEnemyPatrolNode2("Monster2", "PathNodeArea_4", 10, "");
AddEnemyPatrolNode2("Monster2", "PathNodeArea_58", 1, "");
AddEnemyPatrolNode2("Monster2", "PathNodeArea_59", 2, "");
}
I get errors on the path nodes when I start the game (crashes).
06-30-2011 10:19 PM
Find all posts by this user Quote this message in a reply
xtron Offline
Senior Member

Posts: 402
Joined: May 2011
Reputation: 2
Post: #2
RE: Monster multiple node path problem.
SetEntityActive("Monster2" , true);
AddEnemyPatrolNode2("Monster2", "PathNodeArea_20", 3.0f, "");
AddEnemyPatrolNode2("Monster2", "PathNodeArea_4", 10.0f, "");
AddEnemyPatrolNode2("Monster2", "PathNodeArea_58", 1.0f, "");
AddEnemyPatrolNode2("Monster2", "PathNodeArea_59", 2.0f, "");

When it's a float you need to add a decimal ex: 3 should be 3.0
and since it's a float you need to add f afterwards, like this: 3.0f

[Image: 44917299.jpg]Dubstep <3
06-30-2011 10:47 PM
Find all posts by this user Quote this message in a reply
Kyle Offline
Posting Freak

Posts: 910
Joined: Sep 2010
Reputation: 7
Post: #3
RE: Monster multiple node path problem.
Actually, when it's a float, it can be a float or int. The computer calculates it as 3.0 either way.

If you put in 3, you will get:

int: 3
float 3.0

06-30-2011 11:16 PM
Find all posts by this user Quote this message in a reply
Post Reply 




User(s) browsing this thread: 1 Guest(s)