HenKonen Posted August 19, 2012 I'm trying to add a secret in my map that raises a set of underwater stairs to a higher floor, making another area accessible (illustrated). Sorry about the typo(s) My problem is, I can't make the deep water effect go away from the floor as removing the deep water things via scripting doesn't remove the effect. Do you know any workaround on how to make a underwater sector not-underwater? 0 Share this post Link to post
Pottus Posted August 19, 2012 Try something like this If you downloaded the first example it's not what your looking for, download this example. http://www.mediafire.com/?j2qk2oqfgyzposx Read the scripts and observe the sector tags very closely Now here is your effect ya I thought the water was supposed to rise lol! http://www.mediafire.com/?cfq69a52mrv1dei 0 Share this post Link to post
Kappes Buur Posted August 20, 2012 This would be even easier with a 3D floor. In this example, the basin will drain and fill up again. 0 Share this post Link to post
Gez Posted August 20, 2012 The OP mentioned his attempt at "removing the deep water things via scripting", so I don't think he's using Boom. 0 Share this post Link to post
printz Posted August 20, 2012 Oh, okay. I thought he was referring to ZDoom swimmable water objects. 0 Share this post Link to post
Pottus Posted August 20, 2012 That would work as well, at least he has more than one way to choose now :) 0 Share this post Link to post
HenKonen Posted August 21, 2012 I'm using Zdoom in Hexen format. Is this a problem? I simplified the area to first understand how to make a working script like that. My problem now is that the script can't pick up the moment where the floor height hits -48 and thus can't enter the "inner script", as I like to call it. I think it has something to do with the part rectangled in the picture of the script. What should it read there and why? E: resized the script picture 0 Share this post Link to post
Pottus Posted August 21, 2012 Did you try Kappes Buur approach? Or is 3D floors just not an option? If you can upload your MAP and someone can check out the problem because it's difficult to see exactly whats going on without having the map. 0 Share this post Link to post
HenKonen Posted August 22, 2012 Pottus said:Did you try Kappes Buur approach? Or is 3D floors just not an option? If you can upload your MAP and someone can check out the problem because it's difficult to see exactly whats going on without having the map. Map here I didn't include the huge texture wad files, so some textures display invalidly. All the scripts and essentials are in there, though. I'm new to 3D floors, can they be done with Zdoom in Hexen format? I'd rather not use that approach, I would rather ease myself into 3D floor mapping in a different map or section so I don't take more I can chew. Edit: The map is MAP06 so skip in there with idclev06. 0 Share this post Link to post
Gez Posted August 22, 2012 Herska said:I'm new to 3D floors, can they be done with Zdoom in Hexen format? Yes. There's a wiki for further info. 0 Share this post Link to post
boris Posted August 22, 2012 Did you check what's the value of floorZ? The right shift is done because GetSectorFloorZ returns a fixed point number. 0 Share this post Link to post
HenKonen Posted August 22, 2012 God. Just god. I made a script displaying floorz in real time and guess what? The script couldn't reckognize the point where the value hits -48 because the value grows too fast (I think it doesn't go through every integer when it grows too fast and skipped -48 in this case) Lowered the sector raise speeds from 30 to 10 and it works like a charm. Good thing this didn't bug me enough to stop me from working for 2 days. Oh well. 0 Share this post Link to post
wesleyjohnson Posted August 23, 2012 Universal rule for floating point (and fixed point too) is to never test for equality. Making it slower worked yesterday, but what about tomorrow on a different machine ? It is a fragile solution, that will fail again. Fix it permanently. As it only moves one direction ... if( floorz >= -48 ) ... Then it will always stop, even if it hits numbers like -48.5, -48.23, -48.02, -47.9 ... or you can cheat the test a little lower and force the result if( floorz >= -48.001 ) { floorz = -48.000 set floor height to floorz; ... } If it moved in two directions, then it needs a separate test for each direction. Testing floating values to hit a narrow window is also fragile and is to be avoided. 0 Share this post Link to post
Pottus Posted August 23, 2012 You have a good point there Wesley I tried this and it is the best way, but you forgot to mention he will need to remove the bit shift operator from lines where GetFloorZ() is used. 0 Share this post Link to post