It's aslo nice, but it should look better with suitcase (we dont need the anim) because this tnt match to standard cod2 mod ( 2nd war times) .But that is only my opinion :). good luck
Printable View
It's aslo nice, but it should look better with suitcase (we dont need the anim) because this tnt match to standard cod2 mod ( 2nd war times) .But that is only my opinion :). good luck
I ported the bomb model from COD:World at War:
http://imageshack.us/a/img542/1842/pbfi.jpg
It also serves for my port of Sabotage gametype.
Ok, there is a problem with my original code - it doesn't account for the existence of more than 1 model at a bombzone. It will just spam the map with multiple models like this:
http://imageshack.us/a/img824/5924/2vj8.jpg
http://imageshack.us/a/img849/4013/604q.jpg
Also, there is a very bad error on mp_farmhouse - it deletes the whole Silo objective, and leaves a great big hole in the ground which you can fall through. The following code fixes all these problems:
PHP Code:
setupSolidSilo()
{
bombzones = getentarray( "bombzone", "targetname" );
for( i = 0; i < bombzones.size; i++ )
{
bombzone = bombzones[i];
if( isdefined( bombzone.script_label ) )
{
if( bombzone.script_label == "B" || bombzone.script_label == "b" )
{
solid = spawn( "trigger_radius", bombzone.origin+(80,30,-10), 0, 200, 70 );
solid setContents( 1 );
solid = spawn( "trigger_radius", bombzone.origin+(-80,30,-10), 0, 200, 70 );
solid setContents( 1 );
solid = spawn( "trigger_radius", bombzone.origin+(0,-80,-10), 0, 200, 70 );
solid setContents( 1 );
solid = spawn( "trigger_radius", bombzone.origin+(0,80,-10), 0, 200, 70 );
solid setContents( 1 );
}
}
}
}
deleteModel()
{
entitytypes = getentarray();
for( i = 0; i < entitytypes.size; i++ )
{
if( entitytypes[i].classname == "script_model" )
{
if( entitytypes[i].model == "xmodel/static_mp_supplies" )
{
replaceDestroyed = spawn( "script_model", entitytypes[i].origin );
replaceDestroyed setModel( "xmodel/static_mp_supplies_x" );
entitytypes[i] playsound( "flak88_explode" );
entitytypes[i] delete();
}
}
}
}
replaceModels()
{
level.saved_origin = [];
level.saved_modelType = [];
// delete existing bombzone models
entitytypes = getentarray();
for( i = 0; i < entitytypes.size; i++ )
{
if( isdefined( entitytypes[i].script_gameobjectname ) )
{
gameobjectnames = strtok( entitytypes[i].script_gameobjectname, " " );
for( k = 0; k < gameobjectnames.size; k++ )
{
if( gameobjectnames[k] == "bombzone" )
{
if( entitytypes[i].classname == "script_model" )
{
level.saved_origin[level.saved_origin.size] = entitytypes[i].origin;
entitytypes[i] delete();
}
}
}
}
}
// delete bombzone clips
entitytypes = getentarray();
for( i = 0; i < entitytypes.size; i++ )
{
if( isdefined( entitytypes[i].script_gameobjectname ) )
{
gameobjectnames = strtok( entitytypes[i].script_gameobjectname, " " );
for( k = 0; k < gameobjectnames.size; k++ )
{
if( gameobjectnames[k] == "bombzone" )
{
if( entitytypes[i].classname == "script_brushmodel" )
{
if( level.script == "mp_farmhouse" )
{
entitytypes[i] notSolid();
thread setupSolidSilo();
}
else
entitytypes[i] delete();
}
}
}
}
}
// spawn World at War bombzone model at target point A and make solid
spawnpoint = FindGround( level.saved_origin[0] );
replace = spawn( "script_model", spawnpoint );
replace setModel( "xmodel/static_mp_supplies" );
replace.angles = (-90,0,0);
solid = spawn( "trigger_radius", spawnpoint, 0, 50, 80 );
solid setContents( 1 );
bombzones = getentarray( "bombzone", "targetname" );
for( i = 0; i < bombzones.size; i++ )
{
bombzone = bombzones[i];
if( isdefined( bombzone.script_label ) )
if( bombzone.script_label == "A" || bombzone.script_label == "a" )
bombzone.origin = replace.origin+(0,0,55);
}
level.saved_origin = remove_element_from_array( level.saved_origin, level.saved_origin[0] );
// spawn World at War bombzone model at target point B and make solid
if( level.script == "mp_farmhouse" )
{
bombzones = getentarray( "bombzone", "targetname" );
for( i = 0; i < bombzones.size; i++ )
{
bombzone = bombzones[i];
if( isdefined( bombzone.script_label ) )
{
if( bombzone.script_label == "B" || bombzone.script_label == "b" )
{
replace = spawn( "script_model", (-2556, 950, -45) );
replace setModel( "xmodel/static_mp_supplies" );
replace.angles = (-90,0,0);
solid = spawn( "trigger_radius", replace.origin, 0, 50, 80 );
solid setContents( 1 );
bombzone.origin = replace.origin+(0,0,55);
}
}
}
}
else
{
spawnpoint = level.saved_origin[ randomint( level.saved_origin.size ) ];
spawn = FindGround( spawnpoint );
replace = spawn( "script_model", spawn );
replace setModel( "xmodel/static_mp_supplies" );
replace.angles = (-90,0,0);
solid = spawn( "trigger_radius", spawn, 0, 50, 70 );
solid setContents( 1 );
bombzones = getentarray( "bombzone", "targetname" );
for( i = 0; i < bombzones.size; i++ )
{
bombzone = bombzones[i];
if( isdefined( bombzone.script_label ) )
if( bombzone.script_label == "B" || bombzone.script_label == "b" )
bombzone.origin = replace.origin+(0,0,55);
}
}
}
FindGround( position )
{
trace = bulletTrace( position+(0,0,10), position+(0,0,-10000), false, undefined );
ground = trace["position"];
return ground;
}
remove_element_from_array( array, element )
{
if( !isdefined( element ) )
return( array );
newarray = [];
for( i = 0; i < array.size; i++ )
{
if( array[ i ] == element )
continue;
newarray[ newarray.size ] = array[ i ];
}
return( newarray );
}
Nice models Tally! :D
And now to RobsoN, it's from MW2 (The suitcase what you wanted :D)
If someone want these models, just ask and I will upload!
Attachment 484
Now it looks a much better :D
But without anim's of writing the code looks gay xD I will try to make that anim!
hmm I forget to delete the model if the bomb explode xD So if it explode, the bomb is still there, how did you made it Tally to delete the model if it is exploding?
ah ok, i just forgot to change something
In the file I posted, search for the word "TALLY".