[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 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.
Post Reply
User avatar
cyber_cool
Posts: 150
Joined: Tue Aug 13, 2019 8:40 pm
Graphics Processor: nVidia with Vulkan support
Contact:

[BETA 0.14] RandomCriticals

Post by cyber_cool »

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.
thewolfman00001
Posts: 72
Joined: Sat Feb 23, 2019 6:11 am

Re: [BETA 0.1] RandomCriticals

Post by thewolfman00001 »

Random crits are fair and balanced :D
User avatar
Rowsol
Posts: 941
Joined: Wed Mar 06, 2013 5:31 am
Contact:

Re: [BETA 0.1] RandomCriticals

Post by Rowsol »

I thought rolling an 8 was a crit.
User avatar
Boondorl
Posts: 137
Joined: Wed Jul 11, 2018 10:57 pm

Re: [BETA 0.1] RandomCriticals

Post by Boondorl »

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.
NiGHTMARE
Posts: 3463
Joined: Sat Jul 19, 2003 8:39 am

Re: [BETA 0.1] RandomCriticals

Post by NiGHTMARE »

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)?
User avatar
cyber_cool
Posts: 150
Joined: Tue Aug 13, 2019 8:40 pm
Graphics Processor: nVidia with Vulkan support
Contact:

Re: [BETA 0.1] RandomCriticals

Post by cyber_cool »

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...
XLightningStormL
Posts: 384
Joined: Mon May 09, 2016 1:38 am
Location: Anywhere but here
Contact:

Re: [BETA 0.1] RandomCriticals

Post by XLightningStormL »

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
cyber_cool
Posts: 150
Joined: Tue Aug 13, 2019 8:40 pm
Graphics Processor: nVidia with Vulkan support
Contact:

Re: [BETA 0.1] RandomCriticals

Post by cyber_cool »

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.
NiGHTMARE
Posts: 3463
Joined: Sat Jul 19, 2003 8:39 am

Re: [BETA 0.1] RandomCriticals

Post by NiGHTMARE »

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: viewtopic.php?f=3&t=26198
XLightningStormL
Posts: 384
Joined: Mon May 09, 2016 1:38 am
Location: Anywhere but here
Contact:

Re: [BETA 0.1] RandomCriticals

Post by XLightningStormL »

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
cyber_cool
Posts: 150
Joined: Tue Aug 13, 2019 8:40 pm
Graphics Processor: nVidia with Vulkan support
Contact:

Re: [BETA 0.1] RandomCriticals

Post by cyber_cool »

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
Solid-Head
Posts: 57
Joined: Thu Sep 11, 2014 1:07 pm

Re: [BETA 0.12] RandomCriticals

Post by Solid-Head »

With the latest build of course.
Attachments
Criterror.jpg
User avatar
Meyers07
Posts: 12
Joined: Wed Dec 18, 2019 5:00 am

Re: [BETA 0.14] RandomCriticals

Post by Meyers07 »

This is perfect with Space Hunter as the weaponry choice for player is small and buffed up enemies later might be tedious without some surprise like this.
User avatar
TheRailgunner
Posts: 1555
Joined: Mon Jul 08, 2013 10:08 pm

Re: [BETA 0.14] RandomCriticals

Post by TheRailgunner »

So, for reasons beyond my understanding, RandomCriticals causes...strange graphical bugs when used with The Trooper, the most noticeable of which is that projectiles sometimes don't render - for projectiles with layered visual effects (or, more properly, stacked projectiles), this can make them seem "lacking" or entirely invisible. The K-JACK is particularly effected by this, as each "single" projectile is actually four projectiles that contribute to a compound visual effect.
Post Reply

Return to “Gameplay Mods”