Test: Difference between revisions

From EDukeWiki
Jump to navigation Jump to search
Fox (talk | contribs)
Fox (talk | contribs)
No edit summary
Line 68: Line 68:
|-
|-
| '''PROJ_EXTRA''' ||  
| '''PROJ_EXTRA''' ||  
Used to set the damage strength of a projectile. <extra> is the damage strength.
Negative numbers do not work to create a healing projectile. You must set this value to 0 and have the actor that is hit manually add health back to itself.
|-
|-
| '''PROJ_EXTRA_RAND''' ||  
| '''PROJ_EXTRA_RAND''' ||  
<value> is a random value added to a projectile damage. By default it is 5, meaning that a SHOTGUN projectile (which damage is defined as 10 in USER.CON) will make cause a damage of 10 to 15.
Setting it to zero should cause the projectile to inflict the precise damage defined by [[PROJ_EXTRA]].
|-
|-
| '''PROJ_DROP''' ||  
| '''PROJ_DROP''' || Used to set the rate at which the projectile drops (arcs). <drop> is the speed of the projectile's dropping. Note that a negative number is needed for it to move toward the ground.
|-
|-
| '''PROJ_CSTAT''' ||  
| '''PROJ_CSTAT''' || Used to set the [[cstat (sprite)|cstat]] flag(s) of the projectile. <cstat> is the [[cstat (sprite)|cstat]] flag(s) of the projectile.
|-
|-
| '''PROJ_CLIPDIST''' ||  
| '''PROJ_CLIPDIST''' || The [[clipdist]] of the projectile.
|-
|-
| '''PROJ_SHADE''' ||  
| '''PROJ_SHADE''' || The [[shade]] of the projectile.
|-
|-
| '''PROJ_XREPEAT''' ||  
| '''PROJ_XREPEAT''' || Used to set the [[xrepeat]] of the projectile. <xrepeat> is the size you wish to set the projectile's x to. For hitscan type projectiles this determines the x size of the decal.
|-
|-
| '''PROJ_YREPEAT''' ||  
| '''PROJ_YREPEAT''' || Used to set the [[yrepeat]] of the projectile. <yrepeat> is the size you wish to set the projectile's y to. For hitscan type projectiles this determines the y size of the decal.
|-
|-
| '''PROJ_PAL''' ||  
| '''PROJ_PAL''' || Used to set the [[pal|palette reference (or color)]] of the projectile. <pal> is the palette reference of the projectile.
 
See [[pal]] for more information about palette swaps.
|-
|-
| '''PROJ_HITRADIUS''' ||  
| '''PROJ_HITRADIUS''' || The distance at which [[sprite|sprites]] or certain hitscanning [[wall|walls]] will be affected by the [[hitradius]] of the projectile. If set to a value lower than 1, no hitradius will be generated.
|-
|-
| '''PROJ_OFFSET''' ||  
| '''PROJ_OFFSET''' || Sets the x offset of the projectile fired. As the numbers get higher, the projectile's initial position will move further to the left.
 
A value of 224 will make the projectile spawn at the "right hand" (for example Battlelord morters). To make it spawn centered, use a value of 14354.
|-
|-
| '''PROJ_BOUNCES''' ||  
| '''PROJ_BOUNCES''' || Number of times the projectile will bounce off of walls before destruction.  Will only count wall bounces even if [[PROJECTILE_FLAG_BOUNCESOFFSPRITES]] is included in the [[PROJ_WORKSLIKE]] flag.
Only works for RPG-type projectiles.
|-
|-
| '''PROJ_BSOUND''' ||  
| '''PROJ_BSOUND''' || The sound that will play when the projectile bounces. Defaults to PIPEBOMB_BOUNCE.
|-
|-
| '''PROJ_RANGE''' ||  
| '''PROJ_RANGE''' || When '''PROJ_WORKSLIKE''' is a [[hitscan]] type projectile ([[PROJECTILE_FLAG_KNEE]] or [[PROJECTILE_FLAG_HITSCAN]]) this number must be equal to the desired range in [[BUILD]] units. For example if the range is 1024 it will travel exactly one square in the largest grid size.
 
