• 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 command that changes facing

Status
Not open for further replies.
Level 14
Joined
Aug 30, 2004
Messages
909
I'm having some trouble with a trigger that manually changes a unit's facing. I'm wondering if converting it to JASS might help a bit. Does anyone know if there is a JASS command for doing something like this (math_2 is a real variable, u is a unit):

  • Unit - Make u face math_2 over 0.00 seconds
I want to try a few other fixes on the trigger before I post it here and beg for help (it's a bit complicated), but if anyone has a quick JASS command for me that would help. Please spell it out exactly as I don't know anything about JASS other than using the custom script action and typing exactly what you nice people put here on the forums.

Darwin
 
Level 18
Joined
Jan 21, 2006
Messages
2,552
In JASS, I believe the functions mainly use SetUnitFacingTimed.

Both natives SetUnitFacing and SetUnitFacingTimed function fairly similar. The turn-rate never seems to affect the amount of time it takes for a unit to rotate and face the specified angle.

If that's not enough information I'm sorry I didn't want to bore you with illegible talk about how Warcraft III works. Basically you're stuck with the crappy unit facing action. If you need it to determine the angle at which you should perform some mathematics (for spells or something in a map you're making) then I suggest you calculate your own real variable out to be the angle that you want based on unit positions, etc..
 
we can't help you if you don't tell us your problem

and as Berb said SetUnitFacing is not different from the GUI actions
JASS does not give you the ability to do everything (as some people think)

but since I am posting anyway I'll guess your problem:
You want to make some blademaster-like spell but SetUnitFacing is too slow for you
that's because warcraft 3 sucks but you can rotate the chest and head of a unit with "Animation - Lock unit body part facing to something" or however it was called
another way would be to use a dummy and order it to cyclone your unit which is supposed to spin so the spell target will be attached to a unit you specified in the cyclone spell buff (which could be a dummy model which has nothing but an attachment point which rotates)
the drawback of this method is that your unit will become invulnerable (probably you can turn that of) but you can't control it so you should also make a dummy unit to be selected which can take orders and stuff

now tell us your problem :)
 
Level 14
Joined
Aug 30, 2004
Messages
909
we can't help you if you don't tell us your problem

and as Berb said SetUnitFacing is not different from the GUI actions
JASS does not give you the ability to do everything (as some people think)

but since I am posting anyway I'll guess your problem:
You want to make some blademaster-like spell but SetUnitFacing is too slow for you
that's because warcraft 3 sucks but you can rotate the chest and head of a unit with "Animation - Lock unit body part facing to something" or however it was called
another way would be to use a dummy and order it to cyclone your unit which is supposed to spin so the spell target will be attached to a unit you specified in the cyclone spell buff (which could be a dummy model which has nothing but an attachment point which rotates)
the drawback of this method is that your unit will become invulnerable (probably you can turn that of) but you can't control it so you should also make a dummy unit to be selected which can take orders and stuff

now tell us your problem :)

Wise Gandalf, you probably don't remember but you've helped me on numerous occasions, so thanks in advance.

I thought my problem was related to how many computations I have the game running, but it turns out it was a different problem (the AI guard position wasn't turned off...)

Anyway, I have a movement system for my ships so they can fly with momentum. It works like this: when you right-click the editor stores that point as where you want to go. Every .03 seconds I then move your ship forward and turn it slightly toward the point you clicked. A while ago someone had me use the "SetUnitLocation" or some such custom script to move the unit rather than using the GUI "move unit" ability and it really cut down on the lag. I thought maybe something like that would help with the "make unit face Angle" action as well.

If there's no difference between the GUI action and the SetUnitFacing Jass command, then I might as well use what I have now.

Thanks again for the help though.
 
Status
Not open for further replies.
Top