Page 1 of 1

[ScriptAPI] Move player

PostPosted: Thu Jan 05, 2012 23:59
by Hackeridze
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
diff --git a/src/scriptapi.cpp b/src/scriptapi.cpp
index 8321a45..c27ab55 100644
--- a/src/scriptapi.cpp
+++ b/src/scriptapi.cpp
@@ -1747,7 +1747,12 @@ class ObjectRef
                v3f pos = checkFloatPos(L, 2);
                // Do it
                co->setPos(pos);
-               return 0;
+               
+               // Move player
+               ServerRemotePlayer *player = getplayer(ref);
+               if(player != NULL)
+                       get_server(L)->SendMovePlayer(player);
+        return 0;
        }
       
        // moveto(self, pos, continuous=false)

Patch by xyz

PostPosted: Fri Jan 06, 2012 09:45
by sfan5
This should be added to Mainstream

PostPosted: Fri Jan 06, 2012 16:38
by Hackeridze
sfan5 wrote:This should be added to Mainstream

I posted it here for that. We want /sethome and /home !

PostPosted: Fri Jan 06, 2012 17:45
by Hackeridze

PostPosted: Tue Jan 10, 2012 16:39
by randomproof
The problem with this is that it also sends the players yaw and pitch so you have a hard time looking around with you are being moved around on a vehicle. You could remove the ClientEvent in client.cpp line 1183

PostPosted: Tue Jan 10, 2012 17:57
by sapier
If you want to do minecarts with "movePlayer" only it won't work. The problem is that movePlayer moves the cao player object but only indirect the local player in client.

I've got a nearly working solution I'll provide soon, currently the only glitch left is player collision handling results in player dieing while beeing moved.
Sadly atm it relys on some patches I already suggested that might not be merged.
I won't port my changes until a decision is made. If decision is made I'll port it to whatever it is and hope again to be merged.

EDIT1:
this it how it looks like using it combined with my experimental push_block mod Video

PostPosted: Tue Jan 10, 2012 22:30
by jn
sapier wrote:this it how it looks like using it combined with my experimental push_block mod Video

Yay, rail cars / minecarts FTW!