Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
dregs

A Dehacked Proposal w/ an example (Source Code)

Recommended Posts

Has this been done before?

Is this the right place for it?

Dehacked uses MISC1 and MISC2 for some actor functions. but not weapons because of how some ports render the weapon. Some ports treat the misc values as offsets.

 

My proposal changes the order of how misc is handled

It's just a if action else offsets

 

I have written some example functions that i would like seen in Dehacked one day. I have also created a test wad and .bex file to showcase it.

 

 

 

- JumpIfAmmoMod

    Jumps to MISC1 if ammo is modulo to MISC2. unfortunatly this means that you are restricted to factors of 5 or 2 for most weapons

-JumpIfBezerk

   Jumps to MISC1 if bezerk is active, for alternative attacks

-RefireJump

   Unlike A_Refire, this allows you to jump to any state via MISC1. The example wad uses the plasma gun and gives it a windup time

 

-PRandomJump

   A port of RandomJump for actors. misc's are the same but for weapons

 

-FireProjectile

   Fires a custom projectile defined in MISC1. the example adds a "grenade" launcher without affecting the cyberdemons rockets.

-CheckReload2

   checks if ammo is less than MISC1 or zero. jumps to lower state.

 

-CustomBulletsBasic

   This is the start of my worries, since yes you *can* cram multiple values into one space and take them out via bitwising. but since long types are dependent on the system it would need to be only as big as the smallest possible size, which is 32-bits(?). its what i used

       MISC1 is divided into three bytes. The first the angle for horizontal spread, next is vertical spread and finally there's the ammo cost. this function does not check the remaining ammo count.

       MISC2 is one byte and one half nibble. its pellet count for the byte and the half nibble is the 'damage threshold'

           Damage threshold is only four options:

               0 is the default 5-15, steps of 5

               1 is lowest; 1-5, in steps of 1

               2 is from 5-10, in steps of 1

               and 3 is 10-15 in steps of 1

 

Obviously CustomBulletsBasic would be a slight pain to calculate the values needed. My implementation of how it converts those byte angles into something useful is also janky

 

-CustomMelee

    same as normal melee. no ammocost option right now. its just a copy of A_Punch

    MISC2 is the range

    MISC1's first two bytes is the damage output. the 17th bit is if you want it to be affected by bezerker multipliers.

 

The major bug is if you move and then shoot. your weapon may jitter. this can be seen with the revolver in the example wad.

 

 

Spoiler

Why not just use decorate or zscript?

because i don't want to use it.


 

 

I don't actually know if it would compile on other computers. i'm new to this, and i already wrote it.

 

A more coherent explanation may be found in p_pspr.c not saying this is silver font. its probably a bit nutty

prboom-plus-testing.7z

Share this post


Link to post
28 minutes ago, hobomaster22 said:

I believe everything you want is here:
https://github.com/kraflab/mbf21/blob/master/docs/spec.md

 

Currently implemented in DSDA-Doom, GZDoom, and I believe Eternity as well.

the point of this is to add extra weapon functions to Dehacked. these have parameters like what was implemented for mobs

never mind, wait. does prboom-plus have this? thats the major reason why i did this.

Share this post


Link to post
26 minutes ago, dregs said:

the point of this is to add extra weapon functions to Dehacked. these have parameters like what was implemented for mobs

never mind, wait. does prboom-plus have this? thats the major reason why i did this.

PrBoom+ has stopped development. What we now have is PrBoom+UM and the successor DSDA-Doom.

 

DSDA-Doom implements several new standards:

Share this post


Link to post

If you want to check an example for weapons made with MBF21 standard, there is this excellent mod made by Xaser, but on GZDoom 4.7.1 doesn't work (MBF21 on latest stable GZDoom version (4.7.1 MBF21 support it's still in beta, I think for the next versions 4.8.x will be fixed)

Edited by LuciferSam86

Share this post


Link to post

MBF21/DSDHacked is also supported by DECOHack (part of DoomTools). It requires some kind of DECORATE-ish know-how, but it compiles to DeHackEd.

 

Disclosure: I wrote DECOHack.

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×