• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

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,243
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