Can we manually set the Z-coord of an actor in DECORATE?

Ask about ACS, DECORATE, ZScript, or any other scripting questions here!

Moderator: GZDoom Developers

Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. If you still don't understand how to use a feature, then ask here.

Please bear in mind that the people helping you do not automatically know how much you know. You may be asked to upload your project file to look at. Don't be afraid to ask questions about what things mean, but also please be patient with the people trying to help you. (And helpers, please be patient with the person you're trying to help!)
Post Reply
User avatar
crowbars82
Posts: 40
Joined: Sun Nov 05, 2017 6:22 pm
Contact:

Can we manually set the Z-coord of an actor in DECORATE?

Post by crowbars82 »

Hi all!

This one has been puzzling me for a while now. Is there a method to set the Z-coord of an actor so it is sitting a distance above the floor?

I have found that setting the gfx offset of the PNG works, but can we set the actors physical Z so it is 32 above the floor?

After scouring the Actor_flags I can't find anything that might make sense at this stage.

Here is an example of what I would expect the command to be...

Code: Select all

ACTOR FloatingObject 8922
{
	Radius 30
	Height 10
	Scale 1.0
	Z_Height 32 <- something like this?
	+SOLID
	States
	{
	Spawn:
		FLOB A 1 Set_actor_offset(0,0,32) <- or something like this?
		FLOB A -1
		Stop
	}
}
I'm sure someone would have wanted to do this before...

Much thanks everyone!
:)
User avatar
krokots
Posts: 296
Joined: Tue Jan 19, 2010 5:07 pm

Re: Can we manually set the Z-coord of an actor in DECORATE?

Post by krokots »

There is A_Warp. I don't know why it is called like that, but this works as A_SetPosition.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49252
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: Can we manually set the Z-coord of an actor in DECORATE?

Post by Graf Zahl »

No, you can't, because an actor's position is solely set through its spawn coordinate, which for map placed actors is specified in the 'thing' record.
User avatar
gwHero
Posts: 360
Joined: Mon May 08, 2017 3:23 am
Graphics Processor: Intel with Vulkan/Metal Support
Location: The Netherlands

Re: Can we manually set the Z-coord of an actor in DECORATE?

Post by gwHero »

I guess one possibility is with the +NOGRAVITY flag and then keeping the Z coordinate 32 above floor in script with SetOrigin.
User avatar
crowbars82
Posts: 40
Joined: Sun Nov 05, 2017 6:22 pm
Contact:

Re: Can we manually set the Z-coord of an actor in DECORATE?

Post by crowbars82 »

Thanks all for the suggestions, for what I was trying to do with this I am able to use:

TNT1 A 0 A_SpawnItemEx("DoomImp", 0, 0, 1000, 0, 0, 0, 0, SXF_NOCHECKPOSITION|SXF_SETTARGET, 0)

which spawns an imp above the player when triggered by an invisible actor.
Post Reply

Return to “Scripting”