Make (invisible) 3D floor walkable after pressing switch

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
HiDensity
Posts: 3
Joined: Mon Dec 25, 2023 9:17 am
Preferred Pronouns: He/Him
Operating System Version (Optional): Windows 10 Pro, macOS 14.2.1

Make (invisible) 3D floor walkable after pressing switch

Post by HiDensity »

Hello folks!

I'm having a problem on one of my maps and I hope you can help me.

On my map I have a 3D bridge. This bridge has absolutely no textures and is self referencing, since I want it to be completely invisible.
So, when I give the according Linedef of the controlling Sector Action 160 and Type 1 (solid/walkable) everything works as designed. I can walk on the bridge and cross the pit below.

Let's come to the problem I'm facing: When I enter the level I want the bridge to be non solid but a switch should turn it into a solid floor. Still invisible, but walkable.

I've tried to create a small script with the following content and assigned the script's execution to a switch.

Code: Select all

script 1(void) {
    PrintBold(s:"Should be walkable now");
    Sector_Set3dFloor(1, 1);
}
Tag 1 is the tag my bridge sector has.
But when I now hit the switch literally nothing happens to the bridge. When I try to step on it I'm still falling into the pit.
Also the script editor tells me the function "Sector_Set3dFloor" is not defined. Am I missing an import? Actually I only include "zcommon.acs".

Does anybody have a clue what I am missing or how I can achieve my goal?

For clarification purpose, I've added a small dummy map to the posting.

Thanks in advance.
Attachments
invisible bridge.wad
(6.4 KiB) Downloaded 139 times
User avatar
Player701
 
 
Posts: 1710
Joined: Wed May 13, 2009 3:15 am
Graphics Processor: nVidia with Vulkan support
Contact:

Re: Make (invisible) 3D floor walkable after pressing switch

Post by Player701 »

I highly doubt that it is possible to create 3D floors at runtime, so the approach you're suggesting is probably not going to work. But you have at least 2 other options:
  1. Set up an invisible 3D floor in advance (in the map editor) and place it above or below the ground. Upon pressing the switch, manipulate the control sector's floor and ceiling heights via e.g. Floor_LowerInstant, Ceiling_LowerInstant to reposition the 3D floor.
  2. Spawn invisible bridge actors via Spawn or SpawnSpot when the bridge is activated.
HiDensity
Posts: 3
Joined: Mon Dec 25, 2023 9:17 am
Preferred Pronouns: He/Him
Operating System Version (Optional): Windows 10 Pro, macOS 14.2.1

Re: Make (invisible) 3D floor walkable after pressing switch

Post by HiDensity »

Thank you very much for your input, Player701.

Unfortunately with these two methods it's impossible to create a really invisible platform. It will always have the floor/ceiling texture of the closest or surrounding sector, even if it is self referenced. Also it leads to glitches.

I think I have to overthink my level design on that particular point. It's not that important to have it like that, it would just have been a nice feature.
User avatar
Player701
 
 
Posts: 1710
Joined: Wed May 13, 2009 3:15 am
Graphics Processor: nVidia with Vulkan support
Contact:

Re: Make (invisible) 3D floor walkable after pressing switch

Post by Player701 »

HiDensity wrote: Wed Dec 27, 2023 5:36 am Unfortunately with these two methods it's impossible to create a really invisible platform. It will always have the floor/ceiling texture of the closest or surrounding sector, even if it is self referenced. Also it leads to glitches.
Perhaps there's been some sort of miscommunication, but I'm not exactly sure what you mean here. If you're setting up a 3D floor, you can simply set its alpha (4th argument) to 0, which makes the floor solid but not visible. And the bridge actors are invisible by default.

If you're attempting to combine 3D floors with the self-referencing sector hack, I'd strongly advise against that. (UPD: Just saw your example map - sorry, I guess I must have missed it for some reason! Yeah, you're doing exactly that, so please don't.) The mapping features provided by GZDoom render these hacks obsolete, so you should only use them when mapping for vanilla or Boom-compatible engines.

Also, here is an example map that demonstrates both techniques from my initial reply:
Attachments
invisible_bridges.wad
(13.18 KiB) Downloaded 130 times
HiDensity
Posts: 3
Joined: Mon Dec 25, 2023 9:17 am
Preferred Pronouns: He/Him
Operating System Version (Optional): Windows 10 Pro, macOS 14.2.1

Re: Make (invisible) 3D floor walkable after pressing switch

Post by HiDensity »

Thank you very much for your reply and support. :)

I'll check your attached map later.
Post Reply

Return to “Scripting”