fuaZandroX modding reference

Actor size properties in ACS

Five SetActorProperty / GetActorProperty / CheckActorProperty properties that change an actor's size at runtime — its physical collision box, and its attack hitbox.

Property Id Meaning
APROP_Height 35 Physical height (collision).
APROP_Radius 36 Physical radius (collision), as a half-width.
APROP_HitRadius 50 Attack-hitbox radius. 0 = fall back to APROP_Radius.
APROP_HitHeight 51 Attack-hitbox height. 0 = fall back to APROP_Height.
APROP_FUA_HitSides 62 Attack-hitbox outline, fua_HitSides. Reads 4 for the square; setting 0 returns to it.

Availability

ZandroX. APROP_Height and APROP_Radius were already readable in Zandronum; writing them is new here. APROP_HitRadius and APROP_HitHeight are entirely new.

APROP_Height and APROP_Radius keep the ids UZDoom/GZDoom use. Ids 42–49 are deliberately left unused to match upstream's properties that ZandroX does not implement yet, so ACS written against UZDoom's constants stays valid here.

Values are fixed-point

The four sizes take and return fixed-point map units, not integers — the same convention as APROP_ScaleX and APROP_MeleeRange. Write 32.0, not 32. APROP_FUA_HitSides is the exception: it is a count of sides, so write 8.

SetActorProperty(tid, APROP_Radius, 32.0);   // correct — 32 map units
SetActorProperty(tid, APROP_Radius, 32);     // wrong — a hair over 0.0004 units

The integer form does not error. It sets a radius so small the actor is effectively a point, which is a confusing bug to chase.

GetActorProperty returns the same fixed-point form, so it round-trips.

The two fork-specific constants

APROP_HitRadius and APROP_HitHeight are ZandroX additions, declared in zt-bcc's zcommon.bcs and, for ACC, in fua.acs (Compiling ACS). Stock acc's zcommon.acs lacks them: include fua.acs in its place rather than defining them yourself, as a second definition beside fua.acs stops ACC.

APROP_FUA_HitSides is newer than both headers, so for now define it yourself: #define APROP_FUA_HitSides 62. Drop that line once your header declares it.

Behaviour

Setting a size relinks the actor. The blockmap links and touching-sector list depend on the radius, so both are rebuilt for you. For a player, the standing height used by the per-tic crouch calculation is updated too, so the new height is not overwritten on the next tic.

Setting the same value is a no-op. Each property checks whether the value actually differs before doing any work, so polling a script that writes an unchanged size costs nothing.

There is no position test. This is the one real difference from A_SetSize, which offers a testpos argument that reverts a resize the actor no longer fits into. Enlarging an actor that is standing in a doorway will leave it stuck inside the geometry, and ordinary movement will not free it. Use fua_SetActorSize with testpos when that matters.

Physical size is replicated; the attack hitbox is not. APROP_Radius and APROP_Height changes are broadcast to clients, and late joiners get the current values. APROP_HitRadius, APROP_HitHeight and APROP_FUA_HitSides are server-authoritative and deliberately not sent, so clients keep the class default — damage stays correct because the server decides hits, but anything a client draws from the attack box (notably crosshair target identification) will disagree. See A_SetHitSize for the full picture.

Size and place by handle

Two functions take an actor handle and set the size or the place directly:

Function Number Returns
fua_SetActorSize(h, radius, height [, testpos]) 24037 true; false for no actor, or with testpos where the actor wouldn't fit, which undoes the change
fua_SetActorOrigin(h, x, y, z [, flags]) 24036 true; false for no actor, or with FUA_ORIGIN_TESTFIT where the actor doesn't fit

fua_SetActorSize is A_SetSize for ACS: both dimensions at once, a negative one kept as it is.

fua_SetActorOrigin differs from SetActorPosition in what it is for:

SetActorPosition(tid, x, y, z, fog) fua_SetActorOrigin(h, x, y, z [, flags])
Where the actor doesn't fit moves it back, returns false moves it anyway; FUA_ORIGIN_TESTFIT (1) returns false
Drawing jumps to the new place slides there over the tic, so a script moving it every tic moves it smoothly; FUA_ORIGIN_NOINTERP (2) jumps
Teleport fog optional none
In a netgame whole map units the exact place

Use SetActorPosition to teleport something that has to land somewhere free, and fua_SetActorOrigin for scripted motion: a camera on a rail, a platform's passengers, an object carried along.

In a netgame the server's changes reach every client and players who join later. A CLIENTSIDE script's changes stay on its own machine.

#library "fuacarry"
#import "zcommon.bcs"

// The activator carries the barrel with tid 40 a little ahead of it for a second.
script "Carry" ( void ) {
   int barrel = fua_GetActorHandle( 40 );
   fua_SetActorSize( barrel, 8.0, 24.0 );
   Log( s: "carrying" );
   for ( int i = 0; i < 35; i++ ) {
      fua_SetActorOrigin( barrel, GetActorX( 0 ) + 48.0, GetActorY( 0 ), GetActorZ( 0 ) + 16.0 );
      Delay( 1 );
   }
}

Examples

A script that inflates a boss into a larger target as its health drops, without touching its collision box, so the arena still plays the same:

#include "fua.acs"

script "BossPhase" (int tid, int phase)
{
    if (phase >= 2)
    {
        SetActorProperty(tid, APROP_HitRadius, 72.0);
        SetActorProperty(tid, APROP_HitHeight, 96.0);
    }
    else
    {
        // 0 clears the override, so the hitbox tracks the physical box again.
        SetActorProperty(tid, APROP_HitRadius, 0);
        SetActorProperty(tid, APROP_HitHeight, 0);
    }
}

Growing an actor's real collision box, checking the room first because ACS will not check it for you. CheckActorProperty reads back the value that was actually applied:

script "Embiggen" (int tid)
{
    SetActorProperty(tid, APROP_Radius, 48.0);
    SetActorProperty(tid, APROP_Height, 96.0);

    if (!CheckActorProperty(tid, APROP_Radius, 48.0))
        Log(s:"resize did not take");
}

Reading a size back and halving it — note the fixed-point arithmetic:

    int r = GetActorProperty(tid, APROP_Radius);
    SetActorProperty(tid, APROP_Radius, r / 2);

See also