Jump to content

Disable player movements


Kenneth

Recommended Posts

To disable the player movements and also interaction with context menu. 

 

So far I found

getPlayer():setBlockMovement(true) --Prevent movement keys to work

local function clearContext(player, context, worldObjects, test)
    context:clear()
end
Events.OnFillWorldObjectContextMenu.Add(clearContext)

--To turn of all UI on screen use 

if ISUIHandler.allUIVisible == true then
    ISUIHandler.toggleUI()
end
Edited by Kenneth
Updated added some solutions
Link to comment
Share on other sites

Hey so I want to prevent player from doing any actions or any states. So far I found a method that prevents player from using walk keys to move around

getPlayer():setBlockMovement(true)

This will prevent movement keys to not work which I want. 

But I also want to prevent him from interacting with object around him like opening door etc.

I want to also completely hide the UI on your screen and also when right clicking an object also hide the context menu.

Link to comment
Share on other sites

On 12/13/2022 at 12:42 PM, Kenneth said:

The reason I am doing this is I want have the effect of you monitoring a camera like cctv camera. I already got the code to hide the player and move him to a position (the shadow still shows) and I  also give him ghostmode.

 

Isn't there such a feature implemented?

Though I just saw something similar in the RCON interface, a command called record start|stop|play or something like this when I had planned the cutscene feature for my current project.

Never used or tried it, but it sounds like this is what you are looking for.

 

Otherwise, my first approach would be to wrap the appropriate event listeners. There you can check whether it is the target character and if not, delegate the execution flow to wrapped function.

 

 

// Because of the remaining shadows:

Maybe you can check the tile of those squares and overlay/stamp it over the shadow.

Well again, this is a situation where I think something like a force re-render function for IsoGridSquare on Java layer would be a nice thing... But maybe there are some shader functions exposed to lua as well. Should be worth checking/trying

Edited by stuck1a
Link to comment
Share on other sites

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
×
×
  • Create New...