[INC] Smooth Object Rotating -
[nl]daplayer - 02.05.2009
Smooth Object Rotating
What does it do?
With this include you can ROTATE objects slowly.
It's so easy to understand so there are no pics or vids included.
Functions
pawn Код:
native RotateObject(Objectid, Float:RotX, Float:RotY, Float:RotZ, Float:Speed=2.0);
Callbacks
pawn Код:
public OnObjectRotated(objectid)
Editable things
You can change the time to wait to update again.
Default is 10 miliseconds.
Just define SRO_UPDATE_TIME to the value you want.
this example changes the update time to 5 miliseconds:
pawn Код:
#include <a_samp>
#include <SRO>
#define SRO_UPDATE_TIME 5
Don't set it to low because, it's takes more memory if the update time is low.
Update history- V1.0: First public release
License
Dutch License:
SRO van NoZer0 is in licentie gegeven volgens een
Creative Commons Naamsvermelding-Geen Afgeleide werken 3.0 Nederland licentie.
Gebaseerd op een werk op
www.mediafire.com en
nozer0.pastebin.com.
English License:
SRO by NoZer0 is licensed under a
Creative Commons Attribution-No Derivative Works 3.0 Unported License.
Based on a work at
www.mediafire.com and
nozer0.pastebin.com.
Download
http://www.mediafire.com/?imjznygyz3g
http://nozer0.pastebin.com/f7e7141c7
How to install
Download SRO.inc from mediafire and put it in the "server">"pawno">"include" folder.
Put this above in your gamemode
And you're done, Now you can use all the functions in your gamemode
Bugs
When rotating, players get a higher ping, don't know how to fix this.
Others- Please post your comments about this. I want to improve what i got now.
- Sorry for my bad english, i am dutch
Re: [INC] Smooth Object Rotating -
SpiderPork - 02.05.2009
I was just in progress in making that
.
Good job anyways.
Re: [INC] Smooth Object Rotating -
[nl]daplayer - 02.05.2009
Quote:
Originally Posted by SpiderPork
I was just in progress in making that .
Good job anyways.
|
lol, thx, i created it in 20 minutes or somthing like that.
Re: [INC] Smooth Object Rotating -
miokie - 02.05.2009
Good job, This will be quite useful.
Re: [INC] Smooth Object Rotating -
rensfromrpas - 04.05.2009
Very Usefull
Re: [INC] Smooth Object Rotating -
pspleo - 04.05.2009
Nice! Time for rotating doors.
Leopard
Re: [INC] Smooth Object Rotating -
Weirdosport - 04.05.2009
Pastebin dead
Re: [INC] Smooth Object Rotating -
[nl]daplayer - 04.05.2009
Quote:
Originally Posted by Weirdosport
Pastebin dead
|
Fixed:
http://nozer0.pastebin.com/f7e7141c7
Updated first post
Re: [INC] Smooth Object Rotating -
Weirdosport - 04.05.2009
It looks like it will finish each rotation at different times.. Asif it might start rotating in all 3 axes, then down to 2, then 1 until it's moved from start -> finish. This might appear bit jerky if you're dealing with an object with poor rotational symmetry (eg. not a sphere).
It might also go the long way around when trying to reach a point. If you wanted to get from 350° to 340° it might go round the long way as opposed to moving 10 degrees. - Ignore that
Re: [INC] Smooth Object Rotating -
[NM]XBOX_360 - 04.05.2009
nice
Re: [INC] Smooth Object Rotating -
[nl]daplayer - 04.05.2009
Quote:
Originally Posted by Weirdosport
It looks like it will finish each rotation at different times.. Asif it might start rotating in all 3 axes, then down to 2, then 1 until it's moved from start -> finish. This might appear bit jerky if you're dealing with an object with poor rotational symmetry (eg. not a sphere).
It might also go the long way around when trying to reach a point. If you wanted to get from 350° to 340° it might go round the long way as opposed to moving 10 degrees. - Ignore that
|
It will rotate all axes at the same time.
Re: [INC] Smooth Object Rotating -
Weirdosport - 04.05.2009
To start with, but if you want one to rotate 180 degrees and 1 of them 90 degrees, once the 90 is done it will change the direction of rotation.
Re: [INC] Smooth Object Rotating -
[nl]daplayer - 04.05.2009
Quote:
Originally Posted by Weirdosport
To start with, but if you want one to rotate 180 degrees and 1 of them 90 degrees, once the 90 is done it will change the direction of rotation.
|
I know, so you mean you want a diffrent speed for the one of 90 degrees?
Re: [INC] Smooth Object Rotating -
Weirdosport - 04.05.2009
Would look better if all the rotations finished at the same time
Re: [INC] Smooth Object Rotating -
NeRoSiS - 21.06.2009
SWEET!
Just what I needed, thanks a lot.
Re: [INC] Smooth Object Rotating -
G_ROW_Chez - 22.06.2009
actually, using tick counts and timer don't will show the best result
timers are "eating" server resourses
GetTickCount()-oldvalue can return 0, because of small load of server
sorry for bad english
In my opinion - fail
Re: [INC] Smooth Object Rotating -
Patrik356b - 18.07.2009
I had a working test script but went gone
Anyway I found an old copy of it which isn't working :
pawn Код:
#include <a_samp>
#include <SRO>
new exist, obj, x, y, z;
public OnFilterScriptInit()
{
print("\n--------------------------------------");
print(" Soft Object Rotation, Test");
print("--------------------------------------\n");
exist = 0;
return 1;
}
public OnFilterScriptExit()
{
exist = 0;
return 1;
}
public OnObjectRotated(objectid)
{
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
if(strcmp("/make", cmdtext, true, 5) == 0)
{
if(exist == 0){
GetPlayerPos(playerid, x, y, z);
obj = CreateObject(987,x-2,y+2,z+3,0,0,0);
exist = 1;
}else{
SendClientMessage(playerid, 0xFF4411FF, "You must delete the test thing to create a new one!");
}
return 1;
}
if(strcmp("/del", cmdtext, true, 4) == 0)
{
if(exist == 1){
DestroyObject(obj);
exist = 0;
}else{
SendClientMessage(playerid, 0xFF4411FF, "There is nothing to delete!");
}
return 1;
}
if(strcmp("/rotx", cmdtext, true, 5) == 0)
{
if(exist == 1){
RotateObject(obj, 20, 0, 0, 2.0);
}else{
SendClientMessage(playerid, 0xFF4411FF, "There is nothing to rotate!");
}
return 1;
}
return 0;
}
Re: [INC] Smooth Object Rotating -
wups - 05.09.2010
How can i rotate CCW? I tried negative values, and negative speed, but nothing works.
Re: [INC] Smooth Object Rotating -
Crayder - 28.10.2013
This tends to shake the object after the first roation... SO, if someone made a new version, I'd be truly thankful.