UGX-Mods

Call of Duty 5: World at War => Help Desk => Scripting => Topic started by: treyhexagon on October 12, 2020, 06:05:56 pm

Title: audio easter egg issue
Post by: treyhexagon on October 12, 2020, 06:05:56 pm
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

Title: Re: audio easter egg issue
Post by: gympie6 on October 14, 2020, 03:19:04 pm
which message(s) shows up multiple times?

Do you still need help with the "PlaySound" function?
Title: using arrays to track triggers and order
Post by: treyhexagon on January 08, 2021, 08:16:26 pm
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