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

My dummy just won't fly

Status
Not open for further replies.
Level 16
Joined
Aug 7, 2009
Messages
1,406
SOLVED

So, I'm working on a spell for the 6th hero contest and I just experienced something that I don't seem to be able to solve. I have this code:

JASS:
            loop
                set thistype.dummy[baseId+i]=CreateUnit(this.owner,DUMMY_UNIT,x,y,0.)
                set thistype.sfx[baseId+i]=AddSpecialEffectTarget(ORB_MODEL,thistype.dummy[baseId+i],"origin")
                call SetUnitScale(thistype.dummy[baseId+i],SFX_SCALE,SFX_SCALE,SFX_SCALE)
                call SetUnitAnimationByIndex(thistype.dummy[baseId+i],75)
                call UnitAddAbility(thistype.dummy[baseId+i],'Amrf')
                call UnitRemoveAbility(thistype.dummy[baseId+i],'Amrf')
                call SetUnitFlyHeight(thistype.dummy[baseId+i],BASE_HEIGHT,0.) //BASE_HEIGHT is a constant and is equal to 400.
                set x=x+OFFSET*cos 
                set y=y+OFFSET*sin
                set i=i-1
                exitwhen i==0
            endloop

That's supposed to make my dummy units fly. But they just won't. They're spawned directly on the ground, and two seconds later, when they should reach the ground, they just die.

Any ideas what I'm doing wrong? Any help is appreciated.
 
Last edited:
Level 33
Joined
Mar 27, 2008
Messages
8,035
Side Notes: Setting dummy's movement speed to >0 (or any unit) will make it unable to cast spells simultaneously even if you set the Art - Animation - Cast Backswing/Point: 0

Also, a dummy movement speed of 0 won't move the dummy unit (by visual) with the use of SetUnitX/Y.
The unit in fact, is being moved but you can't see the "model" of the unit is moving (visual issues).
 
Level 17
Joined
Apr 27, 2008
Messages
2,455
Wait, are you saying that this trick doesn't work for let's say the footman, as an example, since this unit type is not a flyer ?!
I'm quite sure it does work, at least from what i remember.

And anyway, even if it works only on a flyer unit, i suppose it's still useful to got rid of the max height value (sure it can be increased as necessary in the object editor)

Now, about dummies units there are many cases where you need to set the position by trigger actions, especially if the dummy is used as a visual effect.
 
Level 26
Joined
Aug 18, 2009
Messages
4,097
No, I said that the morph ability Amrf/Arav has a source and a target type. Last one is set to Medivh's crow form/talon crow form on default. If you set these unit types to ground walking, then the trick would not work.

Also, I cannot confirm that SetUnitFlyHeight would be capped by the Movement - Height (umvh) value in object editor.
 
Level 17
Joined
Apr 27, 2008
Messages
2,455
No, I said that the morph ability Amrf/Arav has a source and a target type. Last one is set to Medivh's crow form/talon crow form on default. If you set these unit types to ground walking, then the trick would not work.

I've never read you need to edit something for this ability.
The bug exploit should work for all units without any more stuff, or we should know it since a while.

Also, I cannot confirm that SetUnitFlyHeight would be capped by the Movement - Height (umvh) value in object editor.

It is IIRC, without the bug exploit ofc (but need to be tested again ...)
 
Level 26
Joined
Aug 18, 2009
Messages
4,097
I've never read you need to edit something for this ability.

You do not have to. The default values are okay. But if Luorax edited the ability/unit type, that might have been a possible source of error.

Since I have custom slk object data and do not use public functions/systems, I could identify some of the basic stuff how wc3 works.
 
Level 26
Joined
Aug 18, 2009
Messages
4,097
I used to nullify every value that I do not use/does not matter. A problem arising from that is that the map file stores all modifications of object editor fields, so the more fields are modified, the laggier is the initialization of this object. Of course, when copying an object, it only stores the original object's id and does not consider everything modified. So it probably does not make much of a difference whether you use standard or own objects.
 
Status
Not open for further replies.
Top