Apjjm
Is easy to say
Posts: 496
Threads: 18
Joined: Apr 2011
Reputation:
52
|
RE: Path nodes ain't showing up!
Okay, can't see anything immediately wrong, but we can do a few improvements to the code and add a statement to check we aren't overlooking something obvious first.
void GasDepleted( string asTimer )
{
SetLocalVarInt("gasOn",0);
for(int i = 1; i <= 45; i++)
{
SetLampLit("gasTorch_" + i, false, true);
FadeLightTo("gasLight_" + i, 0.0f, 0.0f, 0.0f, 1.0f, -1, 0.5f);
SetLightFlickerActive("gasLight_" + i, false);
}
//Spawn the monster
//SetEntityActive("mazeGrunt", true);\
int mID = GetLocalVarInt("monsterId");
string monster = "mg" + mID;
SetLocalVarInt("monsterId",mID+1);
CreateEntityAtArea(monster,"servant_grunt_noSound.ent","gruntSpawn",false);
//Couple of Debug Messages to verify stuff went OK.
AddDebugMessage(monster + " exists: " + GetEntityExists(monster),false);
AddDebugMessage( "moving to case " + GetLocalVarInt("targetArea"),false );
switch(GetLocalVarInt("targetArea"))
{
case 1:
AddEnemyPatrolNode(monster, "PathNodeArea_51", 0.0f, "");
AddEnemyPatrolNode(monster, "PathNodeArea_54", 0.0f, "");
AddEnemyPatrolNode(monster, "PathNodeArea_58", 0.0f, "");
break;
case 2:
AddEnemyPatrolNode(monster, "PathNodeArea_51", 0.0f, "");
AddEnemyPatrolNode(monster, "PathNodeArea_54", 0.0f, "");
AddEnemyPatrolNode(monster, "PathNodeArea_58", 0.0f, "");
break;
case 3:
AddEnemyPatrolNode(monster, "PathNodeArea_120", 0.0f, "");
AddEnemyPatrolNode(monster, "PathNodeArea_51", 0.0f, "");
AddEnemyPatrolNode(monster "PathNodeArea_54", 0.0f, "");
AddEnemyPatrolNode(monster, "PathNodeArea_58", 0.0f, "");
break;
case 4:
AddEnemyPatrolNode(monster, "PathNodeArea_120", 0.0f, "");
AddEnemyPatrolNode(monster, "PathNodeArea_114", 0.0f, "");
break;
case 5:
AddEnemyPatrolNode(monster, "PathNodeArea_114", 0.0f, "");
break;
case 6:
AddEnemyPatrolNode(monster, "PathNodeArea_206", 0.0f, "");
AddEnemyPatrolNode(monster, "PathNodeArea_152", 0.0f, "");
break;
case 7:
AddEnemyPatrolNode(monster, "PathNodeArea_152", 0.0f, "");
AddEnemyPatrolNode(monster, "PathNodeArea_120", 0.0f, "");
break;
case 8:
AddEnemyPatrolNode(monster, "PathNodeArea_206", 0.0f, "");
AddEnemyPatrolNode(monster, "PathNodeArea_152", 0.0f, "");
break;
case 9:
ShowEnemyPlayerPosition(monster);
break;
}
//Removed the default case, as currently it duplicates the below//
AddEnemyPatrolNode(monster, "PathNodeArea_11", 0.0f, "");
AddEnemyPatrolNode(monster, "PathNodeArea_25", 0.0f, "");
}
Now we know each time this routine runs we know if the monster exists & what nodes should have been added - the next step is to check if they were. This can be done using the debug menu and some options to inspect the grunt's state (I believe this is something along the lines of "show entity info" - if not check the boxes until you find the option). In this mode IIRC you can view the nodes added / active.
Most likely, the nodes will have been added. It may be possible that your nodes are too far away / obstructed from the grunt, and adding some more (just one or two nearby to the grunt for now for testing purposes) may do the trick.
(This post was last modified: 06-02-2011, 02:24 PM by Apjjm.)
|
|