Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Script error (Again)
Abion47 Offline
Senior Member

Posts: 369
Threads: 22
Joined: Oct 2015
Reputation: 46
#7
RE: Script error (Again)

(07-08-2016, 04:28 PM)Hypercube Wrote: First of all, you don't include the .ogg at the end, I mean, does it matter? I am able to type the file name without it, I am pretty sure it just reads the name. Second of all, the second parameter is a floating point type variable if I am correct, so you can't just leave it as 1 and that's it, you'd have to write it out as 1.0f. Lastly, the fourth parameter is the priority for the music and not just a value, so you cannot write it as a number. An example of what you would put there is eMusicPrio_BgAmb.

You don't need to add the file extension, but it's still a good thing to do for organizational purposes. ("music" isn't very descriptive, but "music.ogg" says exactly what the file is). Also, the parameter is a float, but the compiler is smart enough that if you five it an int it will convert it to a float automatically. Your point about the eMusicPrio is correct, though if Venom Fox wants the music to have a priority of 2, then the equivalent enum value is eMusicPrio_MinorEvent. (Of course, eMusicPrio_MinorEvent is meant for just that... minor events. That priority level shouldn't be used on just background music. I'd recommend using eMusicPrio_SceneAmb, since it sounds like you are trying to play this music in a certain area of your map.)

(07-08-2016, 04:42 PM)Venom Fox Wrote:
(07-08-2016, 04:28 PM)Hypercube Wrote: First of all, you don't include the .ogg at the end, I mean, does it matter? I am able to type the file name without it, I am pretty sure it just reads the name. Second of all, the second parameter is a floating point type variable if I am correct, so you can't just leave it as 1 and that's it, you'd have to write it out as 1.0f. Lastly, the fourth parameter is the priority for the music and not just a value, so you cannot write it as a number. An example of what you would put there is eMusicPrio_BgAmb.

And as for the error you got, did you type something different for the function in the script file then what you put in the trigger area? Because if it says something different then it won't be able to find method bool Trigger_playmusic(), at least that's what happened to me before. Also be sure to check other people's work to get an idea of how to write out the code, such as a short mod with not the much to its script file you could find the section where it plays music easily and just copy the looks of the code.

Here's mine - Music_Play("Immuration", 1.0f, true, eMusicPrio_BgAmb);

Right so I gave up on the idea that the music is triggered by an area, instead I put it in the void OnEnter like this;

void OnEnter()
{
Music_Play("01_docks", 1.0f, true, eMusicPrio_BgAmb);
}

But it still won't play, the HPL log says nothing. I even removed the ambient sounds from the map, but that didn't accomplish anything.

The code is fine, but it's weird that the music isn't playing and there are no error messages popping up. Is your music volume turned down in the game settings?
(This post was last modified: 07-08-2016, 05:24 PM by Abion47.)
07-08-2016, 05:20 PM
Find


Messages In This Thread
Script error (Again) - by Venom Fox - 07-08-2016, 11:48 AM
RE: Script error (Again) - by Romulator - 07-08-2016, 01:36 PM
RE: Script error (Again) - by Venom Fox - 07-08-2016, 02:40 PM
RE: Script error (Again) - by Hypercube - 07-08-2016, 04:28 PM
RE: Script error (Again) - by Venom Fox - 07-08-2016, 04:42 PM
RE: Script error (Again) - by Abion47 - 07-08-2016, 05:20 PM
RE: Script error (Again) - by Hypercube - 07-08-2016, 05:29 PM
RE: Script error (Again) - by Abion47 - 07-08-2016, 05:43 PM
RE: Script error (Again) - by Venom Fox - 07-08-2016, 06:36 PM
RE: Script error (Again) - by Hypercube - 07-08-2016, 04:59 PM
RE: Script error (Again) - by Venom Fox - 07-08-2016, 05:27 PM
RE: Script error (Again) - by Venom Fox - 07-08-2016, 05:33 PM
RE: Script error (Again) - by Hypercube - 07-08-2016, 06:37 PM
RE: Script error (Again) - by Venom Fox - 07-08-2016, 06:53 PM
RE: Script error (Again) - by Abion47 - 07-08-2016, 06:58 PM
RE: Script error (Again) - by Venom Fox - 07-08-2016, 07:07 PM
RE: Script error (Again) - by Daemian - 07-08-2016, 10:58 PM
RE: Script error (Again) - by Venom Fox - 07-09-2016, 03:11 PM
RE: Script error (Again) - by Hypercube - 07-09-2016, 07:36 PM
RE: Script error (Again) - by Venom Fox - 07-09-2016, 08:32 PM
RE: Script error (Again) - by Venom Fox - 07-10-2016, 11:54 AM
RE: Script error (Again) - by Venom Fox - 07-10-2016, 01:57 PM



Users browsing this thread: 1 Guest(s)