Welcome to PlagueFest.com! Log in or Sign up to interact with the Plague Fest community.
  1. Welcome Guest! to interact with the community and gain access to all the site's features.

Tutorial Random breaking wall

Discussion in Resources & Tutorials started by Super Mario, May 16, 2012

  1. Oct 17, 2011
    Hi and welcome to my second tutorial. Today, i will be showing you how to make one of five walls to break randomly on a trigger. For this tutorial, you will need these:


    1. Logic_case

    2. Five func_breakable walls(or however much you want)

    3. Trigger_once

    Step 1: breakable walls

    Click on any of these walls and hit Ctrl+t and make it func_breakable. Now, go to class info and only change the material type as to whatever material you want to make it and change strength to 0. Make sure you give the wall a name. For my tutorial, i will use "wall1" as a name for the first wall. After everything is done, go to flags and check "only break on trigger" if you are following my tut and making them break ontrigger unless if you are using something else, then leave everything unchecked.Hit apply and close it after it is done.

    It will be the same thing and options for the same other walls. Tie each wall to entity func_breakable and make the same thing but give each wall a different name. So, for the second wall: wall2. Third wall: wall3. Fourth wall: wall4. fifth wall: wall5. Make sure you apply when you finish all of these. I will not put a screenie of these wall class info because they are simple and easy but will put one for the other steps

    Step 2: Logic_case

    Second step is the logic_case which is shown in figure 1 as a small entity in the middle. Double click on that case and give it a name. I will use "breakwalls_case" as a name for this tutorial.The cases don't really need anything to put in. After giving the logic_case a name, go to it's outputs and add a new output:

    My output named: OnCase01

    Target entities named: Wall1

    Via this input: Break

    Delay: 0

    This will go the same for the other walls but different case number. Here is what the others should be like: OnCase02>wall2>break>0 / OnCase03>wall3>break>0 / OnCase04>wall4>break>0 / Oncase05>wall5>break>0. Make sure you make a new oncase# for each one or else it will not work. The logic_case will target one of them when it gets triggered or fired by something else and break one of them but will explain how to make it randomly in the next step. Here is what the outputs of the logic_case should be like after they are done:


    Step 3: Trigger_once

    After the 2 steps are done, we now go and work on the trigger that is the orange brush between the walls and the logic_case. This tool is used for activating entites by triggering them. Click once on that brush and hit Ctrl+t and make it a trigger_once because we only want this to trigger once. Trigger_multiple is the same but is used for triggering multiple times. The class info should remain as it is unless if you want to change it and make something but i will use it like that for my tutorial. Make sure Clients is chekced in flags or else the trigger will not work. It is also very important that the trigger is touching the ground or else it will not work either for this tutorial.After, go to outputs and i will use "onstarttouch" for my tut that will trigger the logic_case. Here is the output:

    My output named: OnStartTouch

    Target entities named: Breakwalls_case

    Via this input: PickRandom

    Delay: 0(or whenever you want the random wall to break after seconds)

    The point of the logic_case is to target one of it's cases and trigger it as what you want it to do for the input. So now, we have a trigger_once that triggers the logic_case that triggers a random wall to break whenever a player steps on that trigger_once to cause this happen. Here is what the output of the trigger_once should be like after it's done:


    Extra step:2 or more walls to break

    You can also make 2 walls break by holding shift and dragging the logic_case and clicking on the second one and changing it's name to like "breakwalls_case2". After that, you can go to the trigger_once and making the same new output as the first one but changing the Target entities named to "breakwalls_case2" and now it will pick two walls to break. It will be the same step if you want 3 or more walls to break.

    One warning: this has happened to me once where the two logic_cases triggered the same wall to break, so it is not your fault if this happens to you too because it happens sometimes where a player steps on the trigger that toggles the tow logic_cases that both pick one wall and break it.

    Thank you for watching my second tutorial. I hope this was helpful and sorry for the bad grammar.