Can I change a sector's tag?
Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. This forum is archived - please use this set of forums to ask new questions.
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. This forum is archived - please use this set of forums to ask new questions.
-
- Posts: 81
- Joined: Sat Dec 04, 2004 10:25 pm
- Contact:
Can I change a sector's tag?
Can I change a sector's tag using a script?
Let's say I have a sector set to tag 31...
And I want to change it to 32, and then from 32 to 33 and so on until it is 35.....
and then I go back from 35 to 34, and so on until it is back at 31.
How do I do that?
The reason is that I have 5 linedefs, on 5 dummy sectors, each set for tag's 31-35, that create a 3D platform. 31 is a solid 3D platform, 32-34 are progressively more translucent, while 35 is at alpha "32" and the 3D floor type is changed from 1 to 3, in other words, I want to make disappearing platforms that when they "disappear", you fall through them if you are standing on them.
If I cannot change a sector's tag using a script, are there ways to change a 3D floor's transparency and type using a script?
If not...
I can have an animated texture that can mimic the change in transparency, and it is easy to instantly move the sector to the bottom floor, it's just that coordinationg that with the animation using a script can be a pain in the ass.
Let's say I have a sector set to tag 31...
And I want to change it to 32, and then from 32 to 33 and so on until it is 35.....
and then I go back from 35 to 34, and so on until it is back at 31.
How do I do that?
The reason is that I have 5 linedefs, on 5 dummy sectors, each set for tag's 31-35, that create a 3D platform. 31 is a solid 3D platform, 32-34 are progressively more translucent, while 35 is at alpha "32" and the 3D floor type is changed from 1 to 3, in other words, I want to make disappearing platforms that when they "disappear", you fall through them if you are standing on them.
If I cannot change a sector's tag using a script, are there ways to change a 3D floor's transparency and type using a script?
If not...
I can have an animated texture that can mimic the change in transparency, and it is easy to instantly move the sector to the bottom floor, it's just that coordinationg that with the animation using a script can be a pain in the ass.
First, the bad news: You can't change a sector's tag using a script in any sort of simple manner, and not in a way that would work with this at all.
Now, the good news: This is exactly what SetLineSpecial is for.
First, make sure your line with Sector_Set3DFloor uses parameter 4 as a line ID, not a sector tag. (This means you'll be limited to 255 distinct "fading" platforms.)
Second, you need a script that, at whatever interval, progresses through each of your states, as follows:
SetLineSpecial(3D floor line's line ID, 160 (or Sector_Set3DFloor), 31, 1, whatever flags you're using, current translucency, and the 3D floor line's line ID again).
(For the last one, obviously you change the 1 to a 3.)
Now, the good news: This is exactly what SetLineSpecial is for.
First, make sure your line with Sector_Set3DFloor uses parameter 4 as a line ID, not a sector tag. (This means you'll be limited to 255 distinct "fading" platforms.)
Second, you need a script that, at whatever interval, progresses through each of your states, as follows:
SetLineSpecial(3D floor line's line ID, 160 (or Sector_Set3DFloor), 31, 1, whatever flags you're using, current translucency, and the 3D floor line's line ID again).
(For the last one, obviously you change the 1 to a 3.)
Hm. I may have to check if, by way of scripting in EDGE, it's doable there (it probably isn't, but it'd be worth a look for the heck of it).Graf Zahl wrote:Sorry, that won't work. 3D floors are statically initialized and retroactively changing the control linedef's properties won't do anything at all. It's never looked at again.
Looks like the alternative is:
Step 1: Tag all your 3D floor lines identically and start with them at the same height.
Step 2: Proceed to instant-lower their control sectors to some point where they're no longer visible, in order of translucency.
I know this method doesn't work in EDGE (it complains about having two floors in the same Z range) but it might be worth a try here. (Worst case, it doesn't work either.)
PS, for why I don't make references to Vavoom when 3D floors come up: I don't like their implementation.

I tried a few things last night, before anyone else had posted, to see if I could get the desired effect. I can confirm that SetLineSpecial doesn't work.
I also tried 5 control sectors controlling 5 3D floors superimposed on top of each other and moving them away to leave increasingly translucent floors behind. This worked to a certain degree but had 3 main disadvantages.
1. The floors changed in very obvious steps - IMO, more than 5 floors would be needed to give a better transition.
2. No matter how fast I set the 3D floors to move, you could still see them dropping away.
3. The moving floors were solid so, if the player was underneath them, they would stop on his head and not complete the drop until he moved away.
[edit] I may as well upload my test level just in case it helps anyone. I'm sure it could be improved on in a number of ways.
http://www.zen64060.zen.co.uk/fade.zip
[/edit]
I have a funny feeling that translucency doesn't work on models (yet)? However, if it does, a new 3D bridge item with an associated model could be used. Altering translucency for actors is easy.
I also tried 5 control sectors controlling 5 3D floors superimposed on top of each other and moving them away to leave increasingly translucent floors behind. This worked to a certain degree but had 3 main disadvantages.
1. The floors changed in very obvious steps - IMO, more than 5 floors would be needed to give a better transition.
2. No matter how fast I set the 3D floors to move, you could still see them dropping away.
3. The moving floors were solid so, if the player was underneath them, they would stop on his head and not complete the drop until he moved away.
[edit] I may as well upload my test level just in case it helps anyone. I'm sure it could be improved on in a number of ways.
http://www.zen64060.zen.co.uk/fade.zip
[/edit]
I have a funny feeling that translucency doesn't work on models (yet)? However, if it does, a new 3D bridge item with an associated model could be used. Altering translucency for actors is easy.
-
- Posts: 81
- Joined: Sat Dec 04, 2004 10:25 pm
- Contact:
Problem 1 is actually no problem - I want it to change in obvious steps.e
I had a problem earlier with moving 3D sectors up or down, that they would do it absolutely instantly. I didn't use "FloorAndCeiling_RaisebyValue"
I used "Floor_RaiseByValue" and "Ceiling_RaiseByValue"
I'm testing it now.
However, this brings me to a better idea. I can use just 2 3D floors, both at the same height.
The wider one is set at type "3", and it is composed of an animated texture that shows it changing its "visibility".
The other one is inside the first one, and it is solid.
Is there a command that can set a floor to a fixed height and a ceiling to a fixed height? This way, if I am under one of these platforms, and it falls on me, it can stop right there (although if I jump, it'll be noticable) - but when it comes time to go back up, it doesn't become offset by 52 pixels or something...
I had a problem earlier with moving 3D sectors up or down, that they would do it absolutely instantly. I didn't use "FloorAndCeiling_RaisebyValue"
I used "Floor_RaiseByValue" and "Ceiling_RaiseByValue"
I'm testing it now.
However, this brings me to a better idea. I can use just 2 3D floors, both at the same height.
The wider one is set at type "3", and it is composed of an animated texture that shows it changing its "visibility".
The other one is inside the first one, and it is solid.
Is there a command that can set a floor to a fixed height and a ceiling to a fixed height? This way, if I am under one of these platforms, and it falls on me, it can stop right there (although if I jump, it'll be noticable) - but when it comes time to go back up, it doesn't become offset by 52 pixels or something...
-
- Posts: 81
- Joined: Sat Dec 04, 2004 10:25 pm
- Contact:
-
- Posts: 81
- Joined: Sat Dec 04, 2004 10:25 pm
- Contact:
Hey wait, even better idea! Just have one 3D floor, and have it set at type 3.
It'll have an animation that'll make it look like a slab of glass disappearing and reappearing.
A script will then be tweaked to coordinate with that animation to place and erase a solid bridge object at the exact height of the 3D floor!
Not only will it probably work exactly how it should, with no possibility of problems arising because of the player being under the platform, it'll also look pretty much exactly like how it does in this one game that I am somewhat recreating in a Doom environment.
Now, I need to know one thing...
How do I get a script to loop back to the beginning and do it all over again?
It'll have an animation that'll make it look like a slab of glass disappearing and reappearing.
A script will then be tweaked to coordinate with that animation to place and erase a solid bridge object at the exact height of the 3D floor!
Not only will it probably work exactly how it should, with no possibility of problems arising because of the player being under the platform, it'll also look pretty much exactly like how it does in this one game that I am somewhat recreating in a Doom environment.
That's even better!Enjay wrote:Rather than using an animated texture and trying to time your script with the animation, it might be better, probably easier and more flexible to script the animation of the texture using setlinetexture, ChangeCeiling and ChangeFLoor.
Now, I need to know one thing...
How do I get a script to loop back to the beginning and do it all over again?
Code: Select all
restart;
-
- Posts: 81
- Joined: Sat Dec 04, 2004 10:25 pm
- Contact: