SMG_Man Posted October 2, 2021 (edited) If any of you have played DOOM 3 before, you may have noticed that the game will usually tell you where you are in a level. For example: I think this feature is pretty cool, and would love to implement something like this in my own WAD(s); where either on the normal HUD or in the Automap specifically, the game will let the player know which "room" they're in on the map. With what I know about the GZDoom engine I think it should be possible, but I'm not experienced enough to build it from scratch without help. Would anyone be able to point me in the right direction or happen to know about similar features that other WADs may have? Edited October 2, 2021 by SMG_Man 1 Quote Share this post Link to post
snapshot Posted October 3, 2021 you can use a globalarray variable in your acslib and sbarinfo and set that to the room name when player crosses a linedef, depending on which side the line was triggered with lineside or you can use a hudmsg_plain hudmessage to display it somewhere on player's screen when they cross a linedef 1 Quote Share this post Link to post
SMG_Man Posted November 17, 2021 (Apologies for getting back to you after so long) On 10/2/2021 at 10:51 PM, sluggard said: you can use a globalarray variable in your acslib and sbarinfo and set that to the room name when player crosses a linedef, depending on which side the line was triggered with lineside I've got the status bar to display the message where I want it: However, fiddling with arrays is not something I've ever done before. I understand how to format one, like for example int e1m1array[4] = { "\cfHolding Room", "\cfLobby", "\cfWelcome Hall", "\cfExit" }; Making it into a global array accessible to SBARINFO though, I'm not sure of. Would I be able to define an array with the same name on a per-map basis, or would I have to make a large multi-dimensional array? Also, how would I manipulate the array value that SBARINFO gets using scripts? 1 Quote Share this post Link to post
Nevander Posted November 17, 2021 You don't really need SBARINFO or to mess with status bars at all. You can just do an enter script to put the first room name up where you want it as well as define your room names array for that level. Then use ACS in-map on linedefs or with player enters sector things to do the exact same HudMessage but refer to your array positions. That's how I'd do it. Easiest way I can think of without getting too fancy. 1 Quote Share this post Link to post
SMG_Man Posted November 18, 2021 (edited) At your suggestion I looked into HUDMessage, and it seems to offer better control both in terms of effects and on a per-map basis. I've managed to get it working in a few scripts like this: Spoiler Script "location_init" OPEN { HudMessage(s:e1m1locations[0]; HUDMSG_TYPEON | HUDMSG_NOTWITHFULLMAP, 1, CR_GOLD, 0.0, -0.93, 0.5, 0.03, 2.0); HudMessage(s:e1m1locations[0]; HUDMSG_PLAIN | HUDMSG_NOTWITH3DVIEW, 2, CR_GOLD, 0.0, -0.93, 0.0); Terminate; } Script "location_update" (int location_front, int location_back) { if (LineSide() == SIDE_FRONT) { HudMessage(s:e1m1locations[location_front]; HUDMSG_TYPEON | HUDMSG_NOTWITHFULLMAP, 1, CR_GOLD, 0.0, -0.93, 0.5, 0.03, 2.0); HudMessage(s:e1m1locations[location_front]; HUDMSG_PLAIN | HUDMSG_NOTWITH3DVIEW, 2, CR_GOLD, 0.0, -0.93, 0.0); } else { HudMessage(s:e1m1locations[location_back]; HUDMSG_TYPEON | HUDMSG_NOTWITHFULLMAP, 1, CR_GOLD, 0.0, -0.93, 0.5, 0.03, 2.0); HudMessage(s:e1m1locations[location_back]; HUDMSG_PLAIN | HUDMSG_NOTWITH3DVIEW, 2, CR_GOLD, 0.0, -0.93, 0.0); } } Script "location_update_silent" (int location_front, int location_back) { if (LineSide() == SIDE_FRONT) { HudMessage(s:e1m1locations[location_front]; HUDMSG_PLAIN | HUDMSG_NOTWITH3DVIEW, 2, CR_GOLD, 0.0, -0.93, 0.0); } else { HudMessage(s:e1m1locations[location_back]; HUDMSG_PLAIN | HUDMSG_NOTWITH3DVIEW, 2, CR_GOLD, 0.0, -0.93, 0.0); } } The first script shows the starting room's name and puts it on the automap as well as soon as the player starts the level. The second script will briefly flash the desired location on the screen when the player is moving from room to room and update the automap, while the third script will only update the automap (should be helpful for dealing with things like ledges, windows, and 3D floors). So far it's working like a charm, so thanks for the advice o7 Edited November 18, 2021 by SMG_Man 0 Quote Share this post Link to post
Nevander Posted November 18, 2021 Nice scripts I may have to borrow that for something later. 0 Quote Share this post Link to post
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.