Page 1 of 1

Dynamic Damage Factor v1.0a

Posted: Wed May 03, 2017 2:00 am
by BlushBerry
Dynamic Damage Factor
Coded by: Polygon and Zedek The Plague Doctor
Designed for Zandronum

Special Thanks:
Zedek the Plague Doctor -- Helping me get started with ACS and providing me with a good base to work with as well as helping me with any issue that I had with this script.
Miles Lowroad and Valhalla Game Plays -- For inspiring me to start modding.
TB-303 -- Bug Testing and stacking barrels on me in the dev server.
Xenorax -- Bug Testing

What is Dynamic Damage Factor?
Dynamic Damage Factor is very simple, For every player that joins the game the damage factor will
increase or decrease, adjusting sv_coop_damagefactor to the amount of players present in game.

How do I use it?
The following cvars you can use are listed below and it's usage is described.

Code: Select all

df_debug: Debugs information if greater than 0
df_scalar: The amount of damage percentage to increase per player. (Multiplied by 0.01)
df_maxscale: The final damage calculation can never go above this percentage. (Multiplied by 0.01)
df_basefactor: The base percentage of damage to be used for multiplication. (Multiplied by 0.01)
TO CALCULATE VALUES:
Due to GetCVar returning an int instead of a float, all of the CVARs will be stored as
multiples of 0.01. To calculate what your CVAR should be, you can do:

desiredValue / 0.01

For example, if we wanted a desired scale of 1.25, we'd do (1.25 / 0.01) which is 125.
125 would be the CVAR that we would use, and the script does the rest automatically.


Other Notes
To avoid issues I would leave sv_coop_damagefactor alone and set the base damage factor with df_basefactor.

I would reccommend setting df_basefactor before players join otherwise things will not update properly (I've no idea how to fix this.
This will probably be updated in a future version)

Should work with both Zandronum 2.1.2 and 3.0 But 3.0 has not been throughly tested!

To server hosts
Setting "df" cvars will not be permanent you will need to make an additional .cfg file containing all of your df_ cvars and their values to run manually on each server startup. Zandronum does not support custom
ACS cvars in .cfg files as far as I know.

To the people looking at the source
I have decided to leave the source within this pk3 to remain open source as well as give others the permission to use this
or maybe improve on this code. You can use this script in whatever other projects you're working on.
Just be sure to credit us! (Polygon and Zedek The Plague Doctor)

Update Notice!
If you are having issues with cvars already existing
You will need to open your servers zandronum.ini and remove any "df" and to be safe "dt" cvars from inside the ini.

Example of what the error would be:

Code: Select all

Script error, "ddf_v1a.pk3:cvarinfo" line 1:
cvar 'df_basefactor' already exists
Download Latest

Change Log

Code: Select all

--5/02/2017--
Release

--5/21/2017--
Removed Temporary Cvars
Changed Multiplier to 0.01
Added Changelog

--11/25/2017--
Added in something that I diddn't know needed to be in there that pretty much broke everything else.

Re: Dynamic Damage Factor v1.0

Posted: Wed May 03, 2017 2:07 am
by Zedek The Plague Doctor
Seal of approval :v:

Re: Dynamic Damage Factor v1.0

Posted: Wed May 03, 2017 4:44 am
by stradex
I love the idea!!!

Re: Dynamic Damage Factor v1.0

Posted: Wed May 03, 2017 1:55 pm
by Fused
Really interesting. This small mod can make a big difference if it comes to online play. I like it.

Re: Dynamic Damage Factor v1.0

Posted: Wed May 03, 2017 6:10 pm
by Empyre
Dividing by .05 is the same as multiplying by 20, which is easier for us humans to do.

Here's a suggestion: If the cvar was multiplied by 0.01 instead, it would be a percentage, which is easier for server operators to understand.

Re: Dynamic Damage Factor v1.0

Posted: Mon May 15, 2017 9:37 pm
by BlushBerry
Empyre wrote:Dividing by .05 is the same as multiplying by 20, which is easier for us humans to do.

Here's a suggestion: If the cvar was multiplied by 0.01 instead, it would be a percentage, which is easier for server operators to understand.
Interesting Idea I'll look into changing that in future versions if needed. But I'm having issues with Slade lately so I haven't been able to get around to it :) Thanks for your input!

Re: Dynamic Damage Factor v1.0a

Posted: Sun May 21, 2017 9:05 pm
by BlushBerry
Updated to v1.0a!
Check the Change Log!

Re: Dynamic Damage Factor v1.0a

Posted: Sun Nov 26, 2017 10:25 am
by BlushBerry
I've added one simple line to this addon, Something as an inexperienced modder neglected to put in and was absolutely imperative to have it in there. Any previous versions of Dynamic Damage Factor is obsolete and considered broken and you shouldn't use it.