[BETA 0.14] RandomCriticals

Projects that alter game functions but do not include new maps belong here.
Forum rules
The Projects forums are ONLY for YOUR PROJECTS! If you are asking questions about a project, either find that project's thread, or start a thread in the General section instead.

Got a cool project idea but nothing else? Put it in the project ideas thread instead!

Projects for any Doom-based engine (especially 3DGE) are perfectly acceptable here too.

Please read the full rules for more details.

[BETA 0.14] RandomCriticals

Postby cyber_cool » Thu Sep 19, 2019 5:24 am

RandomCriticals is a mod that adds a chance for any attack - either of monster or player, hitscan or projectile - to become critical and so deal additional damage on top of the normal one - so, if critical damage modifier is 200%, the attack itself will deal 300% damage (100% of normal damage and 200% of additional one).
It's also customizable from top to bottom, has a critical chance boost system, and some sounds and visual to distinguish critical attacks and projectiles from normal ones.
Critical chance boost system works in following way:
The more damage actor inflicts, or takes, or both (or none of these options), the more additional critical chance it gains, capped at certain total critical chance value. This additional chance resets to zero as soon as actor does not take or deal any damage (this is not dependant on options... for now). Amount of additional critical chance gained per N points of damage is customizable, too.

Please read before playing:
LOAD ORDER & COMPATIBILITY:
Better load it after all mods that add new weapons and monsters. Should be compatible with any mod so far.
KNOWN ISSUES:
    - Theoretically, if another mod uses projectiles as decorations, they can also be critical. I can't fix this, and also, this is a very terrible hax.
    - Not multiplayer compatible yet (Everyone will hear a sound of critical hit taken if one player gets hurt with critical hit, or critical hit dealt when one player scores it).
    - No way to disable vanilla damage randomisation for better experience yet. This can lead to ridiculous situations like crit barely hitting or one-shoting a player.
    - Stupid obituary message "<player> killed himself" if a player dies to critical part of the damage.

CHANGE LOG:
BETA 0.14
    - Added some new colors.
    - Added options to change damage sources that can critical hit (missiles and everything else).
