hy guys !!!
In my single player map i want my Ai (allied) shoot at a nebel with a panzerchreck after a run.
but if the run goes right, he doesn't want to shoot at the nebel.
I tried to make him aiming the target with
$capi setaimtarget local.target
and after i tested diff?rents things like
$capi exec global/shoot.scr ==> it shoot without aiming
$capi exec global/attack.scr==> look like in defensive position but never shoot.
$capi exec global/shootifseen.scr==> it say me that it can't see the target because of nill listener so i put a script object instaed of my nebel (nothing more)
$capi exec global/aim_and_shoot.scr ==> i get this error message.
self aimat local.target (global/aimat.scr, 4)
self ^
in the last case, i remove the first line $capi setaimtarget because it's in the aim_and_shoot.scr
thx for your help!
my second question
i would like to know how does work the immune command
does it work like a colander?
so if i want to protect my nebel from bullet do y have to put 2 triggers ? one with the selection and one for the health?
thx a lot
Tropheus
Ai doesn't shoot !!! and imune command
Moderator: Moderators
Try giving the nebel a $targetname if you haven't already, and use this in your script, replacing $nebel_targetname with the nebel's targetname:
I'm not sure what will happen if he's out of range, or can't see it, presumably nothing !
Secondly the immune command works like this:
For example:
$nebel immune bullet
This would make the entity referenced as nebel immune to bullets. Valid damage types include:
rocket
bullet
fast_bullet
grenade
bash
There are some others but I can't remember them.
Code: Select all
$capi exec global/aim_and_shoot.scr $nebel_targetnameSecondly the immune command works like this:
Code: Select all
entity_name immune damage_type$nebel immune bullet
This would make the entity referenced as nebel immune to bullets. Valid damage types include:
rocket
bullet
fast_bullet
grenade
bash
There are some others but I can't remember them.
Thx for your answers angex.
1 for my nebel i tought it wasn't necessary to define the target name of the target after the exec global/aim_and_shoot.scr because first in the thread i define this
local.target=$nebel_targetname
And in the aim_and_shoot.scr you get this commande
self exec global/aimat.scr local.target
for the immune command i want my nebel only destroyed by the panzercherck rocket. So i made a trigger and select dammage and give him a targetname.
in my script i did what you say but it doesn't work my nebel is destroy by bullet (i write $nebel_trigger immune bulllets)
So i don't anderstand where is the problem execpt if i think at the opposite is working.
In fact my nebel is not protected by from nothing.
Sorry for my poor english.
Thx
tropheus
1 for my nebel i tought it wasn't necessary to define the target name of the target after the exec global/aim_and_shoot.scr because first in the thread i define this
local.target=$nebel_targetname
And in the aim_and_shoot.scr you get this commande
self exec global/aimat.scr local.target
for the immune command i want my nebel only destroyed by the panzercherck rocket. So i made a trigger and select dammage and give him a targetname.
in my script i did what you say but it doesn't work my nebel is destroy by bullet (i write $nebel_trigger immune bulllets)
So i don't anderstand where is the problem execpt if i think at the opposite is working.
In fact my nebel is not protected by from nothing.
Sorry for my poor english.
Thx
tropheus
Local variables are "owned" by the thread they are declared in. Therefore defining a local.target in your script means only that thread can access it. The aim_and_shoot.scr needs the target passing as a parameter.
This should be bullet not bullets, but I think you can setup the trigger in radiant so that only projectiles will trigger it, e.g. rockets.Tropheus wrote:i write $nebel_trigger immune bulllets
Last edited by Angex on Sat Feb 21, 2004 12:38 pm, edited 1 time in total.