Loveboy (15th October 2013)
Thank you serthy! You can't go in the trigger, but I have got now another problem: the clip/origin of the .map bomb are blocking.
So how like default bombs are in the .map files the clips/origins in it. I can't delete them. Is it possible too to delete the clips/origins?
catch them with getentarray and delete them, if theyre script_brushmodels, otherwise, its not possible
Loveboy (16th October 2013)
only script_bushmodels are blocking? there are too worldspawn, trigger_usetouch (never delete) and this
They are brushmodelsCode:// entity 5 { "script_gameobjectname" "bombzone" "exploder" "2" "classname" "script_brushmodel" // brush 0 { ( 32 72 0 ) ( -32 72 0 ) ( -32 -80 0 ) clip_nosight 64 64 0 0 0 0 lightmap_gray 16384 16384 0 0 0 0 ( -32 -80 78 ) ( -32 72 78 ) ( 32 72 78 ) clip_nosight 64 64 0 0 0 0 lightmap_gray 16384 16384 0 0 0 0 ( -36 -128 96 ) ( 28 -128 96 ) ( 28 -128 0 ) clip_nosight 64 64 0 0 0 0 lightmap_gray 16384 16384 0 0 0 0 ( 58 -80 96 ) ( 58 72 96 ) ( 58 72 0 ) clip_nosight 64 64 0 0 0 0 lightmap_gray 16384 16384 0 0 0 0 ( 28 22 96 ) ( -36 22 96 ) ( -36 22 0 ) clip_nosight 64 64 0 0 0 0 lightmap_gray 16384 16384 0 0 0 0 ( -56 88 96 ) ( -56 -64 96 ) ( -56 -64 0 ) clip_nosight 64 64 0 0 0 0 lightmap_gray 16384 16384 0 0 0 0 } } // entity 6 { "script_gameobjectname" "bombzone" "exploder" "2" "classname" "script_brushmodel" // brush 0 { ( 32 72 0 ) ( -32 72 0 ) ( -32 -80 0 ) clip_nosight 64 64 0 0 0 0 lightmap_gray 16384 16384 0 0 0 0 ( -32 -80 78 ) ( -32 72 78 ) ( 32 72 78 ) clip_nosight 64 64 0 0 0 0 lightmap_gray 16384 16384 0 0 0 0 ( -34 22 96 ) ( 30 22 96 ) ( 30 22 0 ) clip_nosight 64 64 0 0 0 0 lightmap_gray 16384 16384 0 0 0 0 ( 44 -80 96 ) ( 44 72 96 ) ( 44 72 0 ) clip_nosight 64 64 0 0 0 0 lightmap_gray 16384 16384 0 0 0 0 ( 28 120 96 ) ( -36 120 96 ) ( -36 120 0 ) clip_nosight 64 64 0 0 0 0 lightmap_gray 16384 16384 0 0 0 0 ( -44 90 96 ) ( -44 -62 96 ) ( -44 -62 0 ) clip_nosight 64 64 0 0 0 0 lightmap_gray 16384 16384 0 0 0 0 } }
so which one delete?
Loveboy (16th October 2013)
This is how to do it:
You see the method at the foot of the function - it searches for all entities with the script_objectivename of "bombzone". Then it searches for all script_brushmodels within those entities. Then it deletes them. Simple!PHP Code:
replaceModels()
{
level.saved_origin = [];
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();
}
}
}
}
}
for( i=0; i < level.saved_origin.size; i++ )
{
replace = spawn( "script_model", level.saved_origin[i] );
replace setModel( "xmodel/vehicle_halftrack_rockets_snow_static" );
}
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" )
{
entitytypes[i] delete();
}
}
}
}
}
}
Narrowing down your search enables you to target the clips in a certain area. Otherwise, you would end up deleting all the clips on the map. And that's no good.
Loveboy (16th October 2013)
Looks soooo amazingI Like the cod4 bombside in cod2 ^^ good job guys.
Btw Loveboy, it would look better if you replace cod2 bomb model with suitcase from cod4 / mw2 / mw3.
Last edited by RobsoN; 16th October 2013 at 17:33.
"Don't worry if your code doesn't work correctly - if everything worked, you would not work" ~Mosher's right
Sure RobsoN, I would to like modify the SD gametype.
I wanted to change the TNT to Dynamite, but if the suitcase looks cool too, no problem I will do the suitcase!
kung foo man (16th October 2013)