Defineprojectile - EDukeWiki

# Defineprojectile

From EDukeWiki
Revision as of 09:50, 2 April 2011 by Rasmusthorup (talk | contribs)

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. Take note of the different settings for projectiles:

- PROJ_WORKSLIKE
- PROJ_SPAWNS
- PROJ_SXREPEAT
- PROJ_SYREPEAT
- PROJ_DECAL
- PROJ_TRAIL
- PROJ_TXREPEAT
- PROJ_TYREPEAT
- PROJ_TOFFSET
- PROJ_TNUM
- PROJ_SOUND
- PROJ_ISOUND
- PROJ_VEL
- PROJ_VEL_MULT
- PROJ_EXTRA
- PROJ_EXTRA_RAND
- PROJ_DROP
- PROJ_CSTAT
- PROJ_CLIPDIST
- PROJ_SHADE
- PROJ_XREPEAT
- PROJ_YREPEAT
- PROJ_PAL
- PROJ_HITRADIUS
- PROJ_OFFSET
- PROJ_BOUNCES
- PROJ_BSOUND
- PROJ_RANGE
- PROJ_FLASH_COLOR

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

    define PROJECTILE_FLAG_HITSCAN                     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_BOUNCESOFFSPRITES           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
    define PROJECTILE_FLAG_RADIUS_PICNUM               65536
    define PROJECTILE_FLAG_ACCURATE_AUTOAIM            131072
    define PROJECTILE_FLAG_FORCEIMPACT                 262144
    define PROJECTILE_FLAG_REALCLIPDIST                524288
    define PROJECTILE_FLAG_ACCURATE                    1048576

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.

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.

Take care not to set a projectile's velocity over 1000. 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.

Retrieved from "http://wiki.eduke32.com/w/index.php?title=Defineprojectile&oldid=9670"
Categories:

- EDuke32 specific commands
- Projectile manipulation