Cutstuff Forum

Mega Man 8-bit Deathmatch => Tutorial Collection => Topic started by: Ivory on May 18, 2011, 06:29:42 PM

Title: [Tutorial] MAPINFO + Custom Music
Post by: Ivory on May 18, 2011, 06:29:42 PM
Alright, I've seen this question asked a lot. I think it would be a great help for everyone and worth my time to write up a proper tutorial on MapInfo. Since Music is so closely related to MAPINFO, I'll also have a section for custom music and how to make it work in your maps.

Section 1: Making maps work in Zandronum

What is MAPINFO?
MapInfo by the text book definition, is how Zandronum and other ZDoom daughter ports define special characteristics for maps. This could be simple map by map episodes, what music plays in what level, how to make a hub, etc.

For what the majority of you readers, it's how to make your maps work properly in Megaman 8 Bit Deathmatch and what music plays.

Why do I need MAPINFO?
You need it to make your maps work! Without it you have no music, air control is doom's default, your map won't appear anywhere, you'll only be able to get to it by warping there. It's just not useful for online play. So all we do is add MAPINFO and bam, it works.

How do I use MAPINFO? In Theory
To make use of MAPINFO you'll need two things.

First off, MAPINFO is simply a .txt file inserted inside a .pk3 or inside the map.wad itself. The purpose of MapInfo as stated above is to make the map Zandronum friendly and to have music on your map.

How to use MAPINFO Practically
This is the method used by MM8BDM, and common to other mapmakers such as myself. To use this method, you will be making use of a master .pk3 file most likely. At the minimum, all this will contain is a few imported maps. For best results, ensure that the file name of the map.wad is the level code. In my I-Packs case, IDM##. That would be it. Inside each map.wad you will have make a blank lump. This lump will be named MAPINFO.

Below is the MAPINFO from IDM01 - Sand Canyon of the IX-Pack with comments explaining each part.
Code: [Select]
map IDM01 "Sand Canyon" //Level Code as you made it in Doom Builder and the "map name".  The map name can be anything, it doesn't matter. The Level Code HAS to match the one you used for your map.
{
   next = "IDM02" //next map in the default rotation.
   sky1 = "BLACK", 0 //in case you don't have a skybox, the sky won't be a glitchy mess and instead be the black texture. This can be changed to other textures, like elecman's sky and so forth. If you intend to have something more complex then a simple texture, you'll want a Skybox.
   cluster = 1 //Leave it alone, don't delete it, don't change the number.
   music = "IDMMUS1" //Music file name. This should match what you named the music (to be explained later).
   aircontrol = 0.5 //Leave it alone.
   forcenoskystretch //Leave it alone.
   clipmidtextures //Leave it alone.
   }

This is just for IDM01 - Sand Canyon. Each entry, IDM02, IDM03, etc. would have it's own map info.
It's pretty simple. For a visual reference, it should look something like this.
(click to show/hide)

Below is a MAPINFO Template for your convenience. Anything in all caps is meant to be changed.
Code: [Select]
map LEVELCODE "MAPNAME"
{
   next = "LEVELCODEFORNEXTMAP"
   sky1 = "BLACK", 0
   cluster = 1
   music = "MUSICLUMPNAME"
   aircontrol = 0.5
   forcenoskystretch
   clipmidtextures
   }

Section 2: Music

How do I add custom music to my map?
This is pretty simple, first we'll start off with the music itself. Assuming you have the song you want, how do you make it work?
First off, you'll need to use a program such as audacity (http://audacity.sourceforge.net/) to convert it a .ogg format. MP3's work as well, but .ogg's have excellent quality and the most minimal file size possible. It is important to ensure the lump name is UNDER 8 CHARACTERS.

Once you have your music as a .ogg, you'll need to insert it into .wad or .pk3. Two possible methods include.

Method 1 is to simply make a folder titled music in your root .pk3 and import the songs into it.
(click to show/hide)
Method 2 is to make a separate wad and import the songs into it, then import the music.wad file into the .pk3.
(click to show/hide)

How do I make it work with my maps?
With the above done, remember how in the above section we had the music = MAPLUMPNAME? Well here all we're doing is putting in the lump name.
Code: [Select]
music = "IDMMUS1" Easy huh? That's all there is to it.

Section 3: Other

So to wrap this up, if you follow my tutorial, you'll be getting your custom map packs working, complete with custom music. Now there are other possible methods for using MAPINFO and far more options. I've only detailed what it is needed to make a MM8BDM map work. For more information, check out the ZDoom Wiki article.
http://zdoom.org/wiki/MAPINFO

Good Luck future mappers.
Title: Re: [Tutorial] MAPINFO + Custom Music
Post by: LlamaHombre on May 18, 2011, 07:53:08 PM
I highly recommend stickying this to stop all questions about this.

This is a great tutorial IMO.
Title: Re: [Tutorial] MAPINFO + Custom Music
Post by: OZX on May 19, 2011, 07:32:42 PM
nice!im glad someone did this.now someone has to do it for putting all the things for mapinfo and we will have a great tutorials.
Title: Re: [Tutorial] MAPINFO + Custom Music
Post by: BiscuitSlash on May 19, 2011, 08:10:22 PM
This is a great tutorial, really should be stickied in my opinion.

Just one question: How do I make it so that a different music starts to play when the fraglimit is nearly reached? I've tried using the same coding that other custom maps use (exeption with the music code) but it never seems to play. Here is the code:
Code: [Select]
#include "zcommon.acs"

Script 1 Enter
{
if(PlayerFrags() == GetCVar("fraglimit") - 5){
SetMusic("RM4MI_B1",0);
terminate;
}
Delay(1);
restart;
}
Also, is it possible to make it not play if the game mode is duel?
Title: Re: [Tutorial] MAPINFO + Custom Music
Post by: Ivory on May 19, 2011, 08:35:51 PM
Are you remembering to compile the acs? Also try placing this line of code in.
Code: [Select]
#include "zcommon.acs"

