ACS suggestions

Moderator: GZDoom Developers

Richard213
Posts: 43
Joined: Sun Dec 05, 2004 1:35 pm

ACS suggestions

Post by Richard213 »

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 :)
Guest

Post by Guest »

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"
Richard213
Posts: 43
Joined: Sun Dec 05, 2004 1:35 pm

Post by Richard213 »

well i ment something like repositioning an actor at a give XYZ cord not just spawning an actor at a certain position
User avatar
Biff
Posts: 1061
Joined: Wed Jul 16, 2003 5:29 pm
Location: Monrovia, CA, USA

Post by Biff »

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.
Costja
Posts: 188
Joined: Mon Oct 18, 2004 3:58 pm
Location: Russia, Moscow
Contact:

Post by Costja »

or

Code: Select all

// not tested
#define SPOTTID 777
Spawn("MapSpot", x, y, z, SPOTTID);
Thing_Move(actortid, SPOTTID);
Thing_Remove(SPOTTID);
Richard213
Posts: 43
Joined: Sun Dec 05, 2004 1:35 pm

Post by Richard213 »

the commands would be easyer but this stuff works too :wink:
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49067
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Post by Graf Zahl »

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.
User avatar
Biff
Posts: 1061
Joined: Wed Jul 16, 2003 5:29 pm
Location: Monrovia, CA, USA

Post by Biff »

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".
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49067
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Post by Graf Zahl »

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.
Richard213
Posts: 43
Joined: Sun Dec 05, 2004 1:35 pm

Post by Richard213 »

hmm why go through such code as this:

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;
}
when you can just simply do this:

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;
}
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
Guest

Post by Guest »

Graf 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 agree with it all heh
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49067
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Post by Graf Zahl »

And who are you?
Richard213
Posts: 43
Joined: Sun Dec 05, 2004 1:35 pm

Post by Richard213 »

oh damn hmm seems i was loged out when i posted that :oops:
User avatar
Biff
Posts: 1061
Joined: Wed Jul 16, 2003 5:29 pm
Location: Monrovia, CA, USA

Post by Biff »

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 guess I just don't understand what this guy wants. My answer to your four points above is:

- 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. :)
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49067
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Post by Graf Zahl »

Biff wrote:
- I assumed that the actor would be moved by TID. How could you not know the type, if you were plannning on moving something?
Randomly spawned types, for example or some general code to move objects.
- 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.
ThrustThing doesn't spawn a new object. But imagine moving a torch with your method: Each time the torch moves the animation will restart.
- Yes you can move a monster that makes a sound, no problem.
If you remove and respawn an object the sound can not be transfered to the new object.

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.
Post Reply

Return to “Closed Feature Suggestions [GZDoom]”