UGX-Mods

Call of Duty 5: World at War => Downloadable Items for Mappers => Custom Maps, Mods & Tools => Scripts => Topic started by: Ege115 on September 08, 2014, 07:21:02 pm

Title: [Script/Sound] How to add EE music in your map.
Post by: Ege115 on September 08, 2014, 07:21:02 pm
This is a simple script I made that allows you to hit triggers with for example teddy models that will play a song once all triggers has been hit.
Okey so this is a very simple script. I didn't plan on doing this tut but some people in the UGX chat requested it so. xD
And as I haven't seen any tutorial like this at UGX then here we go.

Step 1: Create a new .GSC file and name it,
Code Snippet
Plaintext
ee_song
Make sure the file is empty and paste this script in it.
Code Snippet
Plaintext
#include common_scripts\utility;
#include maps\_utility;
#include maps\_zombiemode_utility;

main()
{
level.teddys = 0;
    thread teddys();
}

teddys()
{
    trigger = GetEntArray("dubstep_trigger","targetname");

for(h = 0; h < trigger.size; h++)
trigger[h] thread shot(trigger);
}

shot(trigger)
{
self PlayLoopSound("meteor_loop");
self SetCursorHint("HINT_NOICON");

self waittill("trigger", player);
level.teddys++;

self StopLoopSound();
self.get_var = self;
self.get_var PlaySound("meteor_affirm");
wait .05;
self delete();

if(level.teddys == trigger.size)
{
players = getplayers();
for(i = 0; i < players.size; i++)
players[i] PlaySound("ee_alias"); // Enter the soundalias here!
}
}
Save and close.

Step 2: Copy and paste this .GSC file in,
Code Snippet
Plaintext
root/mods/MAPNAME/maps/

Step 3: Open your MAPNAME.gsc and find this line,
Code Snippet
Plaintext
maps\_zombiemode::main();
Under that line, paste this,
Code Snippet
Plaintext
thread maps\ee_song::main();
Save and close.

Step 4: Copy a new soundalias file, you can find one in,
Code Snippet
Plaintext
root/raw/soundalias/
copy any of them to your desktop and rename it to,
Code Snippet
Plaintext
ee_song
Open it and delete everything inside, and then paste this in it,
Code Snippet
Plaintext
name,file,platform,sequence,vol_min,vol_max,dist_min,dist_max,limit_count,limit_type,entity_limit_count,entity_limit_type,bus,volume_min_falloff_curve,volumefalloffcurve,reverb_send,dist_reverb_max,reverb_min_falloff_curve,reverb_falloff_curve,pitch_min,pitch_max,randomize_type,spatialized,type,probability,loop,masterslave,loadspec,subtitle,compression,secondaryaliasname,chainaliasname,startdelay,speakermap,lfe percentage,center percentage,envelop_min,envelop_max,envelop percentage,occlusion_level,occlusion_wet_dry,real_delay,distance_lpf,move_type,move_time,min_priority,max_priority,min_priority_threshold,max_priority_threshold,,isbig

ee_alias,SOUND_FOLDER_PATH\SOUND_FILE_NAME.wav,,,1,1,50,800,,,,,music,,,0.8,1800,,curve0,1,1,,2d,,,,,,,,,,,,,,100,200,0.5,0.15,,,,,,90,90,0.25,1,,
When you add your .WAV file, paste it in whatever folders you choose and add the paths to it in the soundalias after the word, "ee_alias".

Step 5: Paste the soundalias in,
Code Snippet
Plaintext
root/raw/soundalias/

Step 6: Now open your map in radiant, and make a trigger and give it the KVP,
And give the trigger this KVP,
Code Snippet
Plaintext
targetname - dubstep_trigger
Make a misc_model for example a teddy and place it at the trigger.
Now have the trigger and the model selected and copy and paste as many of them as you want.
Save and close radiant, go to the "mod builder" tab in launcher and add this in the mod.CSV,
Code Snippet
Plaintext
sound,ee_song,,all_sp

Step 7: Now check the script in the IWD list in mod builder and then build your mod. And then compile your map.