If '''PROJ_WORKSLIKE''' is an rpg type ([[PROJECTILE_FLAG_RPG]]) this number is amount of time (in ticks) that a projectile travels before expiring.  For example, if a projectile has a range of 60, then it will last for exactly two seconds before dying. This works together with [[PROJECTILE_FLAG_TIMED]] and [[PROJECTILE_FLAG_EXPLODEONTIMER]].
|-
|-
| '''PROJ_FLASH_COLOR''' ||  
| '''PROJ_FLASH_COLOR''' || Used to set the color (if any) of a Polymer light. <flash color> is the color of the light.
 
The number can be determined from RGB color values by adding the red value plus the green value shifted left 8 bits plus the blue value shifted left 16 bits. So, RGB of 100, 100, 100 would be 6579300 = 100 + 100<<8 + 100<<16 = 100 + 25600 + 6553600. 150, 100, 255 would be 16737380.
|-
|-
|}
|}

Revision as of 10:36, 21 February 2020

Test 1

defineprojectile <tilenum> PROJ_WORKSLIKE <flag value>

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.

Add all the desired flags together, and use that value for <flag value>. This works similar to cstat.

defineprojectile <tilenum> PROJ_SPAWNS <spawn tilenum>

Used to spawn an actor on impact.

Set <spawn tilenum> to -1 to spawn nothing, otherwise <spawn tilenum> defaults to SMALLSMOKE.

Doesn't work with bullet-type projectiles fired by actors other than the player.

defineprojectile <tilenum> PROJ_SXREPEAT <spawn xrepeat>

Used to set the x size of an actor spawned on impact.

Where <spawn xrepeat> is the size you wish to set the spawned actor's x to.

Test 2

PROJ_WORKSLIKE Used to set flags for projectile function. Add all the desired flags together, and use that value for <flag value>. This works similar to cstat.

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.

PROJ_SPAWNS Used to spawn an actor on impact. Set <value> to -1 to spawn nothing, otherwise <value> defaults to SMALLSMOKE.

Doesn't work with bullet-type projectiles fired by actors other than the player.

PROJ_SXREPEAT Used to set the x size of an actor spawned on impact. <value> is the size you wish to set the spawned actor's x to.
PROJ_SYREPEAT Used to set the y size of an actor spawned on impact. <value> is the size you wish to set the spawned actor's y to.
PROJ_DECAL Used to set the tilenum of any decal spawned by the projectile, i.e. bullet holes. <decal tilenum> is the tilenum of the decal used. Only works with bullet projectiles.

Doesn't work with bullet type projectiles fired by actors other than players.

PROJ_TRAIL Used to set the tilenum of any trail sprites spawned. <trail tilenum> is the tilenum of the trail sprites spawned.
PROJ_TXREPEAT The x size of the trail used by the projectile. Note that if the trail is an actor with a size specified in its code (e.g. by a sizeat command) then the specified size will override the one you give it.
PROJ_TYREPEAT The y size of the trail used by the projectile. Note that if the trail is an actor with a size specified in its code (e.g. by a sizeat command) then the specified size will override the one you give it.
PROJ_TOFFSET The y offset of the trail spawned by the PROJ_TRAIL variable. Positive numbers move the sprite down.
PROJ_TNUM The maximum number of trails that an individual projectile can spawn. By default, RPG (non-hitscan) type projectiles will spawn trails even if TNUM is not set. But bullet type (hitscan) projectiles will not spawn any trails unless TNUM is given a non-zero value.

The way it works, is that if TNUM value is set to 2, then it will spawn 2 of the sprites on the same location. The default value is 1 if a trail is set for the projectile.

PROJ_SOUND Used to play a sound when a projectile is fired. For bullet projectiles this is the sound played on impact. <fire sound> is the name of the sound you wish to play.
PROJ_ISOUND Used to play a sound when a projectile impacts a surface. This is ignored on bullet-type projectiles. <impact sound> is the name of the sound you wish to play.

