ZS move floor/ceiling relative to starting height?

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
Matt
Posts: 9696
Joined: Sun Jan 04, 2004 5:37 pm
Preferred Pronouns: They/Them
Operating System Version (Optional): Debian Bullseye
Location: Gotham City SAR, Wyld-Lands of the Lotus People, Dominionist PetroConfederacy of Saudi Canadia
Contact:

ZS move floor/ceiling relative to starting height?

Post by Matt »

Is there any ZScript function that does this natively, or is there any function that can reliably get a starting height from which to derive a MoveFloor/MoveCeiling target?

I can MoveFloor/Ceiling if I have a convenient spot on the map as a reference point and get the starting height from that, but I have no idea what to do if there is no such reference point and all I want to do is just move the sector in question by X number of units up or down.
User avatar
Cherno
Posts: 1311
Joined: Tue Dec 06, 2016 11:25 am

Re: ZS move floor/ceiling relative to starting height?

Post by Cherno »

How would you refer to the sector in zScript?
User avatar
Matt
Posts: 9696
Joined: Sun Jan 04, 2004 5:37 pm
Preferred Pronouns: They/Them
Operating System Version (Optional): Debian Bullseye
Location: Gotham City SAR, Wyld-Lands of the Lotus People, Dominionist PetroConfederacy of Saudi Canadia
Contact:

Re: ZS move floor/ceiling relative to starting height?

Post by Matt »

For the earlier thing I'd use a line trace and use the sector it hit.

For the implementation I'm asking this for, I'm picking a random sector from a list.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49073
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: ZS move floor/ceiling relative to starting height?

Post by Graf Zahl »

A sector plane has no 'height', due to slopes. You have to call ZAtPoint to get the height from a reference point.
Post Reply

Return to “Scripting”