Page 1 of 1

flag bearer script

Posted: Sun Oct 18, 2009 11:30 am
by Point
would it be possible to have a script that when a flag or standard bearer died and dropped the flag that another Ai unit would seek out the dropped flag, pick it up and continue the charge...

and if so who is up to the challenge ;)

Flag is a monster changing artifact that replacement units can pick up.

have fun mything..

Re: flag bearer script

Posted: Sun Oct 18, 2009 1:47 pm
by haravikk
That would be fairly simple, all you need to do is use a geometry filter to look for a dropped standard (the projectile that the artifact is attached to), and then find a nearby unit to go and pick it up. These are trivial pieces of scripting.

As for resuming the charge though, that would depend on whether the unit is controlled by a scripted attack action or not, if not then this piece of scripting would almost certainly annoy the player more than help them, except maybe if it only tested for idle units, and returned them to their original location, which isn't too hard to do.

To do this stuff you only need to understand and use GEOMs and a unit control, plus the move action if you want it to return to the original location.

Re: flag bearer script

Posted: Sun Oct 18, 2009 2:17 pm
by Pyro
There are different ways to go about this. One way would be to have a GEOM look for this flag projectile. The projectile tag that this flag uses will replace the (????) in the Object Type GEOM parameter. Make sure the tag only uses normal characters like letters, numbers, and a few other characters. If it uses other characters it will not work properly.


GEOM. Look for a flag
(expires on successful execution, low trigger time but higher than zero)
--Object Type: (????)
--Entire Map
--Maximum Number of Items: (1)
--Results Action Identifier: (Look for potential flag bearer, Grab that flag)
--Tested items Inside Field Name: (null, obje)
--Tested items Inside Location Field Name: (cent, null)
--Activates on Success: (Look for potential flag bearer)

GEOM. Look for potential flag bearer
(expires on execution)
--Monsters (subj): (units go here)
--Circle Radius: (Pick whatever value you wish like 5 or something)
--Maximum Number of Items: (1)
--Results Action Identifier: (Grab that flag)
--Tested items Inside Field Name: (subj)
--Activates on Success: (Grab that flag)
--Activates on Failure: (Look for a flag)

PICK. Grab that flag
(leave everything as blank or default)
--Activates on Execution: (Look for a flag)

This is part of it, however there is a part I did not include. What are the units capable of using these flags? All units? All team 0 units? All of a certain type? All holding a certain artifact or not holding? Whatever they may be, make a GEOM or more that feed those results to the "Look for potential flag bearer" as "subj".

Re: flag bearer script

Posted: Sun Oct 18, 2009 9:58 pm
by Point
well certainly sounds like it can be done....

in civil war flag bearers lead the charge replacement troops are the ones capable of picking up dropped flags and becoming flag bearers so in a AI attack they would be in the same squad set to charge the player... the player will want to kill the flag bearer since its a morale booster for the ai... the ideal situation would be that the replacement picks up the flag becomes a flag bearer monster and continues on the path of the attack.

if thats easy to do cool beans.


In AoM the standard bearer would be similar.