Page 1 of 1

Raising water puzzle coding

Posted: Thu Jun 08, 2017 12:53 pm
by Reactor
GZDoom

Today I've visited my fellow team members and collected their ideas & suggestions regarding the campaign. One of them was particularly elaborate and noteworthy, however, I'm not sure whether or not it can be coded.

The idea is a short water puzzle for the level Liability Elimination. There shall be a rather extensive part of corridors and rooms, which is being flooded by water, so it shall utilize raising water coding, that's for sure. The thing is, there is a drain in one of them chambers, and not extremely far from it, several pushable steel boxes. By default, the water level is constant. However, if the player pushes one of said boxes right onto the drain, the water level would start to rise. If the box is pushed away, the water level would drop back to normal.
I found this water puzzle a damn good idea, it could be used for a million and two things, however, I am pretty sure it is quite a challenge to code. If any of you had luck with similar scenarios during level edit, or know a solution how to bring this water riddle to life, I would love to hear them. :)

Re: Raising water puzzle coding

Posted: Thu Jun 08, 2017 2:39 pm
by Orka
I am not sure but maybe this could help:

If the script works for 3D floors then probably it would work with 3D liquid as well... But the box pushing part... I have no idea...

Re: Raising water puzzle coding

Posted: Thu Jun 08, 2017 3:05 pm
by Reactor
Yesh, that part is the hardest. How to tell the program to start rising the water level if the box is pushed to a certain place.

(the box will be a 3D model, if it means anything)

Re: Raising water puzzle coding

Posted: Fri Jun 09, 2017 4:25 pm
by Kappes Buur
It's not difficult to do

For the pushable item I 'borrowed' the PushPuzz 31998 actor from Tormentor's The City of The Damned : Apocalypse (tcotd2.pk3)
Spoiler:
which has to be pushed across this linedef
Spoiler:
to initiate script 10 to flood all sectors and drain them after 15 seconds and then repeats.
Spoiler:
Alternatively you could use 'Actor enters Sector' as the trigger.

Set up all effected sectors as 3D floors, Tag 1 to 8. Then the flooding/draining is acted upon the 3D control sectors, Tag10.
Spoiler:

Re: Raising water puzzle coding

Posted: Fri Jun 09, 2017 5:57 pm
by Reactor
So the whole water-box riddle is a four-parter script? Looks pretty complicated, but hopefully it will work. I could use this neat little phenomenon to a lot of things, including secret areas. The box might be slightly bigger than the actual drain texture (it is 128×128, but I haven't the slightest idea, how to measure pixels to umm...model units, or what they're called).

Thank you for your good advice, fam! :) I owe you one!