UGX-Mods

Call of Duty 5: World at War => Help Desk => Scripting => Topic started by: jackcapel on March 16, 2019, 04:09:01 pm

Title: Mystery Box won't Move (Sniperbolt Prefabs)
Post by: jackcapel on March 16, 2019, 04:09:01 pm
I have placed 4 Mystery Boxes From the Sniperbolt Prefabs. But whenever I use them They fly up in the air after the teddy bear then just go back to the original position
Code Snippet
Plaintext
	// Magic Boxes -- The Script_Noteworthy Value Names On Purchase Trigger In Radiant
boxArray = [];
boxArray[ boxArray.size ] = "start_chest";
boxArray[ boxArray.size ] = "chest1";
boxArray[ boxArray.size ] = "chest2";
boxArray[ boxArray.size ] = "chest3";
boxArray[ boxArray.size ] = "chest4";
boxArray[ boxArray.size ] = "chest5";
level.DLC3.PandoraBoxes = boxArray;
Code Snippet
Plaintext
{

flag_set("moving_chest_enabled");

while ( 1 )
{
level.chests = array_randomize(level.chests);

if( isdefined( level.random_pandora_box_start ) )
break;
   
if ( !IsDefined( level.chests[0].script_noteworthy ) || ( level.chests[0].script_noteworthy != "start_chest" ) )
{
break;
}

}

level.chest_index = 0;

while(level.chest_index < level.chests.size)
{

if( isdefined( level.random_pandora_box_start ) )
break;

            if(level.chests[level.chest_index].script_noteworthy == "start_chest")
            {
                 break;
            }
           
            level.chest_index++;     
      }

//init time chest accessed amount.

if(level.script != "nazi_zombie_prototype")
{
level.chest_accessed = 0;
}

if(isDefined(level.DLC3.usePandoraBoxLight) && level.DLC3.usePandoraBoxLight)
{
// Anchor target will grab the weapon spawn point inside the box, so the fx will be centered on it too
anchor = GetEnt(level.chests[level.chest_index].target, "targetname");
anchorTarget = GetEnt(anchor.target, "targetname");

level.pandora_light = Spawn( "script_model", anchorTarget.origin );
level.pandora_light.angles = anchorTarget.angles + (-90, 0, 0);
//temp_fx_origin rotateto((-90, (box_origin.angles[1] * -1), 0), 0.05);
level.pandora_light SetModel( "tag_origin" );
playfxontag(level._effect["lght_marker"], level.pandora_light, "tag_origin");
}
// DCS: we need a smaller light in the catacombs for paris, the generic one fills the area under the tower.
else if(level.script == "nazi_zombie_paris")
{
// Anchor target will grab the weapon spawn point inside the box, so the fx will be centered on it too
anchor = GetEnt(level.chests[level.chest_index].target, "targetname");
anchorTarget = GetEnt(anchor.target, "targetname");

level.pandora_light = Spawn( "script_model", anchorTarget.origin );
level.pandora_light.angles = (-90, 0, 0);
level.pandora_light SetModel( "tag_origin" );
//playfxontag(level._effect["lght_marker"], level.pandora_light, "tag_origin");
}

//determine magic box starting location at random or normal
init_starting_chest_location();

}
If anyone can help please and thank you