MoveObject set wrong rotation.
#1

Solved, Every attempt to help is appreciated.
Reply
#2

Use :
Код:
SetObjectPos(objectid, Float:X, Float:Y, Float:Z)
and
Код:
SetObjectRot(objectid, Float:RotX, Float:RotY, Float:RotZ)
Object Rotation won't change in MoveObject() if positions "fX, fY, fZ" same as last position.
Reply
#3

new bool:lastmove[MAX_OBJECTS];
I'm on my tablet so I'm not going to dig for my actual fix, but here is a slight psuedo of what it's like. If someone could add the actual shit for this guy that'd be greatly appreciated by him (I suppose).
pawn Код:
MoveObject_Fix(...)
{
    if(lastmove[objectid])
        fZ += 0.00001;
    else
        fZ -= 0.00001;
   
    lastmove[objectid] = !lastmove[objectid];
    return MoveObject(...);
}

//ALS hook here (MoveObject = MoveObject_Fix)
Basically this will alternate between up and down movements that are hardly noticeable so the object will actually rotate when there is no movement applied.
Reply
#4

I apologize for not describing the problem well, if you try it it'll:
work for the first time, then if you click on save, and try to move it anywhere again it'll move the object to a totally different place (close to the actual one) with another rotation.., (object used: 19313)

I'll try to hook it as you did and see what happens though.
Reply
#5

Quote:
Originally Posted by xVIP3Rx
Посмотреть сообщение
I apologize for not describing the problem well, if you try it it'll:
work for the first time, then if you click on save, and try to move it anywhere again it'll move the object to a totally different place (close to the actual one) with another rotation.., (object used: 19313)

I'll try to hook it as you did and see what happens though.
Also, MoveObject will never be smooth in OnPlayerEdit*. Though, if you insist on using movements, you should definitely StopObject if IsObjectMoving.
Reply
#6

Solved.
Reply
#7

Solved, got a different question now, what should be returned on "OnObjectMoved" and "OnPlayerEditObject"
also does bool = !bool, just flip the values or something else ?
Reply
#8

Quote:
Originally Posted by xVIP3Rx
Посмотреть сообщение
Solved, got a different question now, what should be returned on "OnObjectMoved" and "OnPlayerEditObject"
also does bool = !bool, just flip the values or something else ?
I don't think either return value matters in those two functions. OnPlayerEdit* doesn't require a return value at all, I don't recall anything specific about OnObjectMoved's return value.

Yes, `bool = !bool;` does inverse the value.

ALSO, NEVER REMOVE YOUR POSTS WHEN YOUR PROBLEM WAS SOLVED! What if other people came here to fix their problem? They wouldn't be able to rely on your thread because you deleted everything important and didn't share your solution.
Reply
#9

Quote:
Originally Posted by Crayder
Посмотреть сообщение
I don't think either return value matters in those two functions. OnPlayerEdit* doesn't require a return value at all, I don't recall anything specific about OnObjectMoved's return value.

Yes, `bool = !bool;` does inverse the value.

ALSO, NEVER REMOVE YOUR POSTS WHEN YOUR PROBLEM WAS SOLVED! What if other people came here to fix their problem? They wouldn't be able to rely on your thread because you deleted everything important and didn't share your solution.
Thank you for the explanation, and about the fix I know and I always leave the fix but it wasn't actually anything related to any function, it was
pawn Код:
public OnObjectMoved(objectid)
{
    if(objectid != gFerrisWheel) return 0;
   
    SetTimer("RotateWheel",3*1000,0);
    return 1;
}
in "ferriswheel.pwn"..
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)