Patch features
New flag: SXF_TRANSFERTID
Effect: Copy the spawning actor's TID to the spawned actor.
New flag: SXF_LOSETID
Effect: Clear the spawning actor's TID if the spawning was successful. This occurs after the effect of SXF_TRANSFERTID.
Presumed bug, fixed:
The post-processing on the spawned actor checks that an actor was actually spawned, but the success state for the function does not require an actor to have been spawned.
If Spawn() fails, there is no object for post-processing, and no spawned actor, but the result is set to success.
If InitSpawnedObject(I think that's its name) fails, post-processing occurs (probably quite unnecessary, the actor is removed before it can have any effect) but the result state is set correctly.
I changed success state and post processing both to depend on successful creation and initialisation of spawned actor.
Patch 2 adds another enhancement to the function:
New flag: SXF_THINGSPEED
Effect: The speeds set on the spawned thing are multiplied with its normal speed, so that a speed vector of [1.0,0,0] means moving straight ahead at normal speed.
Benefits: Allows you to use A_SpawnItemEx to create moving actors without having to let the spawning actor decide the actual speed.
This short decorate sample does very little work with the feature, but it's something.
Code: Select all
actor TestImp : DoomImp replaces DoomImp
{
states
{
Missile:
TROO EF 8 A_FaceTarget
TROO G 6 A_SpawnItemEx("DoomImpBall", 300,0,40, -1, 0, 0, 0, SXF_THINGSPEED)
Goto See
}
}
UPDATE: SXF_TRANSFERSCALE was suggested. http://forum.zdoom.org/viewtopic.php?f=15&t=32566