you should try this instead of renaming every trigger and its pair on your own:
>new map
>create a trigger_damage > targetname = "trigger_glass"
>create your unbroken window > make it a scrpt_brushmodel
>create your broken window > make it a scrpt_brushmodel
>firstly select your trigger > secondly select your unbroken window > hit [W] to connect them (line poining from the trigger to the window should appear)
>unselect all [i]
>firstly select your unbroken > secondly select your broken window > hit [W] to connect them (again a line poining from the unbroken window to the broken one should be visible)
>save it as a prefab
now you can add this prefab whereever you want and how often you want in your map script (without renaming):
Code:
init()
{
glassTriggers = getEntArray( "trigger_glass" , "targetname" );
if( isDefined( glassTriggers ) && glassTriggers.size )
{
for( i = 0 ; i < glassTriggers.size ; i++ )
{
if( isDefined( glassTriggers[i] ) )
glassTriggers[i] thread monitorGlassTrigger();
else
iPrintLn( "undefined glassTrigger found for some reason!" );
}
}
else
{
iPrintLn( "NO glassTriggers FOUND IN MAP!" );
}
}
monitorGlassTrigger()
{
window = undefined;
if( isDefined( self.target ) )
{
window = getEnt( self.target , "targetname" );
}
if( !isDefined( window ) )
{
iPrintLn( "GlassTrigger at " + self.origin + " has no window as target!" );
return;
}
broken = undefined;
if( isDefined( window.target ) )
{
broken = getEnt( window.target , "targetname" );
}
if( !isDefined( window ) )
{
iPrintLn( "window at " + window.origin + " has no broken window as target!" );
}
window show();
broken hide();
trigger waittill( "trigger" );
trigger delete();
window delete();
broken show();
}
i think izno may help you with the scripting abit more^^
anyway, your better with using prefabs instead of naming every trigger / window pair by hand..