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

[JASS] Help with SetUnitX

Status
Not open for further replies.
Level 7
Joined
Feb 9, 2007
Messages
56
Hi all

Hm can anybody help me? I'm trying to use that function, to creat different things like a waterslide, or wind ect...
So I want that all units that enter a certain area are constantly moved to the right, but not interrupted in moving or channeling spells...
(I also tried to do it with other ways (bit more in jass) but never managed to get no error... and i also happened to delete those tries...(stupid me))


  • WaterslideDo Kopieren
    • Event
      • Zeit - Every 0.04 seconds of game time
    • Condition
    • Action
      • Unitgroupe - Pick every unit in SlideWater and do (Actions)
        • Schleifen - Aktionen
          • Set TempProjectile = (Picked unit)
          • Set tempPoint[0] = (Position of (Picked unit))
          • Set TempX = ((X of tempPoint[0]) + 15.00)
          • Custom script: call RemoveLocation(udg_tempPoint[0])
          • Custom script: call SetUnitX(udg_TempProjectile, udg_TempX)


If I try this, it says variablename expected (at the setunitx-function)
So does anybody know what's wrong with it, and how I could achieve my aim :)

Help would be really appreciated ;-D
 
Level 13
Joined
Nov 22, 2006
Messages
1,260
How I HATE german WEs :)

SetUnitX is followed by the SetUnitY, unless you know what you're doing.

SetUnitX + SetUnitY = move unit to a point (with slightly different characteristics then SetUnitPosition)

So what you want to do is move unit by 15 every 0.04 seconds? That's easy:

  • WaterslideDo Kopieren
  • Event
    • Zeit - Every 0.04 seconds of game time
  • Condition
  • Action
    • Set Angle = <direction in which you want the unit to move>
    • Unitgroupe - Pick every unit in SlideWater and do (Actions)
      • Schleifen - Aktionen
        • Set TempProjectile = (Picked unit)
        • Set tempPoint[0] = (Position of (Picked unit))
        • Set TempX = ((X of tempPoint[0]) + 15.00 * Cosine of Angle)
        • Set TempY = ((Y of tempPoint[0]) + 15.00 * Sine of Angle)
        • Custom script: call RemoveLocation(udg_tempPoint[0])
        • Custom script: call SetUnitX(udg_TempProjectile, udg_TempX)
        • Custom script: call SetUnitY(udg_TempProjectile, udg_TempY)

Something like that, I think..

EDIT: Pooty, you're dead :)
 
Level 7
Joined
Feb 9, 2007
Messages
56
Thanks for fast and competent reply :thumbs_up:
After I added SetUnitY, it worked perfectly :grin:

So my water slide works now:

Waterslide.jpg
 
Level 7
Joined
Feb 9, 2007
Messages
56
Why does every trigger thread end up with two of us hijacking it?? :p

I conquer it back :p
There are so many cool things you can do with setunitx/y :-D

Also suddenly appearing winds that push unwary units into deadly spikes :-D

Gorge.jpg


That's fun for all arenas! Especially if you can stun other heroes or push them away with spells, so they get killed by the spikes :)
 
Level 7
Joined
Feb 9, 2007
Messages
56
Yes! Except if you pay me 5$ ;-D
No, just use it.
I always think it's stupid if people say "blah you stole this from that map".
I actually hate it :p
Because many times I have a good idea and add it in a map and then somebody comes and says exactly that sentence... And then I say that I don't even know that map... (well actually I don't even know dota... :grin: I played it once when it was first released XX years ago... and there was hardly anything special in it)
 
Status
Not open for further replies.
Top