User Tools

Site Tools


fire_projectile

This is an old revision of the document!


Fire Projectile


Fires a projectile from a source entity or coordinate at a target entity, coordinate, or direction. If the source is an entity, the target is optional and, if omitted in this case, the projectile will be fired in the direction in which the source entity is currently facing.

Signature:

fire_projectile(item_id, source, target, entity_id)
ArgumentDescriptionTypeRequired
item_idID of the item to fire (as defined in the Item Editor). The item must have the “Projectile” setting enabled.StringYes
sourceSource entity or coordinate from which the projectile will be fired.Entity, CoordinateYes
targetTarget entity or coordinate at which the projectile will be fired, or cardinal direction in which it will be fired. A target is required if the source is a coordinate. If the source is an entity and no target is specified, the projectile will be fired in the direction that the entity is currently facing.Entity, Coordinate, Cardinal DirectionYes/No
entity_idUnique entity ID that the projectile will be assigned.StringNo

Example:

fire_projectile("ITEM_0001", entity["arrow_wall"], player);

Results:

Use the Fire Projectile function to trigger a trap when the player steps on a tile while exploring a dungeon, firing an arrow from the wall in their direction.


Editor Node:

fire_projectile.1740262612.txt.gz · Last modified: 2025/02/22 14:16 by justin