Jump to content

Editing player sprint speed?


ethanwdp

Recommended Posts

Is it possible? I know that some traits (I think) and skills make you run faster, but I haven't been able to find anything in the base files that actually applies this change. I'm hoping it isn't applied and can only be applied by a Class file, as those never load up properly in Notepad ++.

What I'm trying to do is make a toggleable run speed cheat (playing Project Zomboid as The Flash would be pretty interesting :P), but I haven't even found anything hinting towards a slight change in walkspeed.

Link to comment
Share on other sites

If/When you find out, with great power comes great responsibility.

A while afterwards, and I've hit a giant brick wall.

It turns out that a lot of useful variables like MaxWeight and SpeedMod are locked up, they're set to protected so I can't do anything with them unless if I make my mod in the same directory as the Zomboid folder where the executable is, which is something I never want to do.

This severely limits the things I can do with modding in this game, unless if I figure out another way.

Then again, I'm a noob at lua and Java, so I don't know if it's just because I lack the knowledge to change these variables without screwing with base class files or not.

Link to comment
Share on other sites

 

If/When you find out, with great power comes great responsibility.

A while afterwards, and I've hit a giant brick wall.

It turns out that a lot of useful variables like MaxWeight and SpeedMod are locked up, they're set to protected so I can't do anything with them unless if I make my mod in the same directory as the Zomboid folder where the executable is, which is something I never want to do.

This severely limits the things I can do with modding in this game, unless if I figure out another way.

Then again, I'm a noob at lua and Java, so I don't know if it's just because I lack the knowledge to change these variables without screwing with base class files or not.

 

*Shrug* (clyde)

Link to comment
Share on other sites

 

 

If/When you find out, with great power comes great responsibility.

A while afterwards, and I've hit a giant brick wall.

It turns out that a lot of useful variables like MaxWeight and SpeedMod are locked up, they're set to protected so I can't do anything with them unless if I make my mod in the same directory as the Zomboid folder where the executable is, which is something I never want to do.

This severely limits the things I can do with modding in this game, unless if I figure out another way.

Then again, I'm a noob at lua and Java, so I don't know if it's just because I lack the knowledge to change these variables without screwing with base class files or not.

 

*Shrug* (clyde)

 

Well, it turns out I just lacked the knowledge, and that the maxweight was useable the entire time, so hopefully so is the speed variable. Problem is, I don't know what speed variable does what :/

Link to comment
Share on other sites

Six days, still no luck :/

 

All I've found is getGlobalMovementMod, getSprintMod, etc. None of those have a "set" variant, and hours of decompiling the code later I'm still no closer.

 

Edit: This is the closest thing I can find that could do this:

 

  public float getSprintMod()
  {
    int level = getPerkLevel(PerkFactory.Perks.Sprinting);
    if (level == 1) {
      return 1.1F;
    }
    if (level == 2) {
      return 1.15F;
    }
    if (level == 3) {
      return 1.2F;
    }
    if (level == 4) {
      return 1.25F;
    }
    if (level == 5) {
      return 1.3F;
    }
    if (level == 6) {
      return 1.35F;
    }
    if (level == 7) {
      return 1.4F;
    }
    if (level == 8) {
      return 1.45F;
    }
    if (level == 9) {
      return 1.5F;
    }
    if (level == 10) {
      return 1.6F;
    }
    return 0.9F;
  }

Only problem is, I can't figure out how to influence anything here. I don't know how I'd change what it returns using only Lua. This is also a problem for pretty much every other perk modifier out there, the structure is so rigid I can't change anything.

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