UGX-Mods Login

or login with an authentication provider below
Sign In with Google
Sign In with Twitter
Sign In with Discord
Sign In with Steam
Sign In with Facebook
Sign In with Twitch

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Messages - treyhexagon

this script is used to play a random song , sfx, or vo clip it is very basic but can be easily expanded and implimented into your map.
will need to be modified for black ops 3 if you plan to use it in that game as the gsc language changed a bit but will work fine as is in WAW and BO1
Code Snippet
Plaintext
///////////////////////////////////////////////////////////////////////////////////////////////////////////
//Can use trigger damage or radius.// will need edited for trigger use
//////////////////////////////////////////////////////////////////////////////////////////////////////////
//thread rand_sound();//put with thread calls//level.IsPlaying = false;//put with thread calls default is false
//use level.IsPlaying in any other audio eggs as a flag to prevent songs from overlapping and check with an
// if statement before allowing playback
/////////////////////////////////////////////////////////////////////////////////////////////////////////
//this function can be used for music tracks, sound fx, voice overs, or whatever other kinds of sound you
//want to play
////////////////////////////////////////////////////////////////////////////////////////////////////////
rand_sound()
{


trig = getent("play_rand_song" , "targetname");

songs[songs.size] = "";//alias name in ""
songs[songs.size] = "";
songs[songs.size] = "";
songs[songs.size] = "";
songs[songs.size] = "";


song = undefined;
time = undefined;

players = getplayers();

for(;;)
{
trig waittill("trigger");
 if(level.IsPlaying == false)
{
   
    for(i = 0; i < songs.size; i++)
    {
    songs = array_randomize(songs);
    song = songs[i];
    if(song == "") time = ;// add in the alias name and set the time to be = to the length of the song in seconds for each song
    if(song == "") time = ;
    if(song == "") time = ;
    if(song == "") time = ;
    if(song == "") time = ;
        }
        for(x = 0; x < players.size; x++)
        {
        players[x] playsound(song);
       
        }

        level.IsPlaying = true;
        wait(time);
        level.IsPlaying = false;    

}

}
//thread rand_sound(); // uncomment this to reuse
}



 
 again this is a pretty basic function and was written to be a stand alone function but you could remove the trigger part of the code and set that up in another function then call this one to play a random song
1 year ago
so i been working on a map for a while and wanted to put in hud elements i got text based huds working fine but am having issues with making hud icons. do i need to create them as textures for referencing and also the function createicon in maps\mp\_hud_util just refuses to work it gives me unknown function and yes i tried both including it by #include maps\mp\_hud_util and calling the function from a function using a var and calling the function on it. ob maps\mp\_hud_util::createicon; also just tried calling the function directly without an object. honestly am stuck with no clue what to do to make it work.
1 year ago
was trying to reply but my post is locked but the answer is i did fix my original code and it works fine now but got a question i have been trying to make an audio egg using an array and am not the best with arrays at all but here is the idea, i want to use an array to play a song based on the order the triggers where hit now here is the question part how would i take the element hit and move that element to another array
i feel like im making this more confusing than it needs to be but this is a simplified version of what i want

say object[0] is hit i want it to take object[0] and add it to the next empty slot in order

so later i can check to see the order and have it play a track based on the order of the order[]

maybe this is easier than im making it but i understand arrays for crap but was the only way i could think of to do this kind of thing
that is where im stuck at im sure the rest i can figure out but the array part is what is confusing to me the code is unfinished as i dont know what to do to track my triggers

level.eggOrder = [];
level.eggOrder[0] = undefined;
level.eggOrder[1] = undefined;
level.eggOrder[2] = undefined;
level.eggOrder[3] = undefined;
level.eggOrder[4] = undefined;
level.eggOrder[5] = undefined;