Also if you don't know how to convert sound files, then here are instructions on how to convert sounds.
http://wiki.modsrepository.com/index.php?title=Call_of_Duty_5:_Custom_Sound (http://wiki.modsrepository.com/index.php?title=Call_of_Duty_5:_Custom_Sound)

Enjoy!
Title: Re: [Script/Sound] How to add EE music in your map.
Post by: FATKIDSLOV3CAK3 on September 11, 2014, 11:15:44 pm
In the ee_song.gsc you say change 3 to how many teddys you will have but what 3 do you mean? Cause I dont see any 3. Really would like to get this working :)
Title: Re: [Script/Sound] How to add EE music in your map.
Post by: ConvictioNDR on September 11, 2014, 11:31:22 pm
In the ee_song.gsc you say change 3 to how many teddys you will have but what 3 do you mean? Cause I dont see any 3. Really would like to get this working :)
I don't see any reason for it to say that. Just ignore it, it should get the size from the teddy array so that comment about changing the 3 wasn't needed. My guess is that he made this by editing some other script he had.
Title: Re: [Script/Sound] How to add EE music in your map.
Post by: FATKIDSLOV3CAK3 on September 11, 2014, 11:41:08 pm
I don't see any reason for it to say that. Just ignore it, it should get the size from the teddy array so that comment about changing the 3 wasn't needed. My guess is that he made this by editing some other script he had.

Ok thanks man. Just found out what I did wrong anyway :) so all sorted now :)

Double Post Merge: September 12, 2014, 11:33:51 am
Anyone able to tell me how to have 2 running as in I have 2 songs working but if I trigger one wait till the song has finished then trigger the other one, the 2nd one doesn't play, anyone able to help with that? As im looking to put 3 in total in my map
Title: Re: [Script/Sound] How to add EE music in your map.
Post by: Ege115 on September 12, 2014, 03:25:47 pm
Opps I'm sorry, I seem to have forgot to remove that when editing the message. :-[
Title: Re: [Script/Sound] How to add EE music in your map.
Post by: omgitsbothscarab on September 13, 2014, 10:02:46 pm
I stopped reading when I saw the word dubstep
Title: Re: [Script/Sound] How to add EE music in your map.
Post by: HitmanVere on September 13, 2014, 10:04:56 pm
I stopped reading when I saw the word dubstep

It doesnt affect the song at all :D You could change script, so it has different targetnames and such
Title: Re: [Script/Sound] How to add EE music in your map.
Post by: DeletedUser on September 14, 2014, 09:49:05 pm
I stopped reading when I saw the word dubstep
Who does not like dubstep  :D
Title: Re: [Script/Sound] How to add EE music in your map.
Post by: FATKIDSLOV3CAK3 on September 14, 2014, 10:23:45 pm
Im guessing no one seen it so I'll just quote it cause I would like to know how to do it :)

Anyone able to tell me how to have 2 running as in I have 2 songs working but if I trigger one wait till the song has finished then trigger the other one, the 2nd one doesn't play, anyone able to help with that? As im looking to put 3 in total in my map
Title: Re: [Script/Sound] How to add EE music in your map.
Post by: HitmanVere on September 16, 2014, 03:43:31 pm
Tutorial has been updated with new, "official" activation sound and has now static noise, when going near it :D
Title: Re: [Script/Sound] How to add EE music in your map.
Post by: Harry Bo21 on September 16, 2014, 11:47:53 pm
Well done HitmanVere ;) **EDIT** and Ege115  ;)

Very nice work
Title: Re: [Script/Sound] How to add EE music in your map.
Post by: HitmanVere on September 17, 2014, 10:29:16 am
Well done HitmanVere ;)

Very nice work

No, dont thank me, thank Ege115 for his skills :D I only showed him the official sounds
Title: Re: [Script/Sound] How to add EE music in your map.
Post by: DidUknowiPwn on September 17, 2014, 06:27:18 pm
Remove PlaySound and use MusicPlay(alias, bool/to distort on timescale) instead and MusicStop(int / time to fade ). Works better that playSound as it'll play in background and won't be overridden/stopped by anything else.
Make sure to put a wait on how long the song is as I'm pretty sure MusicPlay doesn't have a notify.