Page 1 of 2 12 LastLast
Results 1 to 10 of 14

Thread: Trigger Bug

  1. #1
    Private
    Join Date
    Feb 2013
    Posts
    27
    Thanks
    7
    Thanked 12 Times in 5 Posts

    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");
    }

  2. The Following User Says Thank You to qwerty For This Useful Post:

    kung foo man (7th February 2013)

  3. #2
    Sergeant serthy's Avatar
    Join Date
    Nov 2012
    Posts
    450
    Thanks
    96
    Thanked 296 Times in 188 Posts
    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 =)

  4. The Following User Says Thank You to serthy For This Useful Post:

    kung foo man (7th February 2013)

  5. #3
    Assadministrator kung foo man's Avatar
    Join Date
    Jun 2012
    Location
    trailerpark
    Posts
    2,011
    Thanks
    2,102
    Thanked 1,084 Times in 753 Posts
    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.
    timescale 0.01

  6. #4
    Private
    Join Date
    Feb 2013
    Posts
    27
    Thanks
    7
    Thanked 12 Times in 5 Posts
    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");

  7. #5
    Assadministrator kung foo man's Avatar
    Join Date
    Jun 2012
    Location
    trailerpark
    Posts
    2,011
    Thanks
    2,102
    Thanked 1,084 Times in 753 Posts
    Why dont you use uveg_06_00_trigger, uveg_06_01_trigger?
    timescale 0.01

  8. #6
    Private
    Join Date
    Feb 2013
    Posts
    27
    Thanks
    7
    Thanked 12 Times in 5 Posts
    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

  9. #7
    Private
    Join Date
    Feb 2013
    Posts
    27
    Thanks
    7
    Thanked 12 Times in 5 Posts
    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.

  10. #8
    Assadministrator kung foo man's Avatar
    Join Date
    Jun 2012
    Location
    trailerpark
    Posts
    2,011
    Thanks
    2,102
    Thanked 1,084 Times in 753 Posts
    Can you release the .d3dbsp-file with current scripts, so ppl can try to fix it?
    timescale 0.01

  11. #9
    Private
    Join Date
    Feb 2013
    Posts
    27
    Thanks
    7
    Thanked 12 Times in 5 Posts
    course, can u give me ur xf? and i'll give the link

  12. #10
    Assadministrator kung foo man's Avatar
    Join Date
    Jun 2012
    Location
    trailerpark
    Posts
    2,011
    Thanks
    2,102
    Thanked 1,084 Times in 753 Posts
    Just add as attachment to your post (so everybody can test)
    timescale 0.01

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •