I know BlockLinesIterator exists but is there a way to include cross-over lines as well?
EDIT: I've discovered LineIdIterator but now I've got another problem: how do you get the appropriate sector tag?
Find all lines with a given tag and function?
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!)
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!)
- 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: Find all lines with a given tag and function?
Okay, I've been staring at the sector struct definition in mapdata.txt for several hours now and I'm completely at the end of my rope.
How the fuck do you get a sector's tag!?
(EDIT: So far I'm working around this by calling SectorTagIterator under a for loop until one of the items gets me the selected sector. This seems...... suboptimal for something I should be able to get by accessing the pointer.)
How the fuck do you get a sector's tag!?
(EDIT: So far I'm working around this by calling SectorTagIterator under a for loop until one of the items gets me the selected sector. This seems...... suboptimal for something I should be able to get by accessing the pointer.)
Re: Find all lines with a given tag and function?
Tags are stored separately from sectors and lines. That's why you cannot find them there. That's why designated iterator classes exist.
Could you please explain what you want to achieve?
Could you please explain what you want to achieve?
- Graf Zahl
- Lead GZDoom+Raze Developer
- Posts: 49056
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: Find all lines with a given tag and function?
Remember that a sector can have multiple tags. The use case where you have a sector and need to find its tag is never being needed by the engine. The regular use case is to have a tag and then get a list of sectors - and that's precisely what the iterators do.
Also, Line IDs have nothing to do with sector tags or activation. You should never look up a line ID and then all sectors with a matching tag. You cannot possibly do anything with such a setup. If you have an activatable line you have to know precisely what it does and which arg represents the tag. Needless to say, since this list can change in the future it's something better left alone and leave trigger semantics to the engine code.
Also, Line IDs have nothing to do with sector tags or activation. You should never look up a line ID and then all sectors with a matching tag. You cannot possibly do anything with such a setup. If you have an activatable line you have to know precisely what it does and which arg represents the tag. Needless to say, since this list can change in the future it's something better left alone and leave trigger semantics to the engine code.
- 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: Find all lines with a given tag and function?
I'm trying to get a general way of testing whether a sector represents a door._mental_ wrote:Tags are stored separately from sectors and lines. That's why you cannot find them there. That's why designated iterator classes exist.
Could you please explain what you want to achieve?
Which, from my understanding, requires that I be able to see if any line on the map does any of the following:
- opens or closes this sector when used
- opens or closes this sector when shot
- opens or closes this sector when crossed
independently of whether that line is actually part of that sector (since you might have a switch or a walk trigger like the secrets in map01). My understanding is that BlockLinesIterator won't catch the third case (since cross-activation by definition implies it is not a blocking line). In any event, I need to see if these door-special lines are tagged for the sector in question.