Page 1 of 1

common-ai-script?

Posted: Wed Aug 06, 2008 6:03 pm
by Roidal
Is there a common-ai script for all scriptless aliens? I placed some Brutemauler without assigning a script to it, so in the mission_ai.dhs there are no ai-scriptcalls for this unit but he was attacking?

Re: common-ai-script?

Posted: Thu Aug 07, 2008 1:19 am
by fb_joel
So you wanted an unintelligent Brute and yet it was intelligent? Miracle!

;)

Did it move at all, or was it just standing around and shooting/hitting? This may indeed be some sort of a "bug". A quick workaround might be to set its AI to Neutral or Ally state (it's the box just below the unit list, and it's Hostile by default). Then it won't attack.

Re: common-ai-script?

Posted: Thu Aug 07, 2008 11:55 am
by Roidal
The Brutemauler does not movig, he is only shooting at me. No, i don't want an unintelligent Brute, but i want to know how does the game and the scripts work, so i tried every possible thing and in this way i saw that the Brutemauler attacks without an ai-script. :D Maybe the ai-scripts are for moving, and the weapons shoot without?

Re: common-ai-script?

Posted: Thu Aug 07, 2008 1:56 pm
by Roidal
Now i tried it with a scavenger. At first he do nothing, but if it hears you (if you shoot with a weapon) he moves for one or two seconds and from this moment he turns everytime to you. Then, if you go to the scavenger, he attacks, but don't moves.

Re: common-ai-script?

Posted: Thu Aug 07, 2008 5:53 pm
by fb_joel
Ok, the programmers told me that this is in fact a "reflex". Each unit gets a target (the player) from a general AI, and the units will try to attack the target even if they have no AI. It's a bit more complicated than this explanation though. This can be prevented by setting the unit to ally or neutral, or by a script: setUnitByIdString "yourunitid" (given in properties window); disableUnitAI (or so); clearTarget; setMode hold_fire (or so).

Re: common-ai-script?

Posted: Thu Aug 07, 2008 6:09 pm
by Roidal
Thank you again! :)