Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Ai_goal_follow issues.  (Read 1984 times)

0 Members and 1 Guest are viewing this topic.

Offline Fidchell

  • *
  • *
  • +4% chance to make useful post
  • Fidchell has no influence.
Ai_goal_follow issues.
« on: July 18, 2011, 07:36:28 AM »
So here I am with some SMOD problems again. I'm trying to edit a Nova Prospekt map a bit. What is supposed to happen is you activate a trigger that creates a zombine around a corner. When it's created, it's supposed to go to an info_target, but for some reason he's remaining idle and not doing a damn thing!

I have made sure that the info_target is placed right on the ground and that there ARE nodes placed. Here's the script. The entity activated is called "zombineassault"

Code: [Select]
// map arrange data
// location: d2_prison_02

"precache" {
"entity" "npc_combine_s"
"entity" "npc_zombie"
"entity" "setmsbomb"
"entity" "npc_fastzombie"
"model" "models/combine_super_soldier.mdl"
}


"entities:trap2" {
"setmsbomb" {
"origin" "-2399.0 3253.0 284.1"  "angle" "0 0 0"
}
"setmsbomb" {
"origin" "-2399.0 3253.8 294.0"  "angle" "0 0 0"
}

"prop_ragdoll" {
"origin" "-1950 2846 896"
"keyvalues" {
"model" "models/combine_super_soldier.mdl"
}
}

"npc_fastzombie" {
"origin" "-1945 3037 925"
}

}


"entities" {

"instant_trig" {
"origin" "-2117 3468 512"
"keyvalues" {
"radius" "50"
"label" "trap2"
}
}

"instant_trig" {
"origin" "-1651.987915 2730.852051 329.346558"
"keyvalues" {
"radius" "50"
"label" "zombieassault"
}
}

"setmsbomb" {
"origin" "-1725.0 3568.7 520.9"  "angle" "0 180 0"
}
"setmsbomb" {
"origin" "-1747.8 3647.0 517.8"  "angle" "0 270 0"
}

"npc_combine_s" {
"origin" "-895 3118 384" "angle" "0 179 0"
"keyvalues" {
"model" "models/soldier_camo.mdl"
"additionalequipment" "weapon_smg1"
"numgrenade" "5"
}
}

"npc_combine_s" {
"origin" "-880 2692 384" "angle" "0 179 0"
"keyvalues" {
"model" "models/soldier_camo.mdl"
"additionalequipment" "weapon_smg1"
}
}

"npc_combine_s" {
"origin" "-1112 3034 256" "angle" "0 -100 0"
"keyvalues" {
"model" "models/soldier_camo.mdl"
"additionalequipment" "weapon_lasergun"
}
}

"npc_combine_s" {
"origin" "-1895 1341 754" "angle" "0 96 0"
"keyvalues" {
"model" "models/soldier_camo.mdl"
"additionalequipment" "weapon_smg1"
}
}

"instant_trig" {
"origin" "-1975 2565 384" "angle" "0 -88 0"
"keyvalues" {
"label" "assault1"
"radius" "100"
}
}

"instant_trig" {
"origin" "-1975 2565 384" "angle" "0 -88 0"
"keyvalues" {
"label" "zombineassault"
"radius" "100"
}
}

"instant_trig" {
"origin" "-1378 3169 464"
"keyvalues" {
"label" "zombie"
"radius" "50"
}
}
}

"entities:zombie" {
"npc_zombie" {
"origin" "-1301 3772 514" "angle" "0 -98 0"
}
}

"entities:zombieassault" {

"npc_zombine" {
"origin" "-1426.418579 2556.568848 300.031250" "angle" "0 180 0"
}

"npc_zombine" {
"origin" "-1547.280518 2559.337646 300.031250" "angle" "0 180 0"
}

"npc_combine_s" {
"origin" "-1786.331299 2551.595459 300" "angle" "0 0 0"
"keyvalues" { "targetname" "combinefucked"
"additionalequipment" "weapon_smg1"
}

}

"info_target" {
"origin" "-2008.421631 2738.405029 288.05"
"keyvalues" { "targetname" "goalnpc3" }
}

"ai_goal_follow" {
"keyvalues" {
"startactive" "1"
"searchtype" "0"
"MaximumState" "2"
"actor" "combinefucked*"
"goal" "goalnpc3"
}
}
}

