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