Set PROJ_ISOUND to -1 to disable impact sounds.

PROJ_VEL Used to set the velocity of a projectile. <velocity> is the speed of the projectile. Values over 1000 are not encouraged. Use PROJ_VEL_MULT to go at higher speeds.
PROJ_VEL_MULT Used to set multiply velocity of a projectile (causes an artificial acceleration). <velocity multiplier> is the amount to multiply by.

On a given tic the projectile will move PROJ_VEL_MULT times, for example, if you set PROJ_VEL_MULT to 1, it will only move at its current velocity (stored in its sprite's xvel / zvel) once per tic.

PROJ_EXTRA

Used to set the damage strength of a projectile. <extra> is the damage strength.

Negative numbers do not work to create a healing projectile. You must set this value to 0 and have the actor that is hit manually add health back to itself.

PROJ_EXTRA_RAND

<value> is a random value added to a projectile damage. By default it is 5, meaning that a SHOTGUN projectile (which damage is defined as 10 in USER.CON) will make cause a damage of 10 to 15.

Setting it to zero should cause the projectile to inflict the precise damage defined by PROJ_EXTRA.

PROJ_DROP Used to set the rate at which the projectile drops (arcs). <drop> is the speed of the projectile's dropping. Note that a negative number is needed for it to move toward the ground.
PROJ_CSTAT Used to set the cstat flag(s) of the projectile. <cstat> is the cstat flag(s) of the projectile.
PROJ_CLIPDIST The clipdist of the projectile.
PROJ_SHADE The shade of the projectile.
PROJ_XREPEAT Used to set the xrepeat of the projectile. <xrepeat> is the size you wish to set the projectile's x to. For hitscan type projectiles this determines the x size of the decal.
PROJ_YREPEAT Used to set the yrepeat of the projectile. <yrepeat> is the size you wish to set the projectile's y to. For hitscan type projectiles this determines the y size of the decal.
PROJ_PAL Used to set the palette reference (or color) of the projectile. <pal> is the palette reference of the projectile.

See pal for more information about palette swaps.

PROJ_HITRADIUS The distance at which sprites or certain hitscanning walls will be affected by the hitradius of the projectile. If set to a value lower than 1, no hitradius will be generated.
PROJ_OFFSET Sets the x offset of the projectile fired. As the numbers get higher, the projectile's initial position will move further to the left.

A value of 224 will make the projectile spawn at the "right hand" (for example Battlelord morters). To make it spawn centered, use a value of 14354.

PROJ_BOUNCES Number of times the projectile will bounce off of walls before destruction. Will only count wall bounces even if PROJECTILE_FLAG_BOUNCESOFFSPRITES is included in the PROJ_WORKSLIKE flag.

Only works for RPG-type projectiles.

PROJ_BSOUND The sound that will play when the projectile bounces. Defaults to PIPEBOMB_BOUNCE.
PROJ_RANGE When PROJ_WORKSLIKE is a hitscan type projectile (PROJECTILE_FLAG_KNEE or PROJECTILE_FLAG_HITSCAN) this number must be equal to the desired range in BUILD units. For example if the range is 1024 it will travel exactly one square in the largest grid size.

If PROJ_WORKSLIKE is an rpg type (PROJECTILE_FLAG_RPG) this number is amount of time (in ticks) that a projectile travels before expiring. For example, if a projectile has a range of 60, then it will last for exactly two seconds before dying. This works together with PROJECTILE_FLAG_TIMED and PROJECTILE_FLAG_EXPLODEONTIMER.

PROJ_FLASH_COLOR Used to set the color (if any) of a Polymer light. <flash color> is the color of the light.

The number can be determined from RGB color values by adding the red value plus the green value shifted left 8 bits plus the blue value shifted left 16 bits. So, RGB of 100, 100, 100 would be 6579300 = 100 + 100<<8 + 100<<16 = 100 + 25600 + 6553600. 150, 100, 255 would be 16737380.