attacks finish when a unit kills another?

A forum for discussing map making ideas and problems for the Myth series.
Post Reply
User avatar
carlinho
Posts: 1224
Joined: Tue Jun 08, 2004 8:23 pm

attacks finish when a unit kills another?

Post by carlinho »

believe it or not I sat down an hour to script last night
I have some units(crocodiles) that are scripted to attack if enemies (targets) enter a certain polygon.
now this units are set up to NOT autotarget, that is let's say you move a unit right next to them, they don't even react...
why...well it's a long story, just keep it that way.
So to make them react I did it through a script

now what happens is all the script works great, units (crocodiles) attack if the enemy unit enters the polygon, they retreat back inside the polygon if the enemy unit leaves it...
but somehow let's say out of 5 units(crocodiles) attacking... if a unit (1 of the 5) kills the entering unit, after it does, it's attack action somehow gets deleted...it's left not autotargetting enemies...while the other 4 (crocodiles) still keep attacking, as if the attack action was not deleted for them....but yes for the one that got the kill...
how can I avoid this attack nearest target action to not get deleted after they kill an enemy?
yes...I suck at explaining....I know...sorry...too tired :mrgreen:
http://carlinho7.tripod.com
Home of ANCIENT and CLASSICAL GREECE plugin on the works.
Image
User avatar
Pyro
Bug Finder Extraordinaire
Posts: 4751
Joined: Sun Mar 21, 2004 2:14 pm
Location: Texas

Re: attacks finish when a unit kills another?

Post by Pyro »

If you have this script split into different groups one per unit, it is possible you script it in such a way that made the script end. Like if you were to make a script look for something and keep looking until it finds something. After it finds it, you want something to happen and then restart the whole thing. Somehow something wasn't linked properly so it only works once and just ends after that.
Graydon
Posts: 1605
Joined: Sun Mar 21, 2004 5:10 pm

Re: attacks finish when a unit kills another?

Post by Graydon »

I might suggest trying to add a different expiry mode on the attack action? I typically find setting the ATTA to deactivate Never, and then manually deactivating the action when I need to, works the best for that action type. Not sure how your test/attack/fallback script is set up and whether this can help you, but worth a try for investigatory purposes at the least.

Welcome back Carl :)
Image
User avatar
carlinho
Posts: 1224
Joined: Tue Jun 08, 2004 8:23 pm

Re: attacks finish when a unit kills another?

Post by carlinho »

thanks guys, I'll definitely look into that
though it was weird that if all units had the same action attack, only the one that got the kill deactivated, while the others kept at it....
or maybe i need to clean the spiderwebs in my brain....
jeeeesssssssszzzzzzzz
:shock:
http://carlinho7.tripod.com
Home of ANCIENT and CLASSICAL GREECE plugin on the works.
Image
User avatar
carlinho
Posts: 1224
Joined: Tue Jun 08, 2004 8:23 pm

Re: attacks finish when a unit kills another?

Post by carlinho »

mmm what an idiot
yes, the attack expiration was set wrong, thanks for that

now the problem I have is with the attack itself.
I want this crocodiles to attack ANY unit on the map that go through this marsh.
it's a multiplayer map, so there's like 300 units at the same time if 4 teams would play.

I did an attack action with a polygon and closed polygon and a targets within polygon set up.
problem is crocs just target the targets up to # 125
after the #125 on the list of targets they don't at all.....
is there a limit for this action in # of targets you can assign?
probably #125 no? hahhaa
any ideas how to go over this limit?
if there is of course....
cheers!
http://carlinho7.tripod.com
Home of ANCIENT and CLASSICAL GREECE plugin on the works.
Image
Graydon
Posts: 1605
Joined: Sun Mar 21, 2004 5:10 pm

Re: attacks finish when a unit kills another?

Post by Graydon »

I would've thought a limit like that would be rounded to something closer to 128, but I'm not sure I've ever messed with that many 'objects' before. I've often individually flagged well over 150 units in a 'subject' field before with success though. It's quite possible there is a maximum limit.

If this is the case you could set up a GEOM filter, that uses all 300 units as 'subjects' (instead of the limited objects), checking for them, and feeding them as 'obje' every 2 or 3 seconds to the targets list that the croc attack action points to?
Image
User avatar
Pyro
Bug Finder Extraordinaire
Posts: 4751
Joined: Sun Mar 21, 2004 2:14 pm
Location: Texas

Re: attacks finish when a unit kills another?

Post by Pyro »

Yeah do like what Gray suggests. Make a GEOM look for like 100 units in that polygon, if it fails it looks for the next 100 and so on. If it succeeds then make the results go to the ATTA as the targets.

Another way to go about it is to have a GEOM looking for any units from team 0. If it succeeds, feed the results to the ATTA. If it fails have a munger switch that value of 0 into a 1 and run the GEOM again. Do this for each team and have it go back to 0. You don't need to use a MUNG, you could just copy the GEOM and just change the team it looks for. However if you do it like this you will need to subtract monster lists since the "Tests for Monsters on a Given Team Index" parameter ignores geometries.
User avatar
carlinho
Posts: 1224
Joined: Tue Jun 08, 2004 8:23 pm

Re: attacks finish when a unit kills another?

Post by carlinho »

those are really cool ideas, thanks!
one question though, how do you give the parameters you searched inside the geom to the targets field in the attack action? how do you link those 2 things?
http://carlinho7.tripod.com
Home of ANCIENT and CLASSICAL GREECE plugin on the works.
Image
User avatar
Pyro
Bug Finder Extraordinaire
Posts: 4751
Joined: Sun Mar 21, 2004 2:14 pm
Location: Texas

Re: attacks finish when a unit kills another?

Post by Pyro »

Easy, you know how in the ATTA there is a "Targets" parameter? Well that parameter is "obje, monster_identifier". So when you make a GEOM, make the Results Action Identifier be the ATTA you wish to use. Then make the "Tested items Inside Field Name" (if that is what you are using for results) to be "obje". This way the results are fed to your Attack action as the Targets.
User avatar
carlinho
Posts: 1224
Joined: Tue Jun 08, 2004 8:23 pm

Re: attacks finish when a unit kills another?

Post by carlinho »

awesome!
will try that tonight!
thanks!!!!!! :mrgreen:
http://carlinho7.tripod.com
Home of ANCIENT and CLASSICAL GREECE plugin on the works.
Image
Post Reply