• 🏆 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!

The Tank Problem

Status
Not open for further replies.
Level 11
Joined
Aug 24, 2009
Messages
706
I have a double barreled tank model which fire its two barrels independently.
I want it so every attack alternates the animation to play so it looks like it firing the other barrel with every attack.
How is this possible to do?
 
Level 37
Joined
Mar 6, 2006
Messages
9,240
Event - A unit is attacked
Condition - Unit type or something that filters out unwanted units
Actions
Start a timer with 0.00 expiration time if the timer is not started yet
Add attacking unit into a group

Event - timer expires
Actions
Pick every unit in group
--set anim = Custom value of picked unit
--if index[anim] == x then
----set index[anim] = y
--else
----set index[anim] = x
--endif
--Custom script : SetUnitAnimationByIndex(unit, anim)
--Remove unit from group
endloop

Use a unit indexer by Bribe (spell database) so the custom values work correctly.
 
Level 11
Joined
Aug 24, 2009
Messages
706
I couldn't get the indexer working since I never used it before so i tried to do the trigger with custom values and animation tags but it screwed up the animations themselves.

Maker can you please post a test map for this system?
 
Status
Not open for further replies.
Top