• 🏆 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!

Unit spining around his orbit?

Status
Not open for further replies.
Level 10
Joined
Jul 16, 2012
Messages
410
Sorry for this but i posted the same question at the wrong place (Warcraft Town Hall,yeah im an idiot dont kill me >.<)

Since im moving tovards realising my project of making a cinematic i would like to implement some uniquness in its action.Now i had an idea for a scene but im missing a key to realising my idea.
Now as you can see in the tittle im asking a very very simple question(althouth i dont know if the answer is just as simple)
Is it possible to make UNIT spin around his ORBIT?
Are there such triggers that i am not aware of?
Please if you could help me please do,and dont tell me about the Object Editor couse i know i can make him in - of angle and such.
Im asking by triggers,if someone knows could you post them on this thread.

Im off to suicide soon :)
 
Level 5
Joined
Feb 17, 2011
Messages
95
Did you mean unit spinning around another unit/point? If so, make a periodic trigger to increase (anticlockwise) or decrease (clockwise) angle (a), and use this:

X = Xc + d * cos(a)
Y = Yc + d * sin(a)

where X and Y are final position coordinates, Xc and Yc are position of center of rotation and d is orbiting distance.
JASS:
call SetUnitX(unit, X)
call SetUnitY(unit, Y)

If you need more than one unit to orbit look at this spell of mine, there's an explanation under kinematics tab for n units.
 
Level 10
Joined
Jul 16, 2012
Messages
410
Ok im gonna try make this easy-er to explain
220017-albums5718-picture94703.png

As you can see i have a skull on my gate it is actually a peasant before the gate should be opened i want to make him spin to add some + to the enviroment.is that possible and please explain me what should i do in the triggers cuz i didint understand x=xc o_O i suck at math btw
 
Level 12
Joined
May 20, 2009
Messages
822
dont double post, edit your poste instead

I consider posting a useless comment that doesn't help the person and you also do nothing else with that comment is worse then a double post. Personally I think that should also be against the rules but that's just me. If you want to tell them don't double post, you should do it in a PM or some other way that doesn't put another useless comment in the thread...

Anyway, Baja didn't do the best job of explaining it. You need to make two Real Variables and name one X and one Y. Then you do the math he said in a "Set Variable" action, and then finally you use the "Set Unit X/Y Position" action.

To do that math, you do something like...

Set Variable Action...
Set Variable X = ...
Arithmetic...
X of Point (This point is going to be the center of where you want to rotate it on) * Cos(a)

Though I have no idea what "a" is suppose to be in there...

Then the same thing for Variable Y. I don't know if you're turning it with the gate or just spinning it. If you're doing the former, you'll also need to change it's facing. =P

Also, to delete a comment you go Edit->Go Advanced->Check the "Delete Message" box and then just below those boxes there's a "Delete This Message" button.

Also, can you put that image in a HIDDEN tag? Simply, [ HIDDEN=(Whatever you want your Hidden title to be](What you're trying to hide)[/HIDDEN]
 
Level 3
Joined
Sep 9, 2009
Messages
658
I consider posting a useless comment that doesn't help the person and you also do nothing else with that comment is worse then a double post. Personally I think that should also be against the rules but that's just me. If you want to tell them don't double post, you should do it in a PM or some other way that doesn't put another useless comment in the thread...

I think they do it intentionally to annoy people.

If I understand you correctly, you just want to make it spin right? As in it just stays in the same place and spins?

If that is what you want, you could probably do it like SetUnitFacing(Skull, GetUnitFacing(Skull) + 1)

You might have to modify it's turn rate in the object editor to if you want it to rotate faster.

Edit: I've uploaded a test map. Just start it up and you can see the peasant spinning.
 

Attachments

  • SpinSpinSpin.w3m
    16 KB · Views: 59
i got brain canser god..didint expect i must use math for this bull****

Thats because dudes above don't know about polar coordinates. It's point with polar offset (you can find in gui), offset is a distance from the center (the sun), while you slowly increase the angle, just don't forget to reset 360 to 0, so you don't get astronomical numbers which would quickly overflow and crash the map.

Now I saw you only need spinning, thats easy, just don't forget to reset the angle
 
Level 10
Joined
Jul 16, 2012
Messages
410
yes rotate around his "axis" i want to make it as if it would look the gate is beeing "activated or opened" ill check the test map hopefully i can make it work ^^

EDIT:this would definetly work but Sniper Zero i want to make him spin like a clock imagine a peasant and hes just standing and add a spin like a normal clock spins understand me,what im aiming at?
If you do could you please make a testmap with that spin :)
 
Level 10
Joined
Jul 16, 2012
Messages
410
you do know how the clock works the little "thing"(sorry cant remember how its called)spins around the clock and telling you what is the time,so the peasant is the clock and his spinning like the clocks thing you get what im aiming at? im an idiot ik
http://www.animatedimages.org/data/media/137/animated-clock-image-0003.gif
So look its a clock and the little thing is spining around the clock thats how i wanna make my peasant spin if you understand me now?
EDIT:Yess and go all the way beneth the ground and back and so onn ugh such a rough way to explain somethin
you got it now :)
 
Level 10
Joined
Jul 16, 2012
Messages
410
Yeah thats what i need :/ but the problem is that the peasant isnt going to keep its model in my map,the skull seal is actually peasant i changed the peasants model,the idea was well i thouth that unit could be forced by a trigger to spin like that and that a doodat cant so i changed peasants model to the skull seal,you can see in the image i posted :/
 
Level 10
Joined
Jul 16, 2012
Messages
410
Mechanical i used a clock as an exsample of what kind rotation i need not like a day or a year,just imagine a clock and how it works and you will understand.
I just want a function that makes peasant(or any other unit) touch his head to the ground,goes all the way beneth the ground and comes back and i need it in a loop
 
Use a 360 degree dummy model with 180 animations that changes by 2 per animation. Use custom script to access it then use an integer variable and a timer then just keep running it adding +1 calling the next animation to turn it. That's the only way to do it looking good, its easier then it sounds. Attach the skull seal model to the dummy model as well, you can use triggers or unit ability for that easily enough.
 
Status
Not open for further replies.
Top