Defineprojectile

From EDukeWiki
Revision as of 08:38, 24 September 2005 by TX (talk | contribs)
Jump to navigation Jump to search

defineprojectile <tilenum> <function> <value>

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

To use this command, several things must be done. First, include the following defines somewhere before your defineprojectile lines:

define PROJ_WORKSLIKE 1

define PROJ_SPAWNS 2

define PROJ_SXREPEAT 3

define PROJ_SYREPEAT 4

define PROJ_SOUND 5

define PROJ_ISOUND 6

define PROJ_VEL 7

define PROJ_EXTRA 8

define PROJ_DECAL 9

define PROJ_TRAIL 10

define PROJ_TXREPEAT 11

define PROJ_TYREPEAT 12

define PROJ_TOFFSET 13

define PROJ_TNUM 14

define PROJ_DROP 15

define PROJ_CSTAT 16

define PROJ_CLIPDIST 17

define PROJ_SHADE 18

define PROJ_XREPEAT 19

define PROJ_YREPEAT 20

define PROJ_PAL 21

define PROJ_EXTRA_RAND 22

define PROJ_HITRADIUS 23

define PROJ_VEL_MULT 24

define PROJ_OFFSET 25

define PROJ_BOUNCES 26

define PROJ_BSOUND 27

define PROJ_RANGE 28


Second, we must figure out a proper WORKSLIKE flag for our projectile. The WORKSLIKE flag can be determined by looking at the following defines:


define PROJECTILE_FLAG_BULLET 1

define PROJECTILE_FLAG_RPG 2

define PROJECTILE_FLAG_BOUNCESOFFWALLS 4

define PROJECTILE_FLAG_BOUNCESOFFMIRRORS 8

define PROJECTILE_FLAG_KNEE 16

define PROJECTILE_FLAG_WATERBUBBLES 32

define PROJECTILE_FLAG_TIMED 64

define PROJECTILE_FLAG_NOENEMYHITS 128

define PROJECTILE_FLAG_SPIT 256

define PROJECTILE_FLAG_COOLEXPLOSION1 512

define PROJECTILE_FLAG_BLOOD 1024

define PROJECTILE_FLAG_LOSESVELOCITY 2048

define PROJECTILE_FLAG_NOAIM 4096

define PROJECTILE_FLAG_RANDDECALSIZE 8192

define PROJECTILE_FLAG_EXPLODEONTIMER 16384

define PROJECTILE_FLAG_RPG_IMPACT 32768


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_BULLET or PROJECTILE_FLAG_RPG must be part of your WORKSLIKE flag.


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.

Please take care not to set a projectile's velocity over 1000. Instead, set PROJ_VELMULT and a lower PROJ_VEL.