• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

[Spell] Mirror Image - Bug

Status
Not open for further replies.
Level 11
Joined
Sep 11, 2013
Messages
327
Greetings folks!
I was trying to play my map and i found this bug with Mirror Image spell which destroyed the entire experience of gameplay...
Second 20..
The hero himself teleported there.. wtf
It is somehow possible to fix this annoying bug?
I was able to reproduce this bug over and over again in tests. As long as there is a dead tree and is space to spawn a hero or an illusion of a hero, the bug will appear.
As you can see in the video, there is space in the water behind to spawn the illusions, but apparently, the spell doesn't want to go like that.
The help will be appreciated!!!:peasant-bowing::peasant-bowing::peasant-bowing:
 
Level 11
Joined
Sep 11, 2013
Messages
327
Hi did you use any trigger for this skill or is just the basic version? If you made a trigger then you will need to post that trigger here so we can see what is the problem.
No, there is no trigger

I attach a test sample

Edit: Lordul Dracula said: the space is not enough for the skill.

The space is enough, but for some reason, the illusion or the hero don't want to spawn in the water.
 

Attachments

  • Mirror Image - BUG.w3m
    15.9 KB · Views: 9
Last edited:
No, there is no trigger

I attach a test sample
i don't have ref but i think i know what is this "bug". If you use this skill in a big space the skill will work fine? If yes then the reason why you hero will teleport when you use that skill on that small cliff is because the space is not enough for the skill.
 
Level 18
Joined
Oct 17, 2012
Messages
822
Move the hero back to its original location after casting the ability if the hero is too far from it. Let's say a threshold of 300 units for the distance.

This, however, is not an absolute solution because the hero can still get stuck, depending on map terrain and distance threshold. The only surefire way to prevent this bug is that you going have to put pathing blockers or fill up that space with trees or other destructables. And be sure to tighten up the spacing between trees.

You can also play around with collision sizes of the units.
 
Last edited:
Level 11
Joined
Sep 11, 2013
Messages
327
Move the hero back to its original location after casting the ability if the hero is too far from it. Let's say a threshold of 300 units for the distance.

This, however, is not an absolute solution because the hero can still get stuck, depending on map terrain and distance threshold. The only surefire way to prevent this bug is that you going have to put pathing blockers or fill up that space with trees or other destructables. And be sure to tighten up the spacing between trees.

You can also play around with collision sizes of the units.
I don't know how to do such a trigger.. Also, the bug can place the (hero) or the (illusion) in that random spot, so i need to solve even for illusions..
I put pathing blockers and do not work at all.. I can't fill that place with anything but trees, and the hero can destroy trees even from outside with spells, so this is not a solution.. the collision size must be 32 because if is less, the hero can go through two relative close trees and i don't want that..

I still don't understand why the (hero) or the (illusions) don't spawn in the water behind because they have enough space..
 
Level 39
Joined
Feb 27, 2007
Messages
5,036
  • Events
    • Unit - A unit starts the effect of an ability
  • Conditions
    • (Ability being cast) equal to ILLUSION
    • -------- could have multiple conditions if there are multiple spells like this in your map --------
  • Actions
    • -------- make a point variable called IllusionPoint in the variable editor --------
    • Custom script: local location udg_IllusionPoint = GetUnitLoc(GetTriggerUnit()) //this line must be the first line of the Actions; it creates a 'fake' local version of a regular GUI variable so we can be lazy and use a wait event without worrying about the variable being overwritten
    • Wait 0.50 seconds //this needs to be long enough that the spell finishes casting during this time; you'll have to determine how long
    • Unit - Move (Triggering Unit) instantly to IllusionPoint facing (Current facing of (Triggering Unit)) degrees
    • Custom script: call RemoveLocation(udg_IllusionPoint)
    • Custom script: set udg_IllusionPoint = null
If that doesn't put it in the right spot you can forcibly ignore pathing by doing this instead of the Unit - Move:
  • Custom script: call SetUnitX(GetTriggerUnit(), GetLocationX(udg_IllusionPoint))
  • Custom script: call SetUnitY(GetTriggerUnit(), GetLocationY(udg_IllusionPoint))
If it's moving the unit too late then you could change the event to "begins casting" but that's a little dicey.

Another dumb but workable solution would be to give the hero a useless dummy ability instead and then manually spawn the illusions yourself whenever that dummy ability is cast. I believe you can use a wand of illusion's ability to make illusions of an arbitrary target unit.
 
