Different Exit Texts for same map?

Ask about mapping, UDMF, using DoomBuilder/editor of choice, etc, here!

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.
User avatar
Enjay
 
 
Posts: 26476
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland

Different Exit Texts for same map?

Post by Enjay »

Mapping? Scripting? A bit of both?

I just want to check that there isn't a better way to do this. What I have works fine, but could be considered clumsy/hacky.

I have a map where there is an optional side quest. If the player completes this side quest, I would like it to be acknowledged in the exittext for the map.

Originally, the map did not have the side quest, so it was just set up in a cluster with an entertext to set the scene and an exittext to tell the player they'd done a great job.

However, with the side quest in place, I want the game to tell the player about the additional stuff. If they just complete the map, they have done a great job but if they did the side quest, they did an even greater job. :P

I know that I could do it via a HUDMessage (indeed, I do have a HUDMessage just before the map exits that tells part of the story) but I would also like to have a proper exittext that comes up after the stat screen and behaves just like a normal enter/exittext. (i.e. a type-on effect, skips to full text if [use] is pressed, scaled appropriately etc etc.)

Fortunately, after the main map, I have a little epilogue map with a simple cutscene, and that makes things simpler.

So, this is what I have set up:
  • The main map is in its own cluster. I have kept the entertext for that cluster, but removed the exittext.
  • I have duplicated the epilogue map under a different name (but the WAD itself is identical).
  • Each of the two epilogue maps are set up in MAPINFO to be in their own cluster. Each of these clusters have their own entertext.
  • When the player completes the main map, the ACS script that calls the exit instruction (after displaying the HUDMessage that I mentioned) checks for a quest item in the player's inventory. (The quest item is given for doing the side quest.)
  • If the quest item is present, the player is sent to one of the epilogue maps.
  • if the quest item is not present, the player is sent to the other epilogue map.
  • before entering whichever epilogue map has been triggered, the entertext for that map/cluster is displayed.
So, there we are. It works and I have two different possible texts and they display appropriately depending on what the player did in the main map. However, this does involve duplicating the epilogue maps, as well as having two cluster definitions (one for each epilogue). So I was just wondering if there was a more efficient way to do it?

I don't *think* there is any way to make enter/exittexts conditional but I could be wrong.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 48851
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: Different Exit Texts for same map?

Post by Graf Zahl »

You can at least forget about the clusters. You can attach exit texts directly to the map - different ones for each destination map.
What cannot be done is have different exit texts depending on how you played the map, though.
User avatar
Enjay
 
 
Posts: 26476
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland

Re: Different Exit Texts for same map?

Post by Enjay »

Fair enough. At least I know now. I can work with that information. Thanks.
Gez
 
 
Posts: 17804
Joined: Fri Jul 06, 2007 3:22 pm

Re: Different Exit Texts for same map?

Post by Gez »

Text screen intermissions haven't been scriptified yet, otherwise it'd be easy to make a custom one with conditional text.
brick
Posts: 45
Joined: Fri Apr 30, 2021 10:22 am
Graphics Processor: nVidia (Modern GZDoom)

Re: Different Exit Texts for same map?

Post by brick »

@Enjay sorry for resurrecting the thread but I may have an idea that avoids duplicating maps: have your exit script point to either normal exit (no side quest) or the secret exit (side quest completed), have both next and secretnext point to the same epilogue map, but have the exittexts be different. So something like this:

Code: Select all

map E1M3 lookup "HUSTR_E1M1"
{
   next = "E1M2"
   secretnext = "E1M2"
   exittext = normal, "great job!"
   exittext = secret, "even greater job!"
   sky1 = "SKY1", 0
   cluster = 1
   par = 30
   music = "$MUSIC_E1M1"
}
The above does work when next and secretnext are different maps. I'm not sure how much it works differently from specifying the destination map instead of "normal" and "secret", when both nexts are the same. Worth a try maybe?

EDIT: tested it just now and it works perfectly! Taking the normal exit shows "great job", taking the secret exit shows "even greater job", and both exits go to the same map.
All you need is to have the actual map exit be from script and have it pick normal or secret exit depending on side quest completion, and I think you'll have exactly what you want.
User avatar
Enjay
 
 
Posts: 26476
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland

Re: Different Exit Texts for same map?

Post by Enjay »

Cool, I'll have to try that. I was defining the texts as part of the cluster but Graf's and your post let me know that it was possible within the map definition.

I note that Graf said:
Graf Zahl wrote:You can attach exit texts directly to the map - different ones for each destination map.
but your example only lists normal and secret exits. Any idea if there is a way to expand it to more than two maps and messages? I don't need that (not right now anyway), but it might be useful at some point.
brick
Posts: 45
Joined: Fri Apr 30, 2021 10:22 am
Graphics Processor: nVidia (Modern GZDoom)

Re: Different Exit Texts for same map?

Post by brick »

Enjay wrote:your example only lists normal and secret exits. Any idea if there is a way to expand it to more than two maps and messages?
Yes absolutely, you can do it 2 different ways. Either the way I've done it with normal and secret, or by directly specifying the destination map instead, so it could look something like this:
exittext = MAP02, "great job!"
exittext = MAP03, "even greater job!"
exittext = MAP04, "greaterest job!"
and so on. This is what Graf was referring to. I think doing it this way is probably better and more flexible, but using normal/secret allows you to exploit the loophole and specify 2 different messages for the same destination map.
User avatar
Enjay
 
 
Posts: 26476
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland

Re: Different Exit Texts for same map?

Post by Enjay »

Right, OK, got it. So it is possible to use the normal and secret exits to get different messages (in fact, I had already tried this, albeit I was using cluster definitions and different (dummy) destination maps - so less efficient than your method) but it is not possible to do it for more than two maps without providing different destination maps.
brick
Posts: 45
Joined: Fri Apr 30, 2021 10:22 am
Graphics Processor: nVidia (Modern GZDoom)

Re: Different Exit Texts for same map?

Post by brick »

I'm not sure I fully understand. Are you thinking of something similar to your original question, but with more than 2 states, eg side quest not started, started but not completed, and fully completed, and so 3 different messages on exit? I don't think you can do this without some duplication, the method I suggested will only work for 2 states (normal/secret).

Although... maybe there is a way. I've seen people use Dehacked to force renaming of lumps (I think I've mostly seen it for graphic lumps), it seems to work like creating an alias for those lump names. If this also works with MAPxx lumps, or if there's any other way to set aliases, then it might work in my previous example by having MAP03 and MAP04 both be aliases of MAP02, then maybe MAPINFO will still direct to the appropriate exittext but all 3 states will then move to MAP02.
User avatar
Enjay
 
 
Posts: 26476
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland

Re: Different Exit Texts for same map?

Post by Enjay »

Yes, I'm just imagining the possibility of being able to complete a map in three or more different ways and being able to get an exittext for each method of completion.

Your suggestion gives two (which is all I need right now) but I was just wondering if there might be a way to get more than two with the current features and without map duplication. It looks like the answer, at the moment at least, is that a bit of duplication would be required for such a setup.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 48851
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: Different Exit Texts for same map?

Post by Graf Zahl »

No. The system has one message each for the generic exits defined through MAPINFO and on top of that map specific ones. The scenario that someone wants to have multiple exit texts when going to the same map was never considered.

Return to “Mapping”