Defineprojectile: Difference between revisions

From EDukeWiki
Jump to navigation Jump to search
Fox (talk | contribs)
No edit summary
Fox (talk | contribs)
Line 15: Line 15:
To use this command, several things must be done.  Take note of the different settings for projectiles:
To use this command, several things must be done.  Take note of the different settings for projectiles:


<div style="column-count:2;-moz-column-count:2;">
*[[PROJ_WORKSLIKE]]
*[[PROJ_WORKSLIKE]]
*[[PROJ_SPAWNS]]
*[[PROJ_SPAWNS]]
Line 44: Line 45:
*[[PROJ_RANGE]]
*[[PROJ_RANGE]]
*[[PROJ_FLASH_COLOR]]
*[[PROJ_FLASH_COLOR]]
</div>


== Examples ==
== Examples ==

Revision as of 05:02, 21 February 2020

defineprojectile <tilenum> <function> <value>

Defines a projectile to be fired by the shoot command and its variants.

First, we must figure out a proper WORKSLIKE flag for our projectile.

To determine the proper WORKSLIKE flag for your projectile, simply add the numbers for the various functions you'd like your projectile to have together. Obviously, some flags are not compatible. Note that either PROJECTILE_FLAG_HITSCAN, PROJECTILE_FLAG_RPG or PROJECTILE_FLAG_KNEE must be part of your WORKSLIKE flag.

If the velocity is too high (usually over 1000), clipping errors may increse drastically. Instead, set PROJ_VELMULT and a lower PROJ_VEL.

To be able to use the ifwasweapon with custom RPG-type projectiles (PROJ_WORKSLIKE includes bit 2), make sure to include the PROJECTILE_FLAG_RPG_IMPACT flag (32768) in PROJ_WORKSLIKE.

Functions

To use this command, several things must be done. Take note of the different settings for projectiles:

Examples

Here is an example of a working user-defined projectile:

defineprojectile 1653 PROJ_WORKSLIKE 6150
defineprojectile 1653 PROJ_SPAWNS EXPLOSION2
defineprojectile 1653 PROJ_VEL 1000
defineprojectile 1653 PROJ_EXTRA 300
defineprojectile 1653 PROJ_DROP -200
defineprojectile 1653 PROJ_ISOUND PIPEBOMB_EXPLODE
defineprojectile 1653 PROJ_HITRADIUS 2560
defineprojectile 1653 PROJ_BOUNCES 5
defineprojectile 1653 PROJ_OFFSET 224
defineprojectile 1653 PROJ_CLIPDIST 24
defineprojectile 1653 PROJ_TRAIL SMALLSMOKE

In this example, the projectile has the following WORKSLIKE flags set: PROJECTILE_FLAG_NOAIM, PROJECTILE_FLAG_LOSESVELOCITY, PROJECTILE_FLAG_RPG and PROJECTILE_FLAG_BOUNCESOFFWALLS. This gives us an RPG-like projectile that doesn't automatically aim at enemies/players (we need this because the projectile in question fires in an arc), automatically slows down during flight, fires like an RPG and bounces off the walls.