Jump to content

Movement speed changes back to it's original value after modifying it, can it be disabled?


dida55

Recommended Posts

Hey!

 

I have this piece of code to change the movement speed of a character:

	local deep = player:getMoveSpeed();	print (deep);        player:setMoveSpeed(0.08F);	local deep2 = player:getMoveSpeed();	print (deep2);

The console output is this:

 

 

  1. Aug 13 22:28:43 User-MacBook-Pro [0x0-0x1e41e4].com.projectzomboid[2704]: 0.05999999865889549
  2. Aug 13 22:28:43 User-MacBook-Pro [0x0-0x1e41e4].com.projectzomboid[2704]: 0.0989999994635582
  3. Aug 13 22:28:43 User-MacBook-Pro [0x0-0x1e41e4].com.projectzomboid[2704]: 0.05999999865889549
  4. Aug 13 22:28:43 User-MacBook-Pro [0x0-0x1e41e4].com.projectzomboid[2704]: 0.0989999994635582

 

This is bound to the OnPlayerUpdate() event.

Link to comment
Share on other sites

I'm having a similar problem with changing the ZomboidGlobals by using the OnPlayerUpdate event. I Thought that it could be something to do with the fact that the event happens almost constantly. I haven't had time to test it but I think its worth a try to try perhaps a different event. Are you getting a change on the deep2 and then it returns to normal when it's run again?

Link to comment
Share on other sites

So I didn't run into that problem - but that turned out to be moot.  For one thing, getMoveSpeed seems to be referenced but I'm not sure it is actually used.

 

This also might be governed by reason of how the tile/map loading is being handled.

Link to comment
Share on other sites

So I didn't run into that problem - but that turned out to be moot.  For one thing, getMoveSpeed seems to be referenced but I'm not sure it is actually used.

 

This also might be governed by reason of how the tile/map loading is being handled.

Let me know if you have anything usable ready ^^ It is highly requested by the community now. I hope after the release of the LUA debugger, the solution will be easier to find though.

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...