- 
	
	
	
		
Trigger Bug
	
	
		Hey guys, 
I guess I need your help. I want to create some breakable windows. Actually I already made them. I made 6 windows with damage trigger. But on 5 windows my experience the following http://www.xfire.com/video/5e08bc and 1 is working perfectly with the same script. Almost every time other brush is breakable and unbreakable in the same window. I checked triggers, brushes but everything is good.
What should I do?
My script btw(but it's good):
	Code:
	
torles(trig,br)
{
        trigger=getent(trig,"targetname");
        brush=getent(br,"targetname");
        for(;;)
        {
                trigger waittill ("trigger");
                brush Delete();
                break;
                wait 0.05;
        }
        iprintln("kitört");
}
 
	 
 - 
	
	
	
	
		maybe add some more failsaves and debugprints to your code:
	Code:
	
torles( trig , br )
{
        trigger = getEnt( trig , "targetname" );
        brush = getEnt( br , "targetname" );
        if( isDefined( trigger ) )
        {
                trigger waittill( "trigger" );
                if( isDefined( brush ) )
                {
                        brush delete();
                        iPrintLn( "delete brush" );
                }
                else
                {
                        iPrintLn( "brush not defined!" );
                }
                trigger delete();
                iPrintLn( "delete trigger" );
        }
        else
        {
                iPrintLn( "trigger not defined!" );
        }
        iPrintLn( "end of function" );
}
 btw your map looks sweet =)
	 
 - 
	
	
	
	
		The for-loop is wasted (serthy already edited it out), just do this:
	Code:
	
torles(trig,br)
{
    trigger=getent(trig,"targetname");
    brush=getent(br,"targetname");
    trigger waittill ("trigger");
    brush Delete();
    iprintln("kitört");
}
// mention the "thread"
thread torles("window_0", "window_trigger_0");
thread torles("window_1", "window_trigger_1");
thread torles("window_2", "window_trigger_2");
thread torles("window_3", "window_trigger_3");
thread torles("window_4", "window_trigger_4");
thread torles("window_5", "window_trigger_5");
// and so on...
 I guess you just forgot the thread-keyword, but cant be sure, because you just posted this little piece of the whole script.
	 
 - 
	
	
	
	
		with serthy's code the same problem some pieces of windows is unbreakable.
and i use this
	Code:
	
for(i=2;i<10;i++)
    {
        temp=getent("uveg_06_0"+i,"targetname");
        temp Hide();
    }
    temp=getent("uveg_06_10","targetname");
    temp Hide();
    torles("uveg_06_01_trigger","uveg_06_01");
    for(i=2;i<10;i++)
    {
        temp=getent("uveg_06_0"+i,"targetname");
        temp Show();
    }
    temp=getent("uveg_06_10","targetname");
    temp Show();
    thread torles("uveg_06_02_trigger","uveg_06_02");
    thread torles("uveg_06_03_trigger","uveg_06_03");
    thread torles("uveg_06_04_trigger","uveg_06_04");
    thread torles("uveg_06_05_trigger","uveg_06_05");
    thread torles("uveg_06_06_trigger","uveg_06_06");
    thread torles("uveg_06_07_trigger","uveg_06_07");
    thread torles("uveg_06_08_trigger","uveg_06_08");
    thread torles("uveg_06_09_trigger","uveg_06_09");
    thread torles("uveg_06_10_trigger","uveg_06_10");
 
	 
 - 
	
	
	
	
		Why dont you use uveg_06_00_trigger, uveg_06_01_trigger?
	 
 - 
	
	
	
	
		i use uveg_06_01_trigger, the uveg_06_01 is the first window, if you break this the others will be visible and breakable
	 
 - 
	
	
	
	
		I changed the triggers to "use_touch" to detect what's wrong exactly. http://www.xfire.com/video/5e0c79 Seems that some trigger does not work at first just after i used the door next to the window, but i don't know what cause that :( In radiant everything is on the right position.
	 
 - 
	
	
	
	
		Can you release the .d3dbsp-file with current scripts, so ppl can try to fix it?
	 
 - 
	
	
	
	
		course, can u give me ur xf? and i'll give the link
	 
 - 
	
	
	
	
		Just add as attachment to your post (so everybody can test) :)