2 Questions: Fog and Loading Music on a Mission
by Jonathan Rose · in Torque Game Engine · 12/30/2004 (9:50 pm) · 14 replies
How do I change the color of the fog? I want it to be a tad more vivid than the dull grey it is right now.
Also, how do I load music upon starting a level in a way that it is specific to that level rather than just being general game music?
Also, how do I load music upon starting a level in a way that it is specific to that level rather than just being general game music?
#3
Thanks.
12/30/2004 (10:45 pm)
I wonder TGE uses shadow volumes for shadowing and can i make shadows in the fog?Thanks.
#4
12/30/2004 (11:42 pm)
TGE does not have shadow volumes built in, but there are resources avalible on this site which add support for them. I do not know of a shadow volume implementation that effects fog.
#5
I knew about that one, but what I'm really looking for is how to make specific ogg files play for a specific mission. Is there anyway to make it load from within the mission file rather than missiondownload.cs?
12/31/2004 (1:45 am)
"Check this for the musicpart"I knew about that one, but what I'm really looking for is how to make specific ogg files play for a specific mission. Is there anyway to make it load from within the mission file rather than missiondownload.cs?
#6
playing music when you start a specific mission .
you set the musictrack in the missionfile and alxplays that specific mission music.
12/31/2004 (2:07 am)
If you read the hole thread , one of the examples is what you are looking for ,playing music when you start a specific mission .
you set the musictrack in the missionfile and alxplays that specific mission music.
#7
12/31/2004 (2:11 am)
How exactly do I actually set the music track in the mission file?
#8
2) convert your game music into .ogg file with the encoder
3) name them track1.ogg, track2.ogg and so on, and copy them into data/sound.
4) edit client/scripts/audioProfiles.cs and add this code:
Now you can change from track1 to trackN in the mission file.
[EDIT] some corrections.
12/31/2004 (3:32 am)
1) download the vorbistools.2) convert your game music into .ogg file with the encoder
3) name them track1.ogg, track2.ogg and so on, and copy them into data/sound.
4) edit client/scripts/audioProfiles.cs and add this code:
new AudioDescription(AudioMusic)
{
volume = 1.0;
isStreaming = true;
isLooping= true;
is3D = false;
type = $SimAudioType;
};5) for every music track add this, and count 'track1' up to 'track2' etc in both filename and profilename:new AudioProfile(track1)
{
filename = "~/data/sound/track1.ogg";
description = "AudioMusic";
preload = false;
};6) edit client/scripts/missionDownload.cs and insert into the function onMissionDownloadComplete()alxPlay($musicTrack);7) change the function call (change the '%musicTrack' to '$musicTrack')
function onMissionDownloadPhase1(%missionName, $musicTrack)8) edit your mission file and insert the line with musictrack into the .mis file
new SimGroup(MissionGroup) {
musicTrack = "track1";
new ScriptObject(MissionInfo) {
...Now you can change from track1 to trackN in the mission file.
[EDIT] some corrections.
#9
12/31/2004 (9:51 am)
Ah. That works. Many thanks.
#10
When I start my mission, the main menu music I added fails to cut off.
I can't quite seem to figure out how to stop the music... though I think it has something to do with the command alxstop... I'm just not sure on the propper syntax and what not. I'm sure someone knows how to fix this problem...
01/01/2005 (3:24 am)
Ah, I'm in need of some more help on the issue.When I start my mission, the main menu music I added fails to cut off.
I can't quite seem to figure out how to stop the music... though I think it has something to do with the command alxstop... I'm just not sure on the propper syntax and what not. I'm sure someone knows how to fix this problem...
#11
$inGameMusic = alxPlay($musicTrack);
When you need to stop the music use alxStop($inGameMusic);
01/01/2005 (6:28 am)
Change alxPlay($musictrack) to something like this$inGameMusic = alxPlay($musicTrack);
When you need to stop the music use alxStop($inGameMusic);
#12
01/01/2005 (6:43 am)
Thanks. Got the last bit working.
#14
01/01/2005 (1:06 pm)
The music wouldn't stop.
Associate Tom Spilman
Sickhead Games
I leave the music one for someone who knows that part of Torque.