PROJ WORKSLIKE: Difference between revisions

From EDukeWiki
Jump to navigation Jump to search
Fox (talk | contribs)
No edit summary
Fox (talk | contribs)
No edit summary
Line 1: Line 1:
PROJ_WORKSLIKE is a [[defineprojectile]] property used to set flags for projectile function. It is a [[bitfield]]. The flags (defined) are:
PROJ_WORKSLIKE is a [[defineprojectile]] property used to set flags for projectile function.
 
define [[PROJECTILE_HITSCAN]]                    1
define [[PROJECTILE_RPG]]                        2
define [[PROJECTILE_BOUNCESOFFWALLS]]            4
define [[PROJECTILE_BOUNCESOFFMIRRORS]]          8
define [[PROJECTILE_KNEE]]                        16
define [[PROJECTILE_WATERBUBBLES]]                32
define [[PROJECTILE_TIMED]]                      64
define [[PROJECTILE_BOUNCESOFFSPRITES]]          128
define [[PROJECTILE_SPIT]]                        256
define [[PROJECTILE_COOLEXPLOSION1]]              512
define [[PROJECTILE_BLOOD]]                      1024
define [[PROJECTILE_LOSESVELOCITY]]              2048
define [[PROJECTILE_NOAIM]]                      4096
define [[PROJECTILE_RANDDECALSIZE]]              8192
define [[PROJECTILE_EXPLODEONTIMER]]              16384
define [[PROJECTILE_RPG_IMPACT]]                  32768
define [[PROJECTILE_RADIUS_PICNUM]]              65536
define [[PROJECTILE_ACCURATE_AUTOAIM]]            131072
define [[PROJECTILE_FORCEIMPACT]]                262144
define [[PROJECTILE_REALCLIPDIST]]                524288
define [[PROJECTILE_ACCURATE]]                    1048576
define [[PROJECTILE_NOSETOWNERSHADE]]            2097152
define [[PROJECTILE_RPG_IMPACT_DAMAGE]]          4194304


Note that the damage on impact bit (32768) must be set on the WORKSLIKE of any RPG type projectile (i.e. nonhitscan) for which the projectile itself does damage, as opposed to the damage being caused only by the hitradius.
Note that the damage on impact bit (32768) must be set on the WORKSLIKE of any RPG type projectile (i.e. nonhitscan) for which the projectile itself does damage, as opposed to the damage being caused only by the hitradius.
Line 31: Line 7:
[[defineprojectile]] <tile number> '''PROJ_WORKSLIKE''' <flag value>
[[defineprojectile]] <tile number> '''PROJ_WORKSLIKE''' <flag value>


Add all the desired flags together, and use that value for <flag value>. This works similar to [[cstat (sprite)|cstat]].
== Flags ==


Add all the desired flags together, and use that value for <flag value>. This works similar to [[cstat (sprite)|cstat]].
{{Proj workslike}}


[[Category:Bitfields]]
[[Category:Bitfields]]
[[Category:Projectile_structure_members]]
[[Category:Projectile_structure_members]]

Revision as of 18:19, 20 February 2020

PROJ_WORKSLIKE is a defineprojectile property used to set flags for projectile function.

Note that the damage on impact bit (32768) must be set on the WORKSLIKE of any RPG type projectile (i.e. nonhitscan) for which the projectile itself does damage, as opposed to the damage being caused only by the hitradius.

Syntax is:

defineprojectile <tile number> PROJ_WORKSLIKE <flag value>

Add all the desired flags together, and use that value for <flag value>. This works similar to cstat.

Flags

The following values are used with defineprojectile.

Exposed Value Hex Label Description
Yes 1 0x000001 PROJECTILE_HITSCAN Indicates that the projectile is hitscan.

It cannot be applied simultaneously with PROJECTILE_KNEE, PROJECTILE_RPG, or PROJECTILE_BLOOD.

Yes 2 0x000002 PROJECTILE_RPG Indicates that the projectile is a moving actor.

It cannot be applied simultaneously with PROJECTILE_HITSCAN, PROJECTILE_KNEE, or PROJECTILE_BLOOD.

Yes 4 0x000004 PROJECTILE_BOUNCESOFFWALLS Nounce off of all walls, like pipebombs and freezeblasts.
Yes 8 0x000008 PROJECTILE_BOUNCESOFFMIRRORS Bounce off of mirrors only, like shrinker blasts and firelasers.
Yes 16 0x000010 PROJECTILE_KNEE Indicates that the projectile is melee, essentially hitscan with limited range.

It cannot be applied simultaneously with PROJECTILE_HITSCAN, PROJECTILE_RPG, or PROJECTILE_BLOOD.

Yes 32 0x000020 PROJECTILE_WATERBUBBLES Spawn water bubbles (WATERBUBBLE, tile #661) if underwater.
Yes 64 0x000040 PROJECTILE_TIMED If projectile is flagged as an RPG projectile, then this flag will make the projectile disappear.

You have to define the projectile with PROJ_RANGE. 30 units = 1 second. Which is the ammount of time before the projectile will disappear. Keep in mind. If this flag is set, the projectile won't start the spawn option, sound options, and probably a few more options.

Yes 128 0x000080 PROJECTILE_BOUNCESOFFSPRITES Bounce off of sprites.
Yes 256 0x000100 PROJECTILE_SPIT Draw loogies on a player's screen and tint it green if the player is hit by the projectile.
Yes 512 0x000200 PROJECTILE_COOLEXPLOSION1
Yes 1024 0x000400 PROJECTILE_BLOOD Indicates that the projectile is a blood splat, like the hardcoded BLOODSPLAT1 through 4 found in state random_wall_jibs.

It cannot be applied simultaneously with PROJECTILE_HITSCAN, PROJECTILE_RPG, or PROJECTILE_KNEE.

Yes 2048 0x000800 PROJECTILE_LOSESVELOCITY
Yes 4096 0x001000 PROJECTILE_NOAIM The projectile will not automatically aim at any targets
Yes 8192 0x002000 PROJECTILE_RANDDECALSIZE If this flag is set in the PROJ_WORKSLIKE variable, then the projectile will randomize the size of its decals.
Yes 16384 0x004000 PROJECTILE_EXPLODEONTIMER If projectile is an RPG with PROJECTILE_FLAG_TIMED flag set, then it normally wouldn't spawn sounds and more things. To prevent that, use this flag.
Yes 32768 0x008000 PROJECTILE_RPG_IMPACT Setting this flag in the PROJ_WORKSLIKE variable means that the actors\players that are hit by the projectile will receive direct damage in addition to hitradius, making the total damage close to twice PROJ_EXTRA, similar to the hard-coded RPG projectile. The projectile will also add momentum with direct damage, which can be used in conjunction with setting PROJ_HITRADIUS to 0 in order to create an effect like shooting a rock, if you want it to be realistic.
Yes 65536 0x010000 PROJECTILE_RADIUS_PICNUM This flag sets the projectile's picnum to its target's htpicnum instead of the default RADIUSEXPLOSION, or 1670.
Yes 131072 0x020000 PROJECTILE_ACCURATE_AUTOAIM
Yes 262144 0x040000 PROJECTILE_FORCEIMPACT
Yes 524288 0x080000 PROJECTILE_REALCLIPDIST Allows the value of PROJ_CLIPDIST to take effect if set. Otherwise the hardcoded clipdist of 4 takes effect.
Yes 1048576 0x100000 PROJECTILE_ACCURATE
Yes 2097152 0x200000 PROJECTILE_NOSETOWNERSHADE
Yes 4194304 0x400000 PROJECTILE_RPG_IMPACT_DAMAGE