Mapping (Maybe Scripting?) Questions

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.
Post Reply
User avatar
Devianteist
Posts: 945
Joined: Wed Sep 24, 2014 4:07 pm
Location: Creating a SPACE HULK conversion!
Contact:

Mapping (Maybe Scripting?) Questions

Post by Devianteist »

Hello, welcome to this pointless thread in which I will ask about things I don't really understand, despite reading the wiki. This may probably actually fit better into the Scripting section of this page, but I assume I have to do this all via some kind of wizardry with linedefs or something, so I guess I'll put it here for now?


I am working on a map, and there are specific things I want to happen when a player enters a room, and interacts with the object in said room.

Think Metroid save rooms, map rooms, etc.

When the player enters, the music track changes to reflect that they are now in a safe zone. When they leave, the music reverts back to the default level music.

When the player interacts with the object within the room, they can Save, refill their health & armor, or refill their ammo.

The music and saving are my primary issues, as I believe that I can just have the object give players an item which will restore health/armor/ammo.

Thanks for any assistance (PS, why is "How Do I...?" locked? Being curious.)
Blue Shadow
Posts: 4949
Joined: Sun Nov 14, 2010 12:59 am

Re: Mapping (Maybe Scripting?) Questions

Post by Blue Shadow »

For the music bit, there's [wiki]SetMusic[/wiki]. For the saving bit, you can do [wiki=Autosave]autosaves[/wiki].
(PS, why is "How Do I...?" locked? Being curious.)
viewtopic.php?f=48&t=58506
User avatar
Devianteist
Posts: 945
Joined: Wed Sep 24, 2014 4:07 pm
Location: Creating a SPACE HULK conversion!
Contact:

Re: Mapping (Maybe Scripting?) Questions

Post by Devianteist »

Blue Shadow wrote:For the music bit, there's [wiki]SetMusic[/wiki]. For the saving bit, you can do [wiki=Autosave]autosaves[/wiki].
(PS, why is "How Do I...?" locked? Being curious.)
viewtopic.phpf=48&t=58506
That's fair.

As for SetMusic, this looks pretty goofy, then again, I've only just started messing with values like this.

Is there any way to explain this a little more, or perhaps provide an example of it working? I realize it's probably more simple than I realize, but anyone who's spoken to me knows I'm a dunce.
Blue Shadow
Posts: 4949
Joined: Sun Nov 14, 2010 12:59 am

Re: Mapping (Maybe Scripting?) Questions

Post by Blue Shadow »

Here's a demo. Load it with Doom 2 on MAP01. Open the door and enter. The music should change to the intermission screen music. Exit the room and the music should change back to the map's default.

The demo makes use of [wiki=Classes:SecActEnter]Actor Enters Sector[/wiki] and [wiki=Classes:SecActExit]Actor Leaves Sector[/wiki] things to achieve the music toggling.
User avatar
Devianteist
Posts: 945
Joined: Wed Sep 24, 2014 4:07 pm
Location: Creating a SPACE HULK conversion!
Contact:

Re: Mapping (Maybe Scripting?) Questions

Post by Devianteist »

Blue Shadow wrote:Here's a demo. Load it with Doom 2 on MAP01. Open the door and enter. The music should change to the intermission screen music. Exit the room and the music should change back to the map's default.

The demo makes use of [wiki=Classes:SecActEnter]Actor Enters Sector[/wiki] and [wiki=Classes:SecActExit]Actor Leaves Sector[/wiki] things to achieve the music toggling.
Thank you! This should be extremely useful in helping me learn how to do this!
Post Reply

Return to “Mapping”