Expose level flags to ZScript
Moderator: GZDoom Developers
Expose level flags to ZScript
I have some special handling in my mod Mr. Friendly for map07/E1M8/E4M6/E4M8-like cases where a monster's death does something to a sector, but it's all hard-coded based on the map name and doesn't work for maps that define eg "map07special" in their mapinfo. If a level's flags were exposed to ZScript, I could check them and handle such situations in a more robust way.
- Graf Zahl
- Lead GZDoom+Raze Developer
- Posts: 49056
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: Expose level flags to ZScript
I do not want to expose these old flags. They won't tell you the entire story anyway because you can also use the SpecialAction feature in which case you still won't be able to see if the map has special actions.
Re: Expose level flags to ZScript
Hmm, is there any other more robust way I could detect "this level has sectors that will change when (for example) Mancubi die" then?
- Graf Zahl
- Lead GZDoom+Raze Developer
- Posts: 49056
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: Expose level flags to ZScript
Not yet. That's what I meant here. The flags are only a subset of means to change sectors. Even the special actions are only a subset. You'll also have to examine each monster's special, too, and let's not even start talking about scripts that trigger an action if a certain group of monsters is dead.
So as a first step here I need a bit of background info what precisely this mod wants to check.
So as a first step here I need a bit of background info what precisely this mod wants to check.
Re: Expose level flags to ZScript
I don't care about my mod working with every map ever created, and ACS scripting especially means all bets are off re: knowing what a monster's death will trigger. I mainly just want to provide generic best-effort handling of map07/E1M8/E4M6/E4M8-like cases without having to hardcode those specific map slots + specific enemies, so that the player isn't locked out of continuing the level because eg a floor didn't lower. There will definitely be maps where it fails, my goal is the largest number of maps supported with the least amount of special case scripting, knowing that that's all careful tradeoff connected to complicated engine behaviors.
To provide some context, monsters aren't allowed to die in Mr Friendly, they just wander around so you can talk to them. Currently I handle map07 like cases from WorldThingSpawned, saying "if level.MapName is MAP07 and you're a mancubus or spider, set your health to 0 and call A_BossDeath (and then set your health back to full), so that any level specials fire and unblock the way forward".
To provide some context, monsters aren't allowed to die in Mr Friendly, they just wander around so you can talk to them. Currently I handle map07 like cases from WorldThingSpawned, saying "if level.MapName is MAP07 and you're a mancubus or spider, set your health to 0 and call A_BossDeath (and then set your health back to full), so that any level specials fire and unblock the way forward".
- Graf Zahl
- Lead GZDoom+Raze Developer
- Posts: 49056
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: Expose level flags to ZScript
Ok. So in other words, what you really need is something telling the map to execute all non-level-ending special actions, correct?
Re: Expose level flags to ZScript
Hmm, good idea. Yes I suppose that would do nicely.Graf Zahl wrote:Ok. So in other words, what you really need is something telling the map to execute all non-level-ending special actions, correct?