User Tools

Site Tools


cw4:cmod:docs:f246c1a6-358c-4ddc-b7c9-0826ed5bf8d6

Index

[FPS ADVANCED TRAPS] [Trigger] Creeper Spawn Trap

CreeperSpawnTrap

A trigger entity. When activated, it sets creeper in a radius around itself. Outside of the editor, this unit is invisible.

When it receives a ItemCollected message, which is broadcast by certain units such as a Switch or a InfocacheController, it will check if any variable in the list given by the InfocacheID variable matches any variable given by the ItemCollected message. Should the check succeed, this unit will activate once per successful check. By default it has one use so after successfully activating once, the unit will delete itself.

For example, if a Switch broadcasts its UID of 416 in ItemCollected, and the InfocacheID includes 416 in the list as well, it will match and succeed, and this unit will activate and set creeper in its radius. If another switch with a UID of 574 broadcasts its UID in ItemCollected and InfocacheID does not include 574 in the list, it fails and the unit will not activate and create creeper. If, however, InfocacheID is modified to “416,574”, either switch will succeed the check as their UID is included somewhere in the list.

Variables

Radius: An integer. Defines the radius, NOT THE DIAMETER, that it can set creeper in. Due to technicalities a radius of 0 will spawn creeper only on its cell, 1 radius will spawn creeper in a 3×3 grid, 2 radius will spawn creeper in a 5×5 grid, and so on.

Square: An integer meant to be treated as a boolean. When set to 1, it will set creeper in a square area when activated. Otherwise, it will set creeper in a circular area.

Amt: An integer. Defines the amount of creeper to set each cell in radius to.

InfocacheID: A string that becomes split into a list when whitespace characters or commas are used. This defines what strings or values can trigger this entity when it receives a ItemCollected message. Most broadcasting entities use their UID for the data of ItemCollected, but some units may use a special variable for the data of the message instead.

Uses: An integer. Defines how many times this unit can be activated. Decrements by 1 each time this unit is activated. If it hits 0, the unit will delete itself as it most likely is no longer needed and saves resources. Set to -1 or lower if you want this unit to have infinite uses.

Index

cw4/cmod/docs/f246c1a6-358c-4ddc-b7c9-0826ed5bf8d6.txt · Last modified: 2024/03/19 20:09 by Kaiden