• 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 Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!
  • ✅ The POLL for Hive's Texturing Contest #34 is OPEN! Vote for the TOP 3 SKINS! 🔗Click here to cast your vote!
  • ✅ The POLL for Hive's Techtree Contest #20 is OPEN! Vote for the TOP 3 FACTIONS! 🔗Click here to cast your vote!

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?
 
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.
 
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.
Back
Top