If a user has their options set for it, when a secret is found, the lines for the secret sector get highlighted once the secret sector has been discovered. I can't remember if it's the default or not, but my secrets appear as a bright magenta when discovered.
I have been trying to see if there is a way to force lines to look like found secrets via ACS. I have looked at Line_SetAutomapStyle and Line_SetAutomapFlags but neither of these have a "secret has been found" line style (the "secret" referred to on those pages are 2s lines drawn as if they were 1s to hide secret doors).
So, is there such a flag and can it be accessed via ACS?
I initially wanted this because I had made the lines in a secret invisible (to hide it from the automap) but when the player finds the secret, I wanted them to be able to see that on the automap. I got that sorted by having an "actor enters sector" thing in the secret sector that runs a script that simply unsets the hidden flag (AMLF_DontDraw) and, tada (or should I say "boooonnngggg!"?) the lines that I have unhidden appear as bright magenta "found secret" lines.
So, that scenario is solved. However, there is another situation - when a secret is triggered by a thing (be it a Secret Trigger or just a regular actor with the "counts as secret" flag). In that situation, there is no sector marked as secret. So, simply unhiding lines will not work.
In most cases where I have used actor-triggered secrets, I can usually draw some lines representing where the secret is on the map, it's just that having an actual secret sector doesn't work well for that particular instance of a secret. So, the ideal solution would be to draw some lines on the map and when the secret thing is triggered, I could run an ACS script to force the lines to look like they are revealed secrets. However, there doesn't seem to be a flag for that with the above linked ACS commands.
Anyone able to help?
Is there a flag for seen secret lines?
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!)
-
Enjay
-

- Posts: 27650
- Joined: Tue Jul 15, 2003 4:58 pm
- Location: Scotland
-
Average Raven Fan
- Posts: 27
- Joined: Sat Oct 05, 2024 12:00 am
Re: Is there a flag for seen secret lines?
Alright, so let's see if I get this : you want picking up an item to color a sector's lines pink as if they were a revealed secret, when they're otherwise hidden?
If that's what you want, give this a go : draw a sector around the thing in the shape you want to show on the automap, give it a tag, and put the item you want to be a secret in it!
Add this actor to your ZScript file and also in the MAPINFO with your preferred doomednum!
Put this item on top of your secret pickup and give it an argument 1 on UDB that's the same as the sector's tag.
Now when the player runs over the item and picks it up, they also "pick up" this item, which paints all lines belonging to the tagged sectors pink on the automap and then effectively removes itself from play.
EDIT :
https://youtu.be/AG0ZdbJ29OU
The whole thing should look like this! Am I correct in assuming this is what's requested?
If that's what you want, give this a go : draw a sector around the thing in the shape you want to show on the automap, give it a tag, and put the item you want to be a secret in it!
Code: Select all
class SecretSectorThing : Inventory
{
States
{
Spawn:
TNT1 A 350;
Loop;
}
override bool TryPickup(in out Actor toucher)
{
if(args[0] > 0)
{
int j;
SectorTagIterator it = LevelLocals.CreateSectorTagIterator(args[0]);
j = it.Next();
while(j > -1)
{
let sec = level.Sectors[j];
sec.flags = sec.flags | Sector.SECF_WASSECRET;
j = it.Next();
}
args[0] = 0;
}
return false;
}
}Put this item on top of your secret pickup and give it an argument 1 on UDB that's the same as the sector's tag.
Now when the player runs over the item and picks it up, they also "pick up" this item, which paints all lines belonging to the tagged sectors pink on the automap and then effectively removes itself from play.
EDIT :
https://youtu.be/AG0ZdbJ29OU
The whole thing should look like this! Am I correct in assuming this is what's requested?
-
Enjay
-

- Posts: 27650
- Joined: Tue Jul 15, 2003 4:58 pm
- Location: Scotland
Re: Is there a flag for seen secret lines?
Thanks for the suggestion. I'll see if I can fiddle with this, to get it to work. It would be ideal for situations where a pickup is placed somewhere that it's impractical to mark a sector as secret, and the secret is tied directly to a thing rather than a sector. So, yes, that is one of the situations where I was trying to get something like this to work. However, that was more of a "spin-off" goal. The situation that I have in the current particular case is slightly different, and I should have been clearer about that...
In the problematic case, the secret is actually triggered by the player shooting a line. Doing so runs an ACS script that does a few things, and that includes activating a secret trigger actor. So, the secret gets triggered and ZDoom counts it correctly, but there are no visual clues on the map that this is where the secret was. I'd like the line that has been shot, and the other lines that border the sector that the shot line borders, to turn the "secret found" colour.
Like the title says, if there was a "secret found" flag for lines, then I could just give the lines an ID and toggle the flag in the script, but that doesn't seem to be available.
In the problematic case, the secret is actually triggered by the player shooting a line. Doing so runs an ACS script that does a few things, and that includes activating a secret trigger actor. So, the secret gets triggered and ZDoom counts it correctly, but there are no visual clues on the map that this is where the secret was. I'd like the line that has been shot, and the other lines that border the sector that the shot line borders, to turn the "secret found" colour.
Like the title says, if there was a "secret found" flag for lines, then I could just give the lines an ID and toggle the flag in the script, but that doesn't seem to be available.
-
Enjay
-

- Posts: 27650
- Joined: Tue Jul 15, 2003 4:58 pm
- Location: Scotland
Re: Is there a flag for seen secret lines?
I've also raised an issue on GitHub in case there is something that can be done to create/expose the flag.
https://github.com/UZDoom/UZDoom/issues/1102
https://github.com/UZDoom/UZDoom/issues/1102