• 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.

Revolver

Level 13
Joined
Oct 28, 2019
Messages
524
Hello, everybody! I'm working on some 1800s-themed unit edits, and I have an idea for an officer or mounted cavalry unit that uses a revolver.

Regarding the cooldown, is it possible to make the unit fire 6 shots with a 0.5-second cooldown between them, followed by a longer cooldown while the unit reloads the revolver?
 

Uncle

Warcraft Moderator
Level 73
Joined
Aug 10, 2018
Messages
7,933
You can track whenever a unit shoots (attacks), subtract their "ammo" Integer by 1, check if it reached 0, if true then disable their attack -> Wait X seconds -> and enable it again + reset "ammo" back to 6.

There's many ways of going about this and many possible outcomes. I would use a Unit Indexer for everything but you could also use a Hashtable.
 
Last edited:
Top