"entities:zombineassault" {

"npc_zombine" {
"origin" "-1405.388062 2705.568115 418.972260" "angle" "0 180 0"
"keyvalues" { "targetname" "zombine"
}
}

"info_target" {
"origin" "-1535.756592 2585.945557 418.031250"
"keyvalues" { "targetname" "goalnpc4" }
}

"ai_goal_follow" {
"keyvalues" {
"startactive" "1"
"searchtype" "0"
"MaximumState" "2"
"actor" "zombine*"
"goal" "goalnpc4"
}
}
}

"entities:assault1" {

"info_target" {
"origin" "-1961 2422 384"
"keyvalues" { "targetname" "goalnpc1" }
}

"ai_goal_follow" {
"keyvalues" {
"startactive" "1"
"searchtype" "0"
"MaximumState" "2"
"actor" "teki1*"
"goal" "goalnpc1"
}
}

"npc_combine_s" {
"origin" "-1677 1374 384" "angle" "0 118 0"
"keyvalues" { "targetname" "teki11"
"model" "models/soldier_camo.mdl"
"additionalequipment" "weapon_smg1"
}
}

"npc_combine_s" {
"origin" "-1506 1386 384" "angle" "0 86 0"
"keyvalues" { "targetname" "teki11"
"model" "models/soldier_camo.mdl"
"additionalequipment" "weapon_smg1"
}
}

"instant_trig" {
"origin" "-1411 2945 384"
"keyvalues" {
"label" "assault2"
"radius" "50"
}
}


}


"entities:assault2" {

"info_target" {
"origin" "-1411 2945 384"
"keyvalues" { "targetname" "goalnpc2" }
}

"ai_goal_follow" {
"keyvalues" {
"startactive" "1"
"searchtype" "0"
"MaximumState" "2"
"actor" "teki2*"
"goal" "goalnpc2"
}
}

"npc_combine_s" {
"origin" "-1367 2595 384"
"keyvalues" { "targetname" "teki2"
"model" "models/soldier_camo.mdl"
"additionalequipment" "weapon_smg1"
}
}

"npc_combine_s" {
"origin" "-1263 3307 384"
"keyvalues" { "targetname" "teki2"
"model" "models/soldier_camo.mdl"
"additionalequipment" "weapon_smg1"
}
}


}


Offline IneptGuard

  • *
  • *
  • +5% chance to make useful post
  • IneptGuard barely matters.IneptGuard barely matters.
Re: Ai_goal_follow issues.
« Reply #1 on: July 18, 2011, 09:45:40 PM »
"actor"      "zombine*"
Try removing the asterisk "*"

Also, some advice I gave before to someone with a similar problem and a similar goal:

Quote
Truth be told, ai_goal_follow isn't really the best entity to use when trying to get an NPC to move to a specific location. ai_goal_follow was pretty much only meant to work with NPCs and the player and they need to be allies other wise the NPC's AI protocols take priority. 

There are several different ways to accomplish what you are trying to do. V V

aiscripted_schedule: http://developer.valvesoftware.com/wiki/Aiscripted_schedule
These are perfect for what your trying to do but they can be tricky sometimes.

scripted_sequence: http://developer.valvesoftware.com/wiki/Scripted_sequence
I've seen these used to move NPCs into position for events, all you need is the "move too" and leave every thing else off or blank if that makes any sense.

npc_enemyfinder: http://developer.valvesoftware.com/wiki/Npc_enemyfinder
Basically its an invisible eye that can see and here enemies in its visual range. It can also be set to see through the world meaning that it will see everything. These entities can be placed in squads with other normal NPCs. Basically, your zombie and this entity can share the same squad name and they thus share info on enemy positions meaning that the zombie after the npc_enemyfinder is active, will see and move to the soldier (or any other enemy in view of the npc_enemyfinder) and attack.

