Jump to content

moveObject


CallumD

Recommended Posts

Does moveObject have some form of sync problem? I have a barrier to turn 90 degress and back again which is done by moveObject (triggered by onMarkerHit). When I tested the script in a private server I was the only player and it worked perfectly. Then, when I uploaded it to the actual server with people on it the barrier turned over 90 degress (about 110). I then tested it over and over with 1 person in the server and then with 2 people in the server. It seems 2+ players in a server makes it mess up.

Link to comment

The problem with onMarkerHit is, that while you are in the marker, the event is triggered on every frame. If you stay in the marker 1 second the event may be triggered up to 50 times depending on the server frame limiter… The longer you stay in the marker, the bigger will be the rotation offset.

It works on the local server, because there is no lag there (or the lag is minimal)

But I may be wrong :P

Link to comment

Hmm, in that case I had a strange bug: I created a marker, that create a different marker in a different place, when I hit it, and it was creating that marker over and over while I was in it… I had to add some conditions to fix it…

anyway I think I can help with CallumD’s problem, although I did not seen his script

local youmarker = createMarker ( youx, youy, youz, "youtype", yousize )
function youMarkerHit()
if getElementType(hitPlayer)=="player" and source == youmarker then
if isoYouObjectMoving == nil then
isoYouObjectMoving = 1
YOU_ARE_MOVING_THE_OBIECT_HERE
setTimer(
function()
isoYouObjectMoving = nil
end, The_time_in_milliseconds_the_object_will_arrive_at_the_destination ,1)
end
end
end
addEventHandler("onMarkerHit", getRootElement (), youMarkerHit)

if you use it, the marker will not work while the object is moving (I think there is your problem)

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...