Dr_Cox1911 Posted June 28, 2015 Share Posted June 28, 2015 Have tried to use the search function, but couldn´t find anything related to this and I´m kinda lost here. How could I lock the player to the current position he/she is standing on? Need this for a MP mod, when all clients clicked the dialog they should be able to move again. Link to comment Share on other sites More sharing options...
RoboMat Posted June 28, 2015 Share Posted June 28, 2015 One (brute force) approach that comes to mind would be constantly teleporting the player to his "current" coordinates. Link to comment Share on other sites More sharing options...
Dr_Cox1911 Posted June 28, 2015 Author Share Posted June 28, 2015 I thought of that too, but wouldn´t that beat the performance down? Link to comment Share on other sites More sharing options...
RoboMat Posted June 28, 2015 Share Posted June 28, 2015 No idea to be frank. It shouldn't be too bad since no new tiles etc. need to be loaded? Link to comment Share on other sites More sharing options...
Brybry Posted June 28, 2015 Share Posted June 28, 2015 getPlayer():setBlockMovement(true); will stop movement with keys (and controller, I think) but it won't stop context menu movement. Link to comment Share on other sites More sharing options...
Dr_Cox1911 Posted June 28, 2015 Author Share Posted June 28, 2015 Thanks Brybry! I thought of a way to even permit the right-click movement by bounding the mouse to the dialog, but still need to get the hang of all this UI-stuff. Link to comment Share on other sites More sharing options...
Brybry Posted June 28, 2015 Share Posted June 28, 2015 local ISWalkToTimedAction_update_old = ISWalkToTimedAction.update;function ISWalkToTimedAction:update(...) if instanceof(self.character, "IsoPlayer") and self.character:isBlockMovement() then self:forceStop(); return; end return ISWalkToTimedAction_update_old(self, ...);endfunction freezePlayer() getPlayer():setBlockMovement(true); getPlayer():setPath(nil);endfunction unfreezePlayer() getPlayer():setBlockMovement(false);endWill work with right-click movement for most cases (they can still jump through windows if they're close enough though.) Dr_Cox1911 1 Link to comment Share on other sites More sharing options...
Dr_Cox1911 Posted June 28, 2015 Author Share Posted June 28, 2015 Awesome Brybry! Works like a charm Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now