• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Squad System: Sprint Ability Problem (testmap attached)

Status
Not open for further replies.
Level 9
Joined
Apr 27, 2012
Messages
228
Hi all,
[find a testmap below]


this is the system I use:

units move in squads. A squad leader receives orders from the player, and the other units in the squad follow.


I want a squad to have a sprint ability. It is based on the ''berserk'' ability. When a single unit is moving while using a berserk-based ability, it will not stop.
The squad, being ordered to use the ability VIA TRIGGER, will, however, stop, so that it needs to be ordered to move again.
That is the problem!


Look at the triggers in the testmap. Hopefully someone can help :)
 

Attachments

  • SquadTest.w3x
    18.3 KB · Views: 54
Level 9
Joined
Apr 27, 2012
Messages
228
then order he units when they reach the destination to get a new order to move the same distance in the same direction.

but... they stop moving when they use the ability. So they never reach the destination.

or when they get order to move, order them to stop and then order then to go to a point with offset 9999999 in this direction.

but they shouldn't move infinitely. They're supposed to move to the exact spot that they were told to move to (before the ability is used while on the move)


Look at the testmap if you want to have a better understanding of what I want to do.
 
Level 9
Joined
Apr 27, 2012
Messages
228
so you want to stop them with the same ability? then use boolean true/false :D

what? No. Where did you read this?

You can look at the squad system in the testmap. Units move in squads. Each unit in the squad has a ''Sprint'' ability. When the Squad is currently moving and you order it to use the ability, they will stop. I don't want them to stop, they should simply become faster due to the ability and continue moving
 
Level 22
Joined
Sep 24, 2005
Messages
4,821
The base ability "berserk" seems to interrupt current orders, try using something that doesn't.
 
Level 21
Joined
Mar 27, 2012
Messages
3,232
Berserk as an ability doesn't interrupt orders.

This is a bug that I encountered when making Group Control. My system essentially does the same thing as yours.
I never bothered to fix this issue, but I know how.

Keep track of all orders that units are issued.
Check in this order:
If target widget is null(if not, save it and you're done)
If target point is null(A coordinate is 0)
If both of those are false, then it was an untargeted order.

Then when berserk is ordered you order each unit in the group to do whatever their last order before it was.
Since berserk is instant you can even issue the previous order again immediately.
 
Level 22
Joined
Sep 24, 2005
Messages
4,821
^ That still wouldn't work, since casting the dummy spell itself will override the current orders on the unit(s). A good solution would be an order queue or even just a last order cache for squad enabled units.
 
Level 22
Joined
Sep 24, 2005
Messages
4,821
Still won't work, since the squad leader will still cast a dummy spell to fire the actual spell, which will make the squad members cast the spell too, which will override their current orders.
 
Level 22
Joined
Sep 24, 2005
Messages
4,821
Then that would break the squad formation, as the leader's current order will be overridden whilst the members will continue with the former order of their leader. The problem is how you will trigger the spell (telling the dummy caster to cast) without disrupting current orders.
 
Level 22
Joined
Sep 24, 2005
Messages
4,821
I know, the question is how do you make the dummy caster cast in-game? Usually you use a dummy spell on a hero to trigger a cast request, but in this case you can't. So how?
 
Status
Not open for further replies.
Top