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

[General] Use multiple models for one unit

Status
Not open for further replies.
Level 2
Joined
Jan 3, 2023
Messages
4
Hi all, I'm trying to use multiple models for human footmen (one with a spear, one with a sword, one with no shield, one with no helmet, etc...), but I want it to all be under the footman unit, so that when they spawn they choose randomly from the model pool but it's the same unit just a different model each time. Is this possible?
 
Level 30
Joined
Aug 29, 2012
Messages
1,382
That shouldn't be too hard, here is how I would do it:

  • Init
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set Footman_Unit[1] = Footman (No Helmet)
      • Set Footman_Unit[2] = Footman (No Shield)
      • Set Footman_Unit[3] = Footman (Spear)
      • Set Footman_Unit[4] = Footman (Sword)
  • Training
    • Events
      • Unit - A unit enters (Playable map area)
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Footman (Dummy)
    • Actions
      • Unit - Replace (Triggering unit) with a Footman_Unit[(Random integer number between 1 and 4)] using The old unit's life and mana

Footman (Dummy) would be a temporary unit with no model, it only serves in your barracks interface or whatever, and whenever in enters the map, it is instantly replaced by a random footman unit, that you have set up in the first trigger (with a unit-type variable with an array)
 
Status
Not open for further replies.
Top