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

2 spawns instead of 1?

Status
Not open for further replies.
Level 12
Joined
May 9, 2009
Messages
735
I am having this really weird issue where I have 2 units spawning instead of 1 for one particular trigger. I have very many triggers and I suspect there may be some sort of side effect of one of them but before I search through all of them I want to ask if anyone has ever encountered this before.

The trigger makes it so every time a unit casts a spell (based of roar) it is replaced with a unit. However, using the 'replace' action for some reason replaces it with 2 units. No matter which unit I replace it with it still gives two. When I used 'remove unit' and 'create new unit' actions instead the same problem occurs. When I alter the value of units created it doubles it; when I say 'create 3 units' in-game it creates 6.

I have a similar trigger which explodes the unit and creates a new one and it works fine. I have many other triggers which create units and they work fine creating the amount of units they are supposed to create. For now I have not the slightest idea why this is happening. Any help will be greatly appreciated.
 
Level 24
Joined
Aug 1, 2013
Messages
4,658
Maybe roar is hardcoded to replace a unit.
If you also replace that unit via triggers it might be double replaced at the same time.
However this cannot be achieved by regular triggers so I doubt that that is happening.
Anyway replacing a unit is not very good.
You will lose all references to that unit and all stuff added to the original unit is also removed.
 
Level 12
Joined
May 9, 2009
Messages
735
The thing is I have a similar trigger which explodes the unit and creates a new one in its place when it casts roar and it works fine so the roar ability is not to blame...

The trigger looks like this at the moment:
  • Stalwart Militia
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
      • (Ability being cast) Equal to Stalwart Militia
    • Actions
      • Set AAAIntegerMilitiaHP = (Life of (Casting unit))
      • Set AAAUnitMilitia = (Casting unit)
      • Set AAAPositionMilitia = (Position of AAAUnitMilitia)
      • Unit - Remove AAAUnitMilitia from the game
      • Unit - Create 1 Flesh Golem for (Owner of (Casting unit)) at AAAPositionMilitia facing Default building facing degrees
      • Set AAAUnitMilitiaSpawn = (Last created unit)
      • Unit - Set life of AAAUnitMilitiaSpawn to AAAIntegerMilitiaHP
      • Custom script: call RemoveLocation(udg_AAAPositionMilitia)
 
Level 3
Joined
Nov 22, 2014
Messages
50
Not sure if it´s related to it, but what happens when you change the condition to ´starts the effect of an ability?'
 
Status
Not open for further replies.
Top