Difference between revisions of "PROJ WORKSLIKE"

From EDukeWiki
Jump to navigation Jump to search
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 Label Description
Yes 1 PROJECTILE_HITSCAN Indicates that the projectile is hitscan.

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

Yes 2 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 PROJECTILE_BOUNCESOFFWALLS Nounce off of all walls, like pipebombs and freezeblasts.
Yes 8 PROJECTILE_BOUNCESOFFMIRRORS Bounce off of mirrors only, like shrinker blasts and firelasers.
Yes 16 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 PROJECTILE_WATERBUBBLES Spawn water bubbles (WATERBUBBLE, tile #661) if underwater.
Yes 64 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 PROJECTILE_BOUNCESOFFSPRITES Bounce off of sprites.
Yes 256 PROJECTILE_SPIT Draw loogies on a player's screen and tint it green if the player is hit by the projectile.
Yes 512 PROJECTILE_COOLEXPLOSION1
Yes 1024 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 PROJECTILE_LOSESVELOCITY
Yes 4096 PROJECTILE_NOAIM The projectile will not automatically aim at any targets
Yes 8192 PROJECTILE_RANDDECALSIZE If this flag is set in the PROJ_WORKSLIKE variable, then the projectile will randomize the size of its decals.
Yes 16384 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 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 PROJECTILE_RADIUS_PICNUM This flag sets the projectile's picnum to its target's htpicnum instead of the default RADIUSEXPLOSION, or 1670.
Yes 131072 PROJECTILE_ACCURATE_AUTOAIM
Yes 262144 PROJECTILE_FORCEIMPACT
Yes 524288 PROJECTILE_REALCLIPDIST Allows the value of PROJ_CLIPDIST to take effect if set. Otherwise the hardcoded clipdist of 4 takes effect.
Yes 1048576 PROJECTILE_ACCURATE
Yes 2097152 PROJECTILE_NOSETOWNERSHADE
Yes 4194304 PROJECTILE_RPG_IMPACT_DAMAGE