SetActorX
SetActorY
SetActorZ
SetActorAngle
think of the possiblilities of these command

Moderator: GZDoom Developers
Code: Select all
// not tested
#define SPOTTID 777
Spawn("MapSpot", x, y, z, SPOTTID);
Thing_Move(actortid, SPOTTID);
Thing_Remove(SPOTTID);
Biff wrote:You could "fake" that effect by using thing_remove on the actor, followed by the spawn command to re-create the same actor at a chosen x,y,z.
Code: Select all
script 1 open // side scrolling camera
{
Thing_changeTID(0, playernumber()+1111);
int playerposX = getactorX(1111);
spawn(T_ROCKET, playerposX, -896, 50, 7, 90);
changecamera(7,1,0);
Thing_Remove(7);
delay(1);
restart;
}
Code: Select all
script 1 open // side scrolling camera
{
Thing_changeTID(0, playernumber()+1111);
int playerposX = getactorX(1111);
changecamera(7,1,0);
SetActorX(7, playerposX);
delay(1);
restart;
}
i agree with it all hehGraf Zahl wrote:Internally it is an awful hack with a massive amount of overhead. It may be only 2 lines of code but you can't:
- move an actor you don't know the type of
- move an animated actor without screwing up the animation
- move anything that plays a sound
- move anything that maintains internal status variables
So yes, such functions would be highly appreciated.
I guess I just don't understand what this guy wants. My answer to your four points above is:Graf Zahl wrote:... It may be only 2 lines of code but you can't:
- move an actor you don't know the type of
- move an animated actor without screwing up the animation
- move anything that plays a sound
- move anything that maintains internal status variables
So yes, such functions would be highly appreciated.
If you remove and respawn an object the sound can not be transfered to the new object.Biff wrote:Randomly spawned types, for example or some general code to move objects.- I assumed that the actor would be moved by TID. How could you not know the type, if you were plannning on moving something?
ThrustThing doesn't spawn a new object. But imagine moving a torch with your method: Each time the torch moves the animation will restart.- I've moved monsters before, by thrust thing, and nothing screws up. Thing remove and spawn don't upset animation as far as my experiments go.
- Yes you can move a monster that makes a sound, no problem.