Page 1 of 1

Ai doesn't shoot !!! and imune command

Posted: Fri Feb 20, 2004 12:09 pm
by Tropheus
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

Posted: Fri Feb 20, 2004 3:58 pm
by Angex
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:

Code: Select all

$capi exec global/aim_and_shoot.scr $nebel_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:

Code: Select all

entity_name immune damage_type
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.

Posted: Fri Feb 20, 2004 5:25 pm
by Tropheus
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

Posted: Fri Feb 20, 2004 11:41 pm
by Angex
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.
Tropheus wrote:i write $nebel_trigger immune bulllets
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.

Posted: Sat Feb 21, 2004 1:29 am
by Tropheus
thx angex i'll try !!

first try.

You was right for the line

$capi exec global/aim_and_shoot.scr local.target

It works
thx for this part

Tropheus