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
Enemy does not patrol
.eX. Offline
Junior Member

Posts: 5
Threads: 2
Joined: Mar 2012
Reputation: 0
#1
Enemy does not patrol


void MonsterFunction(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("servant_brute_1", true);
AddEnemyPatrolNode("servant_brute_1","PathNodeArea_1", 3.50,"");
AddEnemyPatrolNode("servant_brute_1","PathNodeArea_2", 0,"");
AddEnemyPatrolNode("servant_brute_1","PathNodeArea_3", 0,"");
AddEntityCollideCallback("servant_brute_1", "PathNodeArea_3", "FadeEnemyToSmoke", false, 0);
FadeEnemyToSmoke("servant_brute_1", true);
}

enemy just stands still, can u plz help me with this ? I wanted em to walk to these path nodes and on the 3d note to fade (I am new to scripting plz be gentle)
03-25-2012, 04:23 PM
Find
Your Computer Offline
SCAN ME!

Posts: 3,456
Threads: 32
Joined: Jul 2011
Reputation: 235
#2
RE: Enemy does not patrol

If he is standing still after that, then you either have the wrong monster or the collision condition did not occur. Your script will actually have the monster turn into smoke before it even has the chance to patrol. So the fact that you can still see the monster means you have one of the two issues i mentioned.

Tutorials: From Noob to Pro
03-25-2012, 04:31 PM
Website Find
.eX. Offline
Junior Member

Posts: 5
Threads: 2
Joined: Mar 2012
Reputation: 0
#3
RE: Enemy does not patrol

how can I make monster fade after reaching certain point ? can u give me example plz ? and yeah there was wrong condition sry
03-25-2012, 04:47 PM
Find
Your Computer Offline
SCAN ME!

Posts: 3,456
Threads: 32
Joined: Jul 2011
Reputation: 235
#4
RE: Enemy does not patrol

(03-25-2012, 04:47 PM).eX. Wrote: how can I make monster fade after reaching certain point ? can u give me example plz ? and yeah there was wrong condition sry

Depends on whether or not you want it to be capable of chasing the player. Also, as far as i know, path nodes are not applicable to entity collision callbacks; you're going to need a script area. I'm not going to provide any example code since your current code shows that you have knowledge of entity collision callbacks, but your current code just needs to change the child name for the FadeEnemyToSmoke collision callback to a script area, remove the FadeEnemyToSmoke function from the MonsterFunction function, and define a FadeEnemyToSmoke function which complies with the entity collision callback syntax, which calls the original FadeEnemyToSmoke function.

Tutorials: From Noob to Pro
(This post was last modified: 03-25-2012, 05:10 PM by Your Computer.)
03-25-2012, 05:09 PM
Website Find
.eX. Offline
Junior Member

Posts: 5
Threads: 2
Joined: Mar 2012
Reputation: 0
#5
RE: Enemy does not patrol

void OnStart()
{
SetEntityActive("servant_brute_1", true);
AddEnemyPatrolNode("servant_brute_1","PathNodeArea_1", 3.50,"");
AddEnemyPatrolNode("servant_brute_1","PathNodeArea_2", 0,"");
AddEnemyPatrolNode("servant_brute_1","PathNodeArea_3", 0,"");
AddEntityCollideCallback("servant_brute_1", "ScriptArea_1", "MyFunc", false, 0);
}
void MyFunc(string &in asParent, string &in asChild, int alState)
{
FadeEnemyToSmoke("servant_brute_1", true);
}


this works perfectly thx u explained everything perfectly
(This post was last modified: 03-25-2012, 07:10 PM by .eX..)
03-25-2012, 05:11 PM
Find




Users browsing this thread: 1 Guest(s)