Script 1 Enter
{
if(GetCvar("duel")==1){terminate;}
if(PlayerFrags() == GetCVar("fraglimit") - 5){
SetMusic("RM4MI_B1",0);
terminate;
}
Delay(1);
restart;
}

Not entirely sure if it will work, but it's modified off how it works in mm8bdm, so I imagine it should in theory.
Title: Re: [Tutorial] MAPINFO + Custom Music
Post by: Jakeinator on September 14, 2011, 12:10:18 AM
i cant make a new folder in SumpED :?
Title: Re: [Tutorial] MAPINFO + Custom Music
Post by: Ivory on September 14, 2011, 12:18:04 AM
Then you are probably making a wad, not a pk3.
Title: Re: [Tutorial] MAPINFO + Custom Music
Post by: Jakeinator on September 14, 2011, 01:42:03 AM
... how do you make a wad into a pk.3
also... how do you put in an ogg as a sound not a regular lump
Title: Re: [Tutorial] MAPINFO + Custom Music
Post by: Ivory on September 14, 2011, 01:44:41 AM
Well if you are just making the mapinfo for a single level, you don't need a folder. You just put the mapinfo and music in the root of the wad. If you are trying to make a .pk3, then you have to press new zip archive button. Well least you have to do that in Slade3. I forget what the exact name is called in Slumped, but it should be next to new wad.
Title: Re: [Tutorial] MAPINFO + Custom Music
Post by: Jakeinator on September 14, 2011, 03:07:38 PM
ok thx    :p
Title: Re: [Tutorial] MAPINFO + Custom Music
Post by: PotatoStrike on April 10, 2014, 04:16:38 PM
How. Just. How do you convert a .mp3 to a .ogg?
Title: Re: [Tutorial] MAPINFO + Custom Music
Post by: Russel on April 10, 2014, 04:36:28 PM
Audacity (http://audacity.sourceforge.net/download/) is a free cross-platform audio editing software that I highly recommend.
Title: Re: [Tutorial] MAPINFO + Custom Music
Post by: PotatoStrike on April 10, 2014, 04:50:42 PM
And... How do you convert mp3 to ogg?
Title: ...Do I really need to answer this...?
Post by: Russel on April 10, 2014, 04:52:02 PM
You import an mp3 file and export it as an ogg.
Title: Re: [Tutorial] MAPINFO + Custom Music
Post by: PotatoStrike on April 10, 2014, 04:59:31 PM
And can I modify it with Audacity?
Title: Re: [Tutorial] MAPINFO + Custom Music
Post by: Russel on April 10, 2014, 05:00:38 PM
Yes, you can change a sound or music or do basically anything to audio using Audacity.
Title: Re: [Tutorial] MAPINFO + Custom Music
Post by: PotatoStrike on April 10, 2014, 05:03:48 PM
But I've done it and when I want to play the music, it mute it!
Title: Re: [Tutorial] MAPINFO + Custom Music
Post by: Russel on April 10, 2014, 05:05:01 PM
do you get any sort of error...?

Actually, let's move this to PMs, this getting a bit ludicrous.
Title: Re: [Tutorial] MAPINFO + Custom Music
Post by: BookofDobson on October 17, 2014, 04:43:26 PM
"Script error, "Wep. wad: MAPINFO line 1
TOM01: Unknown top level key word"

FFFF what?

NVM got it However anytime I play the map it crashes my pc in such a way Zand won't close and I have to restart my pc
Title: Re: [Tutorial] MAPINFO + Custom Music
Post by: TheRealRoyale on July 26, 2016, 04:59:18 PM
how do i make the "boss music"?
Title: Re: [Tutorial] MAPINFO + Custom Music
Post by: MarioHead on September 15, 2016, 10:09:25 PM
¿Script for 1 vs 1 on LMS? Well, not 1 vs 1, I mean, when there remain 2 players on LMS
Title: Re: [Tutorial] MAPINFO + Custom Music
Post by: Russel on September 17, 2016, 12:55:18 AM
A lot of custom map packs use some variation on this script for non objective-focused maps:

(click to show/hide)

Just copy-paste that into the scripts of your map, change the song titles, make sure there's a line that says #include "zcommon.acs" and compile.
Title: Re: [Tutorial] MAPINFO + Custom Music
Post by: MarioHead on September 17, 2016, 09:06:53 PM
I replaced the Bossmus with "MM7FBOS" but sends me an error
"mm7fbos: identifier has not been declared."  | SCRIPTS (line 27)
(click to show/hide)
Title: Re: [Tutorial] MAPINFO + Custom Music
Post by: Russel on September 17, 2016, 09:46:35 PM
First, remove script 1
Second, BOSSSONG and VICSONG were supposed to stay as those two names.

Third, the script numbers were set up to be plug and play. There was no need to change them. Script 3 should be calling ACS_Execute(2, 0) if you're going to use those numbers.


The resulting scripts should look like:
The script should look like:
(click to show/hide)
Title: Re: [Tutorial] MAPINFO + Custom Music
Post by: MarioHead on September 17, 2016, 10:37:15 PM
Thank you! Now the map it works as it should
(click to show/hide)
^ The script if you wanna see ^
Title: Re: [Tutorial] MAPINFO + Custom Music
Post by: Russel on September 17, 2016, 11:07:11 PM
No I mean... the script I told you to remove is redundant. The script I gave you was explicitly better as it applies to all game modes.
Title: Re: [Tutorial] MAPINFO + Custom Music
Post by: MarioHead on September 19, 2016, 05:43:41 AM
Thanks again
Yeh