level.eggObjectArray =[] ;
level.eggObjectArray[0]= getEnt ("trigger1","trigger");
level.eggObjectArray[1] = getEnt ("trigger2","trigger");
level.eggObjectArray[2] = getEnt ("trigger3","trigger");
level.eggObjectArray[3] = getEnt ("trigger4","trigger");
level.eggObjectArray[4] = getEnt ("trigger5","trigger");
level.eggObjectArray[5] = getEnt ("trigger6","trigger");

   
    for (i=0;i<level.eggObjectArray.size;i++)
    {
   
    trigs = level.eggObjectArray gettrighit(level.eggObjectArray);
   
   }
}
gettrighit(level.eggObjectArray);
{
  trigs = level.eggObjectArray;
self waittill("trigger");
//now here is where i want the magic to happen
//basically i want to get the trigger hit
  • to be moved to
  • in my other array

// basically my idea is to later do something like
//again simplified
    if(order[0]==eggObjectArray[2]&& order[1] == eggObjectArray[3])

    {
    songfuction();



// overly simplified but think maybe you get the idea here
    }
or maybe do it in a switch statement im open to suggestions on this part  
}
any help would be great im a bit lost on how i should go about doing something like this i been watching tuts on c arrays but they help 0 with this as the array examples are overly simplified so no such use of an array is examplified i also understang gsc is a bit different from c++ i seen a few ways from messing with code but looks basically the same to me
3 years ago
i was working on a map and managed to do something to it not sure what but when i load it in radiant it takes me to unnamed.map witht the texures i had in use shown in the texure window but no map everything vanished i have a copy compiled that has everything where i left off but have no idea how to recover the compiled version to use in radiant to continue the work can i extract the .map from one of the files i was really close to completing it not really interested in starting over because of something stupid
4 years ago
i been working on a map off and on when i have time been months since ive done anything to it but started working on it again to practice coding, will admit not the best at it i never took a class or anything so here is the issue i have, was working on a music easter egg and a few months ago had it working flawlessly but went back in and did some work on the map in radiant recompiled and did a test now the egg is broken a few issues the song does not play and one one of the two eggs it displays the message 3 times it should only display once it appears aside from that the code is fine no errors i tried a few things but nothing fixed it and hit a wall so here is the code i have the second egg playsound different just as a test to see if any changes so just ignore the difference ill copy and past the stuff i did below


thread not_egg_1();
    thread not_egg_2();
    thread not_egg_3();
    thread not_egg_4();
    thread not_egg_5();
    thread egg2_test0();
    thread egg2_test1();
    thread egg2_test2();
    level.not_egg_count = 0;
    level.egg_test_count = 0;

not_egg_1()
{
not_egg1_trig = getEnt ("object1","targetname");
not_egg1_model = getEnt ("model1","targetname");
not_egg1_trig waittill ("trigger");
not_egg1_trig Delete();
not_egg1_model Delete();

level.not_egg_count ++;
iPrintLnBold("This Is Not An Easter Egg!!");
wait(5);
if (level.not_egg_count == 5)
  {
level thread not_egg_finished();
  }
}


not_egg_2()
{

not_egg2_trig = getEnt ("object2","targetname");
not_egg2_model = getEnt ("model2","targetname");
not_egg2_trig waittill ("trigger");
not_egg2_trig Delete();
not_egg2_model Delete();

level.not_egg_count ++;
iPrintLnBold("Whoops, Forgot the Message");
wait(5);
if (level.not_egg_count == 5)
{
level thread not_egg_finished();
}
}
not_egg_3()
{

not_egg3_trig = getEnt ("object3","targetname");
not_egg3_model = getEnt ("model3","targetname");
not_egg3_trig waittill ("trigger");
not_egg3_trig Delete();
not_egg3_model Delete();

level.not_egg_count ++;
iPrintLnBold("Keep trying You Won't Find Anything!!");
wait(5);
if (level.not_egg_count == 5)
{
level thread not_egg_finished();
}
}

