Dynamic Damage Factor v1.0a

Maps, modifications, add-ons, projects, and other releases for Zandronum. Also includes announcers.
Post Reply
User avatar
Polygon
 
Posts: 61
Joined: Tue Apr 26, 2016 11:12 pm
Clan: Nuclear Empire
Clan Tag: [NE]

Dynamic Damage Factor v1.0a

#1

Post by Polygon » Wed May 03, 2017 2:00 am

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.
Last edited by Polygon on Sat Nov 25, 2017 9:20 am, edited 5 times in total.

User avatar
Zedek The Plague Doctor
 
Posts: 52
Joined: Sun Aug 05, 2012 3:25 am
Location: Dancing Robot Factory In Hell
Clan: OLAF METAL
Clan Tag: [OLAF]
Contact:

Re: Dynamic Damage Factor v1.0

#2

Post by Zedek The Plague Doctor » Wed May 03, 2017 2:07 am

Seal of approval :v:

User avatar
stradex
Forum Regular
Posts: 102
Joined: Sun Aug 09, 2015 4:36 am
Location: Argentina, Buenos Aires
Clan: IoP

Re: Dynamic Damage Factor v1.0

#3

Post by stradex » Wed May 03, 2017 4:44 am

I love the idea!!!

User avatar
Fused
Forum Staff
Posts: 594
Joined: Sat Nov 09, 2013 9:47 am
Location: Netherlands
Clan: TK
Contact:

Re: Dynamic Damage Factor v1.0

#4

Post by Fused » Wed May 03, 2017 1:55 pm

Really interesting. This small mod can make a big difference if it comes to online play. I like it.
ZCC, A Client Enhancement for Zandronum
Zombie Horde 2 (coming soon) || DoomZ : Overpoch (coming not so soon)

Image

User avatar
Empyre
Zandrone
Posts: 1090
Joined: Sun Jul 08, 2012 6:41 am
Location: Garland, TX, USA

Re: Dynamic Damage Factor v1.0

#5

Post by Empyre » Wed May 03, 2017 6:10 pm

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.
"For the world is hollow, and I have touched the sky."

User avatar
Polygon
 
Posts: 61
Joined: Tue Apr 26, 2016 11:12 pm
Clan: Nuclear Empire
Clan Tag: [NE]

Re: Dynamic Damage Factor v1.0

#6

Post by Polygon » Mon May 15, 2017 9:37 pm

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!

User avatar
Polygon
 
Posts: 61
Joined: Tue Apr 26, 2016 11:12 pm
Clan: Nuclear Empire
Clan Tag: [NE]

Re: Dynamic Damage Factor v1.0a

#7

Post by Polygon » Sun May 21, 2017 9:05 pm

Updated to v1.0a!
Check the Change Log!

User avatar
Polygon
 
Posts: 61
Joined: Tue Apr 26, 2016 11:12 pm
Clan: Nuclear Empire
Clan Tag: [NE]

Re: Dynamic Damage Factor v1.0a

#8

Post by Polygon » Sun Nov 26, 2017 10:25 am

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.

Post Reply