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

"Replace Unit" Bug

Status
Not open for further replies.
Level 5
Joined
May 20, 2008
Messages
138
Hi
I have some triggers that replaces units using the Unit - Replace Unit action. However, sometimes this action is bugged and doesn't remove the old unit (that was replaced) properly. The replacement unit is created, but the old unit remains, seemingly invisible and untargetable, and keeps moving and attacking units from its invisibility.

I've searched around and I've found another thread on the same issue, but the auther never revealed how he fixed it.

Any ideas?
 
Level 33
Joined
Mar 27, 2008
Messages
8,035
Perhaps that unit is mistakenly being hide instead of replaced.

Because, Hidden Units via Unit - Hide Unit function will make that unit to be invisible for all players and you cannot reveal it by True Sight but that unit will still act as normal unit;
- When it acquires enemy unit, it will attack
- It is invulnerable in this state
- It is not picked when Unit Group - Pick Every Unit... function is used

If you don't want him to wander around while remain hidden, right after it is hidden, just add this ability to your hidden unit.
  • Custom script: call UnitAddAbility(udg_YourHiddenUnit, 'Abun')
The 'Abun' is ability Cargo Hold (Orc Burrow) which disable the unit to attack physically.
 
Level 5
Joined
May 20, 2008
Messages
138
Moin moin =)

Just remove the replaced unit after the replace to make sure, since I never saw that bug.

Greetings and Peace
Dr. Boom

Perhaps that unit is mistakenly being hide instead of replaced.

Because, Hidden Units via Unit - Hide Unit function will make that unit to be invisible for all players and you cannot reveal it by True Sight but that unit will still act as normal unit;
- When it acquires enemy unit, it will attack
- It is invulnerable in this state
- It is not picked when Unit Group - Pick Every Unit... function is used

If you don't want him to wander around while remain hidden, right after it is hidden, just add this ability to your hidden unit.
  • Custom script: call UnitAddAbility(udg_YourHiddenUnit, 'Abun')
The 'Abun' is ability Cargo Hold (Orc Burrow) which disable the unit to attack physically.

Thank you for your replies. I guess I have to do something like this then, the question is why the editor mistakenly hides replaced units instead of removing them sometimes :S
 
Level 5
Joined
May 20, 2008
Messages
138
It might be, nooooooo...... Anyways here is one of the "replace unit" triggers that sometimes is bugged this way. The strange thing is that I could do two playthroughs that are as good as identical, with the bug appearing in one of them and not in the other.

  • Warbringer dismount
    • Events
      • Game - GDD_Event becomes Equal to 0.00
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Warbringer (Mount and troll)
      • (Percentage life of (Triggering unit)) Less than or equal to 20.00
    • Actions
      • Unit - Remove (Trash) Warbringer rider effect from (Triggering unit)
      • Unit - Replace (Triggering unit) with a Warbringer (troll) using The old unit's life and mana
      • Unit - Set the custom value of (Last replaced unit) to (Custom value of (Triggering unit))
      • Set GEN_TEMP_POINT_1 = (Position of (Triggering unit))
      • Unit - Create 1 Bear Mount for Player 12 (Brown) at GEN_TEMP_POINT_1 facing (Facing of (Triggering unit)) degrees
      • Custom script: call RemoveLocation(udg_GEN_TEMP_POINT_1)
      • Unit Group - Add (Last created unit) to Warbringer_bearmounts
 
Status
Not open for further replies.
Top