Defineprojectile: Difference between revisions

From EDukeWiki
Jump to navigation Jump to search
One (talk | contribs)
No edit summary
No edit summary
Line 3: Line 3:
Defines a projectile to be fired by the [[shoot]] command and its variants.
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:
To use this command, several things must be done.  Take note of the different settings for projectiles:


define [[PROJ_WORKSLIKE]] 1
*[[PROJ_WORKSLIKE]]
define [[PROJ_SPAWNS]] 2
*[[PROJ_SPAWNS]]
define [[PROJ_SXREPEAT]] 3
*[[PROJ_SXREPEAT]]
define [[PROJ_SYREPEAT]] 4
*[[PROJ_SYREPEAT]]
define [[PROJ_SOUND]] 5
*[[PROJ_SOUND]]
define [[PROJ_ISOUND]] 6
*[[PROJ_ISOUND]]
define [[PROJ_VEL]] 7
*[[PROJ_VEL]]
define [[PROJ_EXTRA]] 8
*[[PROJ_EXTRA]]
define [[PROJ_DECAL]] 9
*[[PROJ_DECAL]]
define [[PROJ_TRAIL]] 10
*[[PROJ_TRAIL]]  
define [[PROJ_TXREPEAT]] 11
*[[PROJ_TXREPEAT]]
define [[PROJ_TYREPEAT]] 12
*[[PROJ_TYREPEAT]]
define [[PROJ_TOFFSET]] 13
*[[PROJ_TOFFSET]]
define [[PROJ_TNUM]] 14
*[[PROJ_TNUM]]
define [[PROJ_DROP]] 15
*[[PROJ_DROP]]
define [[PROJ_CSTAT]] 16
*[[PROJ_CSTAT]]
define [[PROJ_CLIPDIST]] 17
*[[PROJ_CLIPDIST]]
define [[PROJ_SHADE]] 18
*[[PROJ_SHADE]]
define [[PROJ_XREPEAT]] 19
*[[PROJ_XREPEAT]]
define [[PROJ_YREPEAT]] 20
*[[PROJ_YREPEAT]]
define [[PROJ_PAL]] 21
*[[PROJ_PAL]]
define [[PROJ_EXTRA_RAND]] 22
*[[PROJ_EXTRA_RAND]]
define [[PROJ_HITRADIUS]] 23
*[[PROJ_HITRADIUS]]
define [[PROJ_VEL_MULT]] 24
*[[PROJ_VEL_MULT]]
define [[PROJ_OFFSET]] 25
*[[PROJ_OFFSET]]
define [[PROJ_BOUNCES]] 26
*[[PROJ_BOUNCES]]
define [[PROJ_BSOUND]] 27
*[[PROJ_BSOUND]]
define [[PROJ_RANGE]] 28
*[[PROJ_RANGE]]
 
*[[PROJ_FLASH_COLOR]]
 
Second, we must figure out a proper WORKSLIKE flag for our projectile.  The WORKSLIKE flag can be determined by looking at the following defines:


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_BULLET]] 1
  define [[PROJECTILE_FLAG_BULLET]] 1
  define [[PROJECTILE_FLAG_RPG]] 2
  define [[PROJECTILE_FLAG_RPG]] 2
  define [[PROJECTILE_FLAG_BOUNCESOFFWALLS]] 4
  define [[PROJECTILE_FLAG_BOUNCESOFFWALLS]] 4
  define [[PROJECTILE_FLAG_BOUNCESOFFMIRRORS]] 8
  define [[PROJECTILE_FLAG_BOUNCESOFFMIRRORS]] 8
  define [[PROJECTILE_FLAG_KNEE]] 16
  define [[PROJECTILE_FLAG_KNEE]] 16
Line 55: Line 54:
  define [[PROJECTILE_FLAG_RPG_IMPACT]] 32768
  define [[PROJECTILE_FLAG_RPG_IMPACT]] 32768
  define [[PROJECTILE_FLAG_RADIUS_PICNUM]] 65536
  define [[PROJECTILE_FLAG_RADIUS_PICNUM]] 65536
  define [[PROJECTILE_FLAG_ACCURATE_AUTOAIM]] 131072
  define [[PROJECTILE_FLAG_ACCURATE_AUTOAIM]] 131072
 


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]], [[PROJECTILE_FLAG_RPG]] or [[PROJECTILE_FLAG_KNEE]] must be part of your WORKSLIKE flag.
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]], [[PROJECTILE_FLAG_RPG]] or [[PROJECTILE_FLAG_KNEE]] must be part of your WORKSLIKE flag.


Here is an example of a working user-defined projectile:
Here is an example of a working user-defined projectile:
Line 74: Line 71:
  defineprojectile 1653 [[PROJ_CLIPDIST]] 24
  defineprojectile 1653 [[PROJ_CLIPDIST]] 24
  defineprojectile 1653 [[PROJ_TRAIL]] SMALLSMOKE
  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.
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.
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]].
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]].

Revision as of 15:55, 17 June 2009

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:

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_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
define PROJECTILE_FLAG_RADIUS_PICNUM		65536
define PROJECTILE_FLAG_ACCURATE_AUTOAIM	131072

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, 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.