BETA 0.13
    - Fixed a major bug that makes game crash on latest GZDoom build.
    - Also fixed a bug that caused game to crash if a player or monster was telefragged (for example, by an Icon of Sin's spawner projectile)
BETA 0.12
    - Fixed a major bug that makes some guns from weapon mods to crash the game.
BETA 0.11:
    - Hot-fixed a minor bug (sound not playing when scoring a critical with hitscan) and a major bug (crash on start).
    - Improved performance.
BETA 0.1:
    - First version.

CREDITS (you can find them in the mod options menu):
Special thanks to:
ZDoom wiki, marrub - good and helpful, yet not complete, zscript documentation
Marisa Kirisame, Boondorl - very helpful coding tips (what a shame I could not find a way to use yours, Boondorl)
XLightningStormL, Solid-Head - spotting a lot of bugs
NiGHTMARE - idea to make it compatible with DamNums
Critical hit system and sounds:
Valve
Coding:
cyber_cool

DOWNLOAD: https://www.dropbox.com/s/cb08jafdyfwlj ... 4.pk3?dl=0
Last edited by cyber_cool on Fri Sep 27, 2019 6:48 am, edited 7 times in total.
User avatar
cyber_cool
 
Joined: 14 Aug 2019
Discord: cyber_c001#4316
Operating System: Windows 10/8.1/8 64-bit
Graphics Processor: nVidia (Modern GZDoom)

Re: [BETA 0.1] RandomCriticals

Postby thewolfman00001 » Thu Sep 19, 2019 7:49 am

Random crits are fair and balanced :D
thewolfman00001
 
Joined: 23 Feb 2019
Discord: Alexander (The Wolfman)#6010
Operating System: Windows 10/8.1/8 64-bit

Re: [BETA 0.1] RandomCriticals

Postby Rowsol » Thu Sep 19, 2019 11:00 am

I thought rolling an 8 was a crit.
User avatar
Rowsol
 
Joined: 06 Mar 2013
Location: Maryland, US

Re: [BETA 0.1] RandomCriticals

Postby Boondorl » Thu Sep 19, 2019 5:41 pm

Pretty neat idea! If I had one major critique to give, it'd be to use a single Inventory item with multiple fields to manage crit levels and what not. Looking through this code makes me wish Interfaces were a thing for GZDoom, but for now an Inventory item can fill that role. Using A_DamageSelf is also a bit dangerous since I believe that damage can also technically crit (it counts as a separate instance for WorldThingDamaged purposes). Using ModifyDamage on an Inventory item would better handle this since it won't be a separate damage instance but will directly modify the current one. Hypothetically the entire crit damage modifying system could be done through ModifyDamage.
User avatar
Boondorl
 
Joined: 12 Jul 2018

Re: [BETA 0.1] RandomCriticals

Postby NiGHTMARE » Fri Sep 20, 2019 12:36 am

I wonder if it would be possible to have this interact with the DamNums mod so it displays the word "critical" when something takes critical damage (ala Borderlands)?
NiGHTMARE
.now.
 
Joined: 19 Jul 2003

Re: [BETA 0.1] RandomCriticals

Postby cyber_cool » Fri Sep 20, 2019 1:58 am

Boondorl wrote:Pretty neat idea! If I had one major critique to give, it'd be to use a single Inventory item with multiple fields to manage crit levels and what not. Looking through this code makes me wish Interfaces were a thing for GZDoom, but for now an Inventory item can fill that role. Using A_DamageSelf is also a bit dangerous since I believe that damage can also technically crit (it counts as a separate instance for WorldThingDamaged purposes). Using ModifyDamage on an Inventory item would better handle this since it won't be a separate damage instance but will directly modify the current one. Hypothetically the entire crit damage modifying system could be done through ModifyDamage.


Thank you for giving me such a fresh idea. I did not think about ModifyDamage, and yes, I also forgot to add check for e.DamageSource being the same as e.Thing, so it can theoretically crit more than one time. Also, this changes obituary message to "<player> killed himself.".

NiGHTMARE wrote:I wonder if it would be possible to have this interact with the DamNums mod so it displays the word "critical" when something takes critical damage (ala Borderlands)?


That would be really cool, indeed. I've never played with DamNums to be honest, but I heard about it. I am sure it'll be nice to make this mod compatible with DamNums.

Rowsol wrote:I thought rolling an 8 was a crit.


Indeed. If I could find a way to easily disable vanilla damage randomisation...
User avatar
cyber_cool
 
Joined: 14 Aug 2019
Discord: cyber_c001#4316
Operating System: Windows 10/8.1/8 64-bit
Graphics Processor: nVidia (Modern GZDoom)

Re: [BETA 0.1] RandomCriticals

Postby XLightningStormL » Fri Sep 20, 2019 3:36 am

Can't even seem to get this to work, as it crashes upon entering a level, something about line 70, and attempting to read from address zero.
User avatar
XLightningStormL
DUSK Wiki Master
 
Joined: 09 May 2016
Discord: XLightningStormL#7461
Twitch ID: XLightmingStormL

Re: [BETA 0.1] RandomCriticals

Postby cyber_cool » Fri Sep 20, 2019 5:32 am

XLightningStormL wrote:Can't even seem to get this to work, as it crashes upon entering a level, something about line 70, and attempting to read from address zero.


It was fixed, thank you for spotting the bug!

Also, Boondorl, I tried to make use of ModifyDamage, but the thing is, that I use WorldThingDamaged event to apply critical hits, so it's too late to give this item to the damage source. I could've used it on a projectile, but I am going to get a special treatment of it anyway - I need to play a sound when projectile hits an enemy.
User avatar
cyber_cool
 
Joined: 14 Aug 2019
Discord: cyber_c001#4316
Operating System: Windows 10/8.1/8 64-bit
Graphics Processor: nVidia (Modern GZDoom)

Re: [BETA 0.1] RandomCriticals

Postby NiGHTMARE » Fri Sep 20, 2019 6:35 am

cyber_cool wrote:Indeed. If I could find a way to easily disable vanilla damage randomisation...


I'm not sure if it's the same in ZSCript, but in DECORATE I believe you can use parentheses to specify an exact damage amount e.g. "damage (4)".

Someone also posted a mod which removes random damage from the player's weapons a while ago - due to the mod's age it's for DECORATE rather than ZScript and the DL is broken; however, the code is in a spoiler in the first post: https://forum.zdoom.org/viewtopic.php?f=3&t=26198
NiGHTMARE
.now.
 
Joined: 19 Jul 2003

Re: [BETA 0.1] RandomCriticals

Postby XLightningStormL » Fri Sep 20, 2019 8:01 am

cyber_cool wrote:
XLightningStormL wrote:Can't even seem to get this to work, as it crashes upon entering a level, something about line 70, and attempting to read from address zero.


It was fixed, thank you for spotting the bug!


Doesn't seem like it, It has something to do with the "enemy_crit_boost_system" as soon as it's commented out in the WorldThingSpawned section, it works fine.
User avatar
XLightningStormL
DUSK Wiki Master
 
Joined: 09 May 2016
Discord: XLightningStormL#7461
Twitch ID: XLightmingStormL

Re: [BETA 0.1] RandomCriticals

Postby cyber_cool » Sat Sep 21, 2019 2:52 am

XLightningStormL wrote:Doesn't seem like it, It has something to do with the "enemy_crit_boost_system" as soon as it's commented out in the WorldThingSpawned section, it works fine.

That seems rather bizzare... I can't really think of how theoretically it can throw an exception. I would really appreciate if you've posted a full error message or told me how to reproduce this error (I tried both 3.7.2 and 4.0.0 gzdoom).
User avatar
cyber_cool
 
Joined: 14 Aug 2019
Discord: cyber_c001#4316
Operating System: Windows 10/8.1/8 64-bit
Graphics Processor: nVidia (Modern GZDoom)

Re: [BETA 0.12] RandomCriticals

Postby Solid-Head » Sat Sep 21, 2019 1:17 pm

With the latest build of course.
Attachments
Criterror.jpg
User avatar
Solid-Head
 
Joined: 11 Sep 2014


Return to Gameplay Mods

Who is online

Users browsing this forum: Yandex [Bot] and 13 guests