[Duplicate] ACS suggestions

Moderator: GZDoom Developers

ACS suggestions

Postby Richard213 » Thu Mar 10, 2005 12:42 pm

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 :)
Richard213
 
Joined: 05 Dec 2004

Postby Albert Blundermit » Thu Mar 10, 2005 2:54 pm

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"
Albert Blundermit
 

Postby Richard213 » Thu Mar 10, 2005 3:47 pm

well i ment something like repositioning an actor at a give XYZ cord not just spawning an actor at a certain position
Richard213
 
Joined: 05 Dec 2004

Postby Biff » Thu Mar 10, 2005 4:22 pm

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.
User avatar
Biff
Caleb is back for a visit
 
Joined: 16 Jul 2003
Location: Monrovia, CA, USA

Postby Costja » Thu Mar 10, 2005 4:31 pm

or
Code: Select allExpand view
// not tested
#define SPOTTID 777
Spawn("MapSpot", x, y, z, SPOTTID);
Thing_Move(actortid, SPOTTID);
Thing_Remove(SPOTTID);
Costja
_PA_
 
Joined: 18 Oct 2004
Location: Russia, Moscow

Postby Richard213 » Thu Mar 10, 2005 4:44 pm

the commands would be easyer but this stuff works too :wink:
Richard213
 
Joined: 05 Dec 2004

Postby Graf Zahl » Thu Mar 10, 2005 5:15 pm

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
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
 
Joined: 19 Jul 2003
Location: Germany

Postby Biff » Fri Mar 11, 2005 11:49 am

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
Biff
Caleb is back for a visit
 
Joined: 16 Jul 2003
Location: Monrovia, CA, USA

Postby Graf Zahl » Fri Mar 11, 2005 12:12 pm

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.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
 
Joined: 19 Jul 2003
Location: Germany

Postby Richard213 » Fri Mar 11, 2005 12:26 pm

hmm why go through such code as this:

Code: Select allExpand view
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 allExpand view
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
Richard213
 
Joined: 05 Dec 2004

Postby Polly Drinnerbire » Fri Mar 11, 2005 12:35 pm

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
Polly Drinnerbire
 

Postby Graf Zahl » Fri Mar 11, 2005 12:51 pm

And who are you?
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
 
Joined: 19 Jul 2003
Location: Germany

Postby Richard213 » Fri Mar 11, 2005 12:56 pm

oh damn hmm seems i was loged out when i posted that :oops:
Richard213
 
Joined: 05 Dec 2004

Postby Biff » Fri Mar 11, 2005 2:51 pm

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
Biff
Caleb is back for a visit
 
Joined: 16 Jul 2003
Location: Monrovia, CA, USA

Postby Graf Zahl » Fri Mar 11, 2005 3:13 pm

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.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
 
Joined: 19 Jul 2003
Location: Germany

Next

Return to Closed Feature Suggestions

Who is online

Users browsing this forum: No registered users and 1 guest