[Spell] Dummy Caster do's and don'ts?

Level 3
Joined
Nov 17, 2024
Messages
32
I'm working on an rpg style map, and I am going to be using pseudo-scripted fights in some places. For instance:
  • Fight 1 setup
    • Events
      • Unit - A unit enters Fight 1 start <gen>
    • Conditions
    • Actions
      • Destructible - Close Demonic Gate (Horizontal) 0000 <gen>
      • Wait 1.00 seconds
      • Floating Text - Create floating text that reads What the... Who are... above Naga Champion 0000 <gen> with Z offset 0.00, using font size 10.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
      • Floating Text - Change (Last created floating text): Disable permanence
      • Floating Text - Change the lifespan of (Last created floating text) to 1.50 seconds
      • Unit - Create 1 Dummy Caster for Player 14 (Navy) at (Position of Naga Champion 0000 <gen>) facing Default building facing degrees
      • Unit Group - Add (Last created unit) to DCasters
      • Unit Group - Pick every unit in DCasters and do (Actions)
        • Loop - Actions
          • Unit - Add Thunder Clap to (Picked unit)
      • Unit - Order Naga Champion 0000 <gen> to Attack (Random unit from PlayerHero)
      • Trigger - Turn on Fight 1 Abilities <gen>
      • Trigger - Turn on Fight 1 End <gen>
      • Trigger - Turn off (This trigger)
------------
and then:
------------
  • Fight 1 Abilities
    • Events
      • Time - Every 6.50 seconds of game time
    • Conditions
      • (Naga Champion 0000 <gen> is alive) Equal to True
    • Actions
      • Wait 1.00 seconds
      • Floating Text - Create floating text that reads Get Smashed! above Naga Champion 0000 <gen> with Z offset 0.00, using font size 10.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
      • Floating Text - Change (Last created floating text): Disable permanence
      • Floating Text - Change the lifespan of (Last created floating text) to 1.00 seconds
      • Unit - Order Naga Champion 0000 <gen> to Hold Position.
      • Wait 0.25 seconds
      • Unit Group - Pick every unit in DCasters and do (Actions)
        • Loop - Actions
          • Unit - Move (Picked unit) instantly to (Position of Naga Champion 0000 <gen>)
          • Unit - Order (Picked unit) to Human Mountain King - Thunder Clap.
      • Wait 0.25 seconds
      • Unit - Order Naga Champion 0000 <gen> to Attack (Random unit from PlayerHero)
I feel like this way of creating and picking casters is less than ideal. Hypothetically I decide to make this multiplayer (which is likely), I would end up with more than one dummy caster in DCasters and more than one hero in PlayerHero. Am I supposed to create an array or something instead of Unit Group? If so, what is the purpose of unit groups?

Also, how can I interrupt this trigger upon Naga Champions death? Sometimes, if he dies the ability still goes off after. I'm assuming the trigger has started and he dies somewhere in the wait timer, so the clap still goes off.
 
Last edited:
Level 29
Joined
Aug 29, 2012
Messages
1,322
A common practice is usually to give them a very short expiration timer after creation so that they just do their job and get removed from the map right after, so you don't have to keep track of them

As for the second question, I think you could use a if/then/else after the 1st wait, and in there add your condition that checks whether he's alive, and if true, then the rest of your trigger
 
Top