ACS suggestions
Moderator: GZDoom Developers
-
- Posts: 43
- Joined: Sun Dec 05, 2004 1:35 pm
ACS suggestions
I looked through the wiki and found no way to place actors through acs in XYZ positionsm which i find the need for alot for project Malice and i was wondering if these four commands could be added
SetActorX
SetActorY
SetActorZ
SetActorAngle
think of the possiblilities of these command
SetActorX
SetActorY
SetActorZ
SetActorAngle
think of the possiblilities of these command
This can already be done. Use the ACS spawn command:
Spawn
From the ZDoom Documentation Project
void Spawn(str actorclass, fixed x, fixed y, fixed z, int tid, int angle);
actorclass: type of actor you want to spawn (these are case sensitive)
x, y and z: map coordinates of where the thing should spawn. Note that these must be decimal numbers (ie, 1.0 and not 1) and z should be the absolute z coordinate, and not relative to the sector.
tid: (optional) tid you want to give the thing
angle: (optional) byte angle the thing spawns at
Spawns an actor...
Spawn is independent of map spots, so you need to specify what coordinates the actor will spawn at. The Z coordinate is relative to the entire map (aka the floor height) and not the sector. So if you want something to spawn 128 units above a floor that's at a height of 64 then the Z coordinate needs to be 192.
To spawn something at the location of a MapSpot, use SpawnSpot instead.
To get a list of the things you can spawn in the game, visit the Classes page
Retrieved from "http://www.zdoom.org/wiki/index.php?title=Spawn"
Spawn
From the ZDoom Documentation Project
void Spawn(str actorclass, fixed x, fixed y, fixed z, int tid, int angle);
actorclass: type of actor you want to spawn (these are case sensitive)
x, y and z: map coordinates of where the thing should spawn. Note that these must be decimal numbers (ie, 1.0 and not 1) and z should be the absolute z coordinate, and not relative to the sector.
tid: (optional) tid you want to give the thing
angle: (optional) byte angle the thing spawns at
Spawns an actor...
Spawn is independent of map spots, so you need to specify what coordinates the actor will spawn at. The Z coordinate is relative to the entire map (aka the floor height) and not the sector. So if you want something to spawn 128 units above a floor that's at a height of 64 then the Z coordinate needs to be 192.
To spawn something at the location of a MapSpot, use SpawnSpot instead.
To get a list of the things you can spawn in the game, visit the Classes page
Retrieved from "http://www.zdoom.org/wiki/index.php?title=Spawn"
-
- Posts: 43
- Joined: Sun Dec 05, 2004 1:35 pm
or
Code: Select all
// not tested
#define SPOTTID 777
Spawn("MapSpot", x, y, z, SPOTTID);
Thing_Move(actortid, SPOTTID);
Thing_Remove(SPOTTID);
-
- Posts: 43
- Joined: Sun Dec 05, 2004 1:35 pm
- Graf Zahl
- Lead GZDoom+Raze Developer
- Posts: 49067
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
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.
... or Randy can add these really simple commands to make the life of many mappers considerably easier. Not only are these hacks massively cumbersome, they aren't really necessary if the proper features existed.
Graf - if one desires to actually observe an actor being moved from one location to another chosen location, I see the value and Costja's suggestion might do that...but I don't know how the movement speed is controlled. About my suggestion, calling two common acs commands "hacks" and "massively cumbersome" seems illogical. To me it's more like "straightforward" and "simple".
- Graf Zahl
- Lead GZDoom+Raze Developer
- Posts: 49067
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
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.
- 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.
-
- Posts: 43
- Joined: Sun Dec 05, 2004 1:35 pm
hmm why go through such code as this:
when you can just simply do this:
this nerrows down alot of the args and makes things a bit easyer to read and dont have to hassle of finding exact y position becuase its already placed in the map
note that the code i put is something i wrote up in about 30 sec so i doubt it works lol
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;
}
note that the code i put is something i wrote up in about 30 sec so i doubt it works lol
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.
-
- Posts: 43
- Joined: Sun Dec 05, 2004 1:35 pm
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.
- I assumed that the actor would be moved by TID. How could you not know the type, if you were plannning on moving something?
- 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.
- Status variables - OK I don't know.
- Graf Zahl
- Lead GZDoom+Raze Developer
- Posts: 49067
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
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.
Bottom line: It is a hack and it will remain a hack. I'd prefer a clean way to move an object to somewhere else but right now all you can do is set up complicated actor movers, respawn the object or hack around with ThrustThing. To do something like a moving crane hanging from a ceiling with a blinking light on it is impossible.