Jump to content
Sign in to follow this  
Gurkenkoenig

how to make a mod for client?

Recommended Posts

hey. i am playing around with changing stamina drain values while sprinting and also stamina gain values for jogging.

now the thing is. once i change it to much on the serverside, server and client values of stamina are out of sync and the charakter starts to "slide" around (sprinting slow).

so how can i make it so when i change the values for the client my charakter does not get kicked? and how can can i make a mod(downloadable in workshop) for other people playing on that server?

 

thanks for any help :)

Share this post


Link to post
Share on other sites
On 4.12.2018 at 10:46 PM, Gurkenkoenig said:

hey. i am playing around with changing stamina drain values while sprinting and also stamina gain values for jogging.

now the thing is. once i change it to much on the serverside, server and client values of stamina are out of sync and the charakter starts to "slide" around (sprinting slow).

so how can i make it so when i change the values for the client my charakter does not get kicked? and how can can i make a mod(downloadable in workshop) for other people playing on that server?

 

thanks for any help :)

Hi Gurkenkoenig,

so you can start on building a mod for clients with this basic layout that i just uploaded to github:

https://github.com/salutesh/DayZ_Mod

Feel free to use this to build on.

Keep in mind that you always should know what you try to modify and keep your mod structured.

For example you want to change something in the staminahandler.c of the game, you cant just copy paste a class/void etc.

In case of a existing class you have to mod the class:

modded class StaminaConsumer
{
	//MY MODIFIED CODE
}

For exsting voids you have to override them:

override void StaminaConsumer(float threshold, bool state)
{
	//MY MODIFIED CODE
}

etc, etc.

If you need any further help, just ask here.

Edited by Salutesh
  • Like 1

Share this post


Link to post
Share on other sites
1 hour ago, Salutesh said:

If you need any further help, just ask here.

i just simply edited those lines in constants.c on the server

const int     STAMINA_DRAIN_STANDING_SPRINT_PER_SEC = 5; //in units (how much sprint depletes stamina)

changing to 2 or 3

const int     STAMINA_GAIN_JOG_PER_SEC = 2; //in units (how much of stamina units is gained while jogging)

changing to 1

when i change line-1 to 3 the bottom left bar gets a little chaotic. it seems like client thinks it should deplete a certain amount and then the server says, hey thats not the amount change it to that. but sprinting functions ok.

but when i change line-1 to 2, not only is the bottom left bar chaotic. now even the character becomes desynced while gaining less stamina than the client thinks. now sprinting is in slowmo while gaining the needed stamina to start sprinting again.

 

now my idea was to just edit the same file/lines on my client and dont get that desync.

but then the server kicks for edited files. so i have to find out how to make a mod so i dont get kicked. and then upload it to steam workshop so my mates can download it.

 

i hope my mind is not to confusing.

Share this post


Link to post
Share on other sites
10 hours ago, Gurkenkoenig said:

i just simply edited those lines in constants.c on the server

const int     STAMINA_DRAIN_STANDING_SPRINT_PER_SEC = 5; //in units (how much sprint depletes stamina)

changing to 2 or 3

const int     STAMINA_GAIN_JOG_PER_SEC = 2; //in units (how much of stamina units is gained while jogging)

changing to 1

when i change line-1 to 3 the bottom left bar gets a little chaotic. it seems like client thinks it should deplete a certain amount and then the server says, hey thats not the amount change it to that. but sprinting functions ok.

but when i change line-1 to 2, not only is the bottom left bar chaotic. now even the character becomes desynced while gaining less stamina than the client thinks. now sprinting is in slowmo while gaining the needed stamina to start sprinting again.

 

now my idea was to just edit the same file/lines on my client and dont get that desync.

but then the server kicks for edited files. so i have to find out how to make a mod so i dont get kicked. and then upload it to steam workshop so my mates can download it.

 

i hope my mind is not to confusing.

How did you make the changes? Where is the changed code?

Share this post


Link to post
Share on other sites
2 hours ago, Salutesh said:

How did you make the changes? Where is the changed code?

changed stuff is in DayZServer/dta/scripts.pbo    -->     3_Game/constants.c

i changed it by unpacking with PBOManager and editing with a text editor(notepad++ or Workbench)

i may have figured out how to pack it into a mod,sign it with a key,

but now i cant upload it to steamworkshop due to an Error in DayZ Publisher. when i select the folder with the Mod content it says "Error: Missing folder" , do you know what i am doing wrong?

BZEuJ5g.jpg

Edited by Gurkenkoenig
added screenshot

Share this post


Link to post
Share on other sites

The problem is you are editing it too extreme, the way you set it up you are not losing enough stamina to counter the stamina regain rate, that is why it is going chaotic, you need to balance stamina depletion against stamina regain.

Share this post


Link to post
Share on other sites
On 7.12.2018 at 12:21 PM, Gurkenkoenig said:

changed stuff is in DayZServer/dta/scripts.pbo    -->     3_Game/constants.c

i changed it by unpacking with PBOManager and editing with a text editor(notepad++ or Workbench)

i may have figured out how to pack it into a mod,sign it with a key,

but now i cant upload it to steamworkshop due to an Error in DayZ Publisher. when i select the folder with the Mod content it says "Error: Missing folder" , do you know what i am doing wrong?

BZEuJ5g.jpg

You need to create an addons folder inside your Mod folder. Then you put your modded pbo inside of the addons folder. In Publisher you then select your mod folder. 

Edited by lbmaster

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×