not_egg_4()
{

not_egg4_trig = getEnt ("object4","targetname");
not_egg4_model = getEnt ("model4","targetname");
not_egg4_trig waittill ("trigger");
not_egg4_trig Delete();
not_egg4_model Delete();

level.not_egg_count ++;
iPrintLnBold("HUH?");
wait(5);
if (level.not_egg_count == 5)
{
level thread not_egg_finished();
}
}

not_egg_5()
{

not_egg5_trig = getEnt ("object5","targetname");
not_egg5_model = getEnt ("model5","targetname");
not_egg5_trig waittill ("trigger");
not_egg5_trig Delete();
not_egg5_model Delete();

level.not_egg_count ++;
iPrintLnBold("Keep trying You Won't Find Anything!!");
wait(5);
if (level.not_egg_count == 5)
{
level thread not_egg_finished();
}
}


//The Egg Has Been Completed So Now Do Something
not_egg_finished()
{
           players = getPlayers();    
    for(i = 0; i < players.size; i++)
  {
  players
playSound("minorprofets" , "MITH" );
    players
iPrintLnBold("The Minor Prophets");
wait(5);
   players
iPrintLnBold("Haste The Day");
}
}

//music egg 2 test code
egg2_test0()
{
egg2_test0_trig = getEnt ("object6","targetname");
egg2_test0_model = getEnt ("model6","targetname");
egg2_test0_trig waittill ("trigger");
egg2_test0_trig Delete();
egg2_test0_model Delete();
level.egg_test_count ++;
iPrintLnBold("This Is Not An Easter Egg!!");
wait(5);
if (level.egg_test_count  == 3)
 {
level thread egg2_end();
 }


}
egg2_test1()
{
egg2_test1_trig = getEnt ("object7","targetname");
egg2_test1_model = getEnt ("model7","targetname");
egg2_test1_trig waittill ("trigger");
egg2_test1_trig Delete();
egg2_test1_model Delete();
level.egg_test_count ++;
iPrintLnBold("This Is Not An Easter Egg!!");
wait(5);
if (level.egg_test_count  == 3)
 {
level thread egg2_end();
 }

}
egg2_test2()
{
egg2_test2_trig = getEnt ("object8","targetname");
egg2_test2_model = getEnt ("model8","targetname");
egg2_test2_trig waittill ("trigger");
egg2_test2_trig Delete();
egg2_test2_model Delete();
level.egg_test_count ++;
iPrintLnBold("This Is Not An Easter Egg!!");
wait(5);
if (level.egg_test_count  == 3)
 {
level thread egg2_end();
 }

}

egg2_end()
{
        players = getPlayers();    
   for(v = 0; v < players.size; v++)
 {
 players[v] playSound("Dystopia");
   wait(5);
players[v] iPrintLnBold("Dystopia");
wait(5);
   players[v] iPrintLnBold("Megadeth");
}

}
is there something in this code that isnt correct that im missing or is the playsound set up wrong i do have 2 sounds in the alias i used the header from asylum and the first music line for the intro and modified it to reflect the songs i added and location again below

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


MITH,song\Dystopia.wav,,,1,1,,,,,,,music,,,,,,,,,,2d,streamed,,,,,,,,,,music_all,,,,,,0,,,,,,100,100,0.25,1,,
MITH,song\minorprofets.wav,,,1,1,,,,,,,music,,,,,,,,,,2d,streamed,,,,,,,,,,music_all,,,,,,0,,,,,,100,100,0.25,1,,

audio files are signed 16bit pcm using audacity and have all tags cleared as directed

any help would be great im lost on what else to do




Double Post Merge: October 12, 2020, 11:52:11 pm
fixed the above issue but now have a much more annoying one for some odd reason some iPrintlnbold messages pop up multiple times instead of the 1 time they should and the music plays but does more or less the same thing it starts the track about 3 times a few seconds apart and sounds aweful any ideas on why this may be happening

4 years ago
Loading ...