I'm new to level editing but have picked up the basic ropes fairly quickly,
and I've read the beginners posts about using XME to replace music files.
I'm just assuming here that there would be some level of scripting involved in getting music to trigger at a pickup or opening of a door preferably. Can anyone help me out?
Adding custom music to be triggered by a event?
- Mr.Fegelein
- Posts: 24
- Joined: Fri Apr 08, 2016 7:08 pm
- Location: The Good ol Days
- Clan Tag: [VGP]
Re: Adding custom music to be triggered by a event?
The easiest way to make a script is using GZDoomBuilder, and pressing F10. Make sure you're editing a Zandronum or zdoom map with ACS support in your options.
In the script tab, start typing in your code.
Your first line should always be:
In the future, you may add a line before that, like: to name your script, to avoid issues.
Then write a script like:
Then click "Compile Script" button in tool bar. The button's icon is a document with yellow lightning bolt.
Then in your map, edit the thing (e.g. blue armor) properties and go to "Actions" tab. For the action, click the "Browse Action" button and go to Script -> Script Execute. Then set the Script number to 123, and close properties.
Now press "Test Map" button in GZDB toolbar.
Tip: Make sure your map has a Player 1 start thing.
In the script tab, start typing in your code.
Your first line should always be:
Code: Select all
#include "zcommon.acs"
Code: Select all
#library "MYSCRIPT"
Then write a script like:
Code: Select all
script 123 (void)
{
SetMusic("D_ULTIMA");
}
Then in your map, edit the thing (e.g. blue armor) properties and go to "Actions" tab. For the action, click the "Browse Action" button and go to Script -> Script Execute. Then set the Script number to 123, and close properties.
Now press "Test Map" button in GZDB toolbar.
Tip: Make sure your map has a Player 1 start thing.