Level 11
Joined
Sep 11, 2013
Messages
327
  • Events
    • Unit - A unit starts the effect of an ability
  • Conditions
    • (Ability being cast) equal to ILLUSION
    • -------- could have multiple conditions if there are multiple spells like this in your map --------
  • Actions
    • -------- make a point variable called IllusionPoint in the variable editor --------
    • Custom script: local location udg_IllusionPoint = GetUnitLoc(GetTriggerUnit()) //this line must be the first line of the Actions; it creates a 'fake' local version of a regular GUI variable so we can be lazy and use a wait event without worrying about the variable being overwritten
    • Wait 0.50 seconds //this needs to be long enough that the spell finishes casting during this time; you'll have to determine how long
    • Unit - Move (Triggering Unit) instantly to IllusionPoint facing (Current facing of (Triggering Unit)) degrees
    • Custom script: call RemoveLocation(udg_IllusionPoint)
    • Custom script: set udg_IllusionPoint = null
If that doesn't put it in the right spot you can forcibly ignore pathing by doing this instead of the Unit - Move:
  • Custom script: call SetUnitX(GetTriggerUnit(), GetLocationX(udg_IllusionPoint))
  • Custom script: call SetUnitY(GetTriggerUnit(), GetLocationY(udg_IllusionPoint))
If it's moving the unit too late then you could change the event to "begins casting" but that's a little dicey.

Another dumb but workable solution would be to give the hero a useless dummy ability instead and then manually spawn the illusions yourself whenever that dummy ability is cast. I believe you can use a wand of illusion's ability to make illusions of an arbitrary target unit.
I copied your trigger and i saw that will work only with the second solution::peasant-thumbs-up:
  • page.gif
    Custom script: call SetUnitX(GetTriggerUnit(), GetLocationX(udg_IllusionPoint))
  • page.gif
    Custom script: call SetUnitY(GetTriggerUnit(), GetLocationY(udg_IllusionPoint))

Well, indeed is helpful, but few problem still remain and i don't know how to fix them and i wonder if there is any left solutions :?
1. How can i do the same thing with illusions of the spell, because the same bug will happen even with illusions and is really annoying for enemy to have a big illusion right in the middle of the base which can pass the armor wall with this bug..
2.(at least if an illusion appears in more than ~175 range away from the initial position of hero, the illusion must be killed or something like that)

Is there any solution to make the collision size of the hero and for his illusions 0 when "begins casting the mirror image" and then back to normal after spawn (32)?
 

Wrda

Spell Reviewer
Level 26
Joined
Nov 18, 2012
Messages
1,898
This...isn't even a bug in the first place. It's a feature that has been explored countless times in map like Sheep Tag. Mirror Image creates illusions and attempts to move them or the main hero itself with an offset to the original location, when done perpendicular, paralel to some areas and cliffs, the offset is a lot and it gives a perception of an illusion or the hero to have been moved to another irrelevant area. Same happens when you build structures in Sheep Tag as the sheep, and you hop to the other side of the cliff.
 
Level 39
Joined
Feb 27, 2007
Messages
5,036
Well, indeed is helpful, but few problem still remain and i don't know how to fix them and i wonder if there is any left solutions :?
1. How can i do the same thing with illusions of the spell, because the same bug will happen even with illusions and is really annoying for enemy to have a big illusion right in the middle of the base which can pass the armor wall with this bug..
2.(at least if an illusion appears in more than ~175 range away from the initial position of hero, the illusion must be killed or something like that)
If you still wish to find a solution for this, you could do it by making the point variable accessible to a trigger with the event Unit - A unit enters (Playable map area) which should trigger when Illusions are spawned. This would either be building a global parallel array or attaching the point data to the caster via a hashtable. Not a huge amount of work but not trivial, either. Then you just do SetUnitX/Y on all the illusions onto the same location as the caster.
 
Level 11
Joined
Sep 11, 2013
Messages
327
If you still wish to find a solution for this, you could do it by making the point variable accessible to a trigger with the event Unit - A unit enters (Playable map area) which should trigger when Illusions are spawned. This would either be building a global parallel array or attaching the point data to the caster via a hashtable. Not a huge amount of work but not trivial, either. Then you just do SetUnitX/Y on all the illusions onto the same location as the caster.
Thanks for help, but, indeed(i don't need a solution anymore)..
Right now i will just pretend that is a feature of the spell because now i know how work.
I talked to few people and i understand that they know already this feature and is not a problem.
 
Status
Not open for further replies.
Top