BasicProjectile
is an actor that can be inherited from to get an actor that will receive projectile team colors and acts as a projectile, colliding on terrain and other actors, making it a good starting step for a projectile.
If your projectile has a speed
higher than 60, you should use [BasicFastProjectile](<https://mm8bdm.notion.site/BasicFastProjectile-46b999123b704437822c07226eff796d>)
instead!
<aside> 🚨 Wait! Stop! Before you copy this actor's definition into your mod, remember the following things:
actor BasicProjectile : ProjSpawnFuncActor
{
PROJECTILE
damagetype "Buster"
Obituary "%o told %k they forgot the obituary. (BasicProjectile)"
Speed 27
Damage (5000)
radius 5
height 5
scale 2.5
States
{
Spawn:
BUST A 1
wait
}
}
These are user variables that can be added to the actor for various effects. You do not need to give them a value, they just must be defined.
var int user_NoTranslation
- Disables projectile team colors on this actor
var int user_TranslateWhiteColors
- Allows projectile team colors to recolor white.
var int user_TranslateBlackColors
- Allows projectile team colors to recolor black.
var int user_PierceRipper
- Makes it so that this actor only does damage once to another actor. The actor being damaged must have +USEDAMAGEEVENTSCRIPT
, like players already do.
A_GiveInventory("PierceRipperLimit", x)
in the Spawn
state of the actor.var int user_DamageKill
- Makes it so that this actor only does damage once before entering Death
state. The actor that is being damaged must have +USEDAMAGEEVENTSCRIPT
, like players already do. The actor with this flag must also have reactiontime
set.
reactiontime
value. A projectile with reactiontime 3
will only be able to damage 3 times to any players before dying.var int user_noOwnerDamage
- If the actor has the +SHOOTABLE
actor flag, the +USEDAMAGEEVENTSCRIPT
actor flag, and a health
value, this property will prevent the owner of the actor as well as their teammates from dealing damage to it.
Here is the projectile actor that Hard Knuckle uses in MM8BDM.
actor HardKnuckle : BasicProjectile
{
damagetype "HardKnuckle"
Obituary "$OB_HARDKNUCKLE"
Speed 38
Radius 12
Height 10
Damage (75)
States
{
Spawn:
HARD A 3
loop
Death:
TNT1 A 0 A_SpawnItemEx("ExplosionEffect1", 0, 0, 0, 0, 0, 0, 0, SXF_WEPFXCOLOR)
stop
}
}