ItsMods

Full Version: Set angles on models and Rotate them
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello

Another tutorial, this one I think is usefull, is about rotating a model angle and setting a model angle

Lets put first the model with the one Ill explain this:

Code:
OMA = Spawn("script_model",(0,0,0));
OMA SetModel("weapon_oma_pack");

Now, well set the initial angles like this.

Code:
object.angles = (angles[0],angles[1],angles[2]);

Angle Info:

Lets go in our example:

Code:
OMA.angles = (0,90,0); // this will set the Pitch and Roll in 0 and the Yaw in 90 degrees

To rotate a model we can do it by many ways, this 3 are used to rotate the model in one certain angle(pitch,yaw,roll):

Code:
object RotatePitch(degrees,time in seconds);
object RotateYaw(degrees,time in seconds);
object RotateRoll(degrees,time in seconds);

But I recomend you using this other command, is far completer because it allows you to rotate the object in the 3 ways using a period of time.

Code:
object RotateTo((pitch,yaw,roll),time in seconds);

Lets go into our example and lets rotate the object to the angles (60,30,20) in 5 seconds:

Code:
OMA RotateTo((60,30,20),5);

Thats it, now you know how to modify a object angles perfectly
(09-20-2011, 15:31)Rendflex Wrote: [ -> ]OMG PLEASE;

http://www.zeroy.com/script/

Fuu My explanations are better
(09-20-2011, 15:32)Yamato Wrote: [ -> ]
(09-20-2011, 15:31)Rendflex Wrote: [ -> ]OMG PLEASE;

http://www.zeroy.com/script/

Fuu My explanations are better

As I said :p
[Image: 41a2c.png]
Can it be attached to player, e.g player walks with spinning OMA above his head ?
(09-20-2011, 15:38)OrangePL Wrote: [ -> ]Can it be attached to player, e.g player walks with spinning OMA above his head ?

If it's still a defined script_model, then yes.
(09-20-2011, 15:38)OrangePL Wrote: [ -> ]Can it be attached to player, e.g player walks with spinning OMA above his head ?

No, but you can make it follow the player head, Big Grin

Code:
while(1)
{
    head = self GetTagOrigin("j_head");
    OMA MoveTo(head,0.08);
    OMA RotateTo((RandomInt(360),RandomInt(360),RandomInt(360)),0.08);
    wait 0.08;
}
(09-20-2011, 15:42)Yamato Wrote: [ -> ]
(09-20-2011, 15:38)OrangePL Wrote: [ -> ]Can it be attached to player, e.g player walks with spinning OMA above his head ?

No, but you can make it follow the player head, Big Grin

Code:
while(1)
{
    head = self GetTagOrigin("j_head");
    OMA MoveTo(head,0.08);
    OMA RotateTo((RandomInt(360),RandomInt(360),RandomInt(360)),0.08);
    wait 0.08;
}

Why not use linkto?
(09-20-2011, 15:43)Rendflex Wrote: [ -> ]
(09-20-2011, 15:42)Yamato Wrote: [ -> ]
(09-20-2011, 15:38)OrangePL Wrote: [ -> ]Can it be attached to player, e.g player walks with spinning OMA above his head ?

No, but you can make it follow the player head, Big Grin

Code:
while(1)
{
    head = self GetTagOrigin("j_head");
    OMA MoveTo(head,0.08);
    OMA RotateTo((RandomInt(360),RandomInt(360),RandomInt(360)),0.08);
    wait 0.08;
}

Why not use linkto?

Is it posible to linkto to a player?? With attach function you wont be able to rotate the object
(09-20-2011, 15:44)Yamato Wrote: [ -> ]
(09-20-2011, 15:43)Rendflex Wrote: [ -> ]
(09-20-2011, 15:42)Yamato Wrote: [ -> ]
(09-20-2011, 15:38)OrangePL Wrote: [ -> ]Can it be attached to player, e.g player walks with spinning OMA above his head ?

No, but you can make it follow the player head, Big Grin

Code:
while(1)
{
    head = self GetTagOrigin("j_head");
    OMA MoveTo(head,0.08);
    OMA RotateTo((RandomInt(360),RandomInt(360),RandomInt(360)),0.08);
    wait 0.08;
}

Why not use linkto?

Is it posible to linkto to a player?? With attach function you wont be able to rotate the object

Oh, it dosen't work, my bad :p