These are just a few of many ways to accomplish this simple goal. I recommend you experiment and try different things to see which works the best for what your trying to do.


I know this isn't directly helping you fix the issue with the ai_goal_follow but like I said, those can be unreliable at times and I never really used them unless I needed friendly NPCs to follow the player. All I wanted to do is suggest some different ways of accomplishing this effect.   
« Last Edit: July 18, 2011, 09:47:16 PM by IneptGuard »

Offline Fidchell

  • *
  • *
  • +4% chance to make useful post
  • Fidchell has no influence.
Re: Ai_goal_follow issues.
« Reply #2 on: July 18, 2011, 11:16:37 PM »
The scripted_sequence works, and I expected it to, however, the zombine appears to be completely ignoring me until I attack it.

Also, I am still stumped by how ai_goal_follow isn't working, seeing as how an event in the same map where two combine run to a certain area seems to function just fine.

Offline BIZ

  • 32-Bit Hobo
  • *
  • *
  • +0% chance to make useful post
  • BIZ hides in shadows.
    • BSNOOCH.COM
Re: Ai_goal_follow issues.
« Reply #3 on: July 19, 2011, 01:15:42 AM »
zombine may not have proper coding to work with that entity !

Offline IneptGuard

  • *
  • *
  • +5% chance to make useful post
  • IneptGuard barely matters.IneptGuard barely matters.
Re: Ai_goal_follow issues.
« Reply #4 on: July 19, 2011, 01:21:37 AM »
It just sounds like his AI is getting overridden, just reset it after he reaches the sequence. To rest the AI, fire inputs to put him to sleep and then to wake him up. the same inputs that a normal NPC takes should work with the Zombine.

Biz is right about the Zombine being less functional in Smod so keep that in mind.

Offline BIZ

  • 32-Bit Hobo
  • *
  • *
  • +0% chance to make useful post
  • BIZ hides in shadows.
    • BSNOOCH.COM
Re: Ai_goal_follow issues.
« Reply #5 on: July 19, 2011, 01:52:38 AM »
yes the author coded them himself I believe???

Try using ent_text cvar for debugging the AI

Offline Fidchell

  • *
  • *
  • +4% chance to make useful post
  • Fidchell has no influence.
Re: Ai_goal_follow issues.
« Reply #6 on: July 19, 2011, 01:56:05 AM »
What I'm doing is I'm trying to go for the event in which an NPC follows the path to the end point and if he, along the path, sees the player or a hostile, he keeps moving but fires at the enemy as well.  I replaced the zombine with a combine for the sake of testing, and he does the same thing, except he is just walking there. Is there a way to make him rush in?

EDIT: Actually I'm hoping that I can get the NPC to go into combat mode and stop moving along his path when he sees you.
« Last Edit: July 19, 2011, 01:57:54 AM by Fidchell »

Offline IneptGuard

  • *
  • *
  • +5% chance to make useful post
  • IneptGuard barely matters.IneptGuard barely matters.
Re: Ai_goal_follow issues.
« Reply #7 on: July 19, 2011, 08:37:43 PM »
Try using an aiscripted_schedule, that would be perfect for what your trying to do.

Offline Fidchell

  • *
  • *
  • +4% chance to make useful post
  • Fidchell has no influence.
Re: Ai_goal_follow issues.
« Reply #8 on: July 19, 2011, 09:33:25 PM »
Agreed. It's useful in Hammer, and I use it often, but I'm not sure how I'm going to implement it via mapadd.

Offline IneptGuard

  • *
  • *
  • +5% chance to make useful post
  • IneptGuard barely matters.IneptGuard barely matters.
Re: Ai_goal_follow issues.
« Reply #9 on: July 19, 2011, 09:55:44 PM »
Build one in hammer and then save the .vmf file. Open the .vmf file with note pad or something similar and look at the code. It's not Lua but it's about as close as your going to get and it should set you on the right track.