[Tutorial]Three Trigger Logic

Forum for discussing the Torchlight mod toolset.

[Tutorial]Three Trigger Logic

Postby Omnifas » Fri Nov 13, 2009 3:06 am

Three Trigger Logic is basically having multiple triggers(Unit Triggers) required to say open something or make the boss vulnerable to your attacks.

In this guide, I will be using a boss battle as an example. He has two stages:

1)Invulnerable/Not Targetable, but has three switches that will allow you to begin your onslaught.
2)Vulnerable/Targetable, can be killed

(Note: I tested and seem to have found a bug because the Invincible field doesn't seem to work, but it good to have both on anyways)

First things first, here is everything you will need:
Image
A map of course
The Boss, which is a Monster Building Block
The Three Triggers, which are unit triggers with a certain model selected(in this example, vases)
A Counter, which is in Logic
and a Logic Group, which is also in logic.

Here is how I set my map up, you don't need to be so elaborate in your test:
Image

First and obviously, create a basic map to place stuff on.

1.) Now Create your Monster(Right-Click on layout tab>>Building Blocks>>Monster), be sure to set him to Invincible True, and Targetable False.

2.) Now place your three unit triggers(Building Blocks>>Unit Trigger) somewhere on the map, select a model for them in the properties, and leave everything else alone.

3.) Now you have everything you need for player interaction. Its time to create the stuff that happens in the background.

4.) Create a Counter(Logic>>Counter) if you haven't already; in the Properties Change the EQUALS VALUE field to 3. The counter is the second most important piece in this guide.

5.) Now it's time to connect everything, Create a Logic Group(Logic>>Logic Group); click the little hammer/wrench that appears next to the "-"(Collapse All Groups).

6.) Drag the Monster, three triggers, and counter from the layout tab to the logic editor window.

7.) This part is what makes this thing work. In the logic editor make it look like:
Image

Greens are outputs, and blues are inputs.

Basically this Logic will add '1' for each Unit Trigger you activate(click), once it reaches 3 the counter will send it's activated signal to the Monster who at that time will become targetable and vulnerable.

Hope this enlightened people a little on basic use of the Logic Group. If you need clarification, feel free to ask.

If you want more on Logic Groups All three of the Runic Video Tutorials are about its uses.

Enjoy the editor.
User avatar
Omnifas
 
Posts: 3195
Joined: Fri Jun 05, 2009 6:43 pm
Location: California

Re: [Tutorial]Three Trigger Logic

Postby Weston » Fri Nov 13, 2009 4:14 am

Thanks so much. Coincidence that I was working on a level this morning where I want the player to have to kill 3 boss mobs before the exit gate would open up and allow them to pass and all that I had tried failed to make the gate open until I came across your Tutorial with the counter.

Thanks a lot, it was a great help.
User avatar
Weston
 
Posts: 882
Joined: Mon Oct 26, 2009 4:05 am

Re: [Tutorial]Three Trigger Logic

Postby Ojji » Sun Nov 15, 2009 10:26 am

Oh so thats what the counter is used for. Thanks man.
User avatar
Ojji
 
Posts: 149
Joined: Wed Nov 11, 2009 9:10 am
Location: Maryland

Re: [Tutorial]Three Trigger Logic

Postby gorogorosama » Tue Nov 17, 2009 7:06 pm

Any suggestions on how to get a combination lock working? Ie if you had to trigger the three triggers in the correct order? (also interested in having the possibility of repeats in the combination, so the order could be A, C, B, or A, A, B, etc.)

I've almost got it worked out just using counters and a whole lot of enable / disable, but I'm wondering if there's an easier way...
User avatar
gorogorosama
 
Posts: 200
Joined: Sun Nov 15, 2009 8:33 pm
Location: Ukraine

Re: [Tutorial]Three Trigger Logic

Postby Omnifas » Tue Nov 17, 2009 8:11 pm

gorogorosama wrote:Any suggestions on how to get a combination lock working? Ie if you had to trigger the three triggers in the correct order? (also interested in having the possibility of repeats in the combination, so the order could be A, C, B, or A, A, B, etc.)

I've almost got it worked out just using counters and a whole lot of enable / disable, but I'm wondering if there's an easier way...


I imagine the puzzle node has something to do with it but I haven't gotten around to testing it yet.
User avatar
Omnifas
 
Posts: 3195
Joined: Fri Jun 05, 2009 6:43 pm
Location: California

Re: [Tutorial]Three Trigger Logic

Postby Ojji » Tue Nov 17, 2009 8:43 pm

I tried finding those puzzles in the layouts but lost interest after searching half of crypts folder T~T
User avatar
Ojji
 
Posts: 149
Joined: Wed Nov 11, 2009 9:10 am
Location: Maryland

Re: [Tutorial]Three Trigger Logic

Postby Lolstrike » Tue Nov 17, 2009 11:06 pm

I'm pretty sure the way it works, is that you choose 2 inputs (can't remember if it's called that), then you use the 2 inputs Input1 and Input2, if they're true AT THE SAME TIME, the puzzle triggers it's activated output. Haven't tested it a lot though.
Lolstrike
 
Posts: 12
Joined: Mon Nov 09, 2009 5:01 pm

Re: [Tutorial]Three Trigger Logic

Postby gorogorosama » Wed Nov 18, 2009 3:17 pm

Yeah, I couldn't figure out what the puzzle input was supposed to do, ie what causes it to output "SUCCESS" or "FAILURE". I did get my combination lock working though, and it only took 12 Counters.

Image

1. The three triggers (A, B, and C) the player can "trigger", and then a timer that resets them to their default position after half a second so they can be triggered again.

2. A series of counters that keep track of how many times the player has flipped a switch (a different counter activates after each flipped switch, so counter 1 activates on the 1st switch, counter 2 activates on the 2nd switch attempt, etc)

3. I set up 3 Braziers to light up after each switch attempt, so the player knows how many inputs he's given.

4. A timer with a half second delay, and then a Reset counter (basically used it as a logic relay) that resets the puzzle every time the player flips 3 switches

5. An "incorrect response" node for each of the triggers A B and C

6. The "correct response" nodes. Right now my combination is "A, B, C" (very tough to crack). So trigger A will activate the "Correct Response 1", which will in turn set it up so that trigger B will activate "Correct Response 2" and trigger A will activate an "incorrect response". Finally, the third "correct response" will de-activate the Reset node, and will cause my gates to open (7.)

I still have to set up some monsters to spawn after each incorrect input, but am happy I got it working :)
User avatar
gorogorosama
 
Posts: 200
Joined: Sun Nov 15, 2009 8:33 pm
Location: Ukraine

Re: [Tutorial]Three Trigger Logic

Postby gorogorosama » Sat Nov 21, 2009 1:32 pm

Okay, I'm working on a new puzzle. Does anyone know if there's a way to allow a Player to turn a brazier off?
User avatar
gorogorosama
 
Posts: 200
Joined: Sun Nov 15, 2009 8:33 pm
Location: Ukraine

Re: [Tutorial]Three Trigger Logic

Postby exhumen » Wed Nov 25, 2009 2:39 pm

Nine Trigger "Runic" puzzle

So after reading these posts and wrangling with the Logic Group for hours I finally got what I wanted and will share the results below. To address some questions I saw here. Yes, you can make braziers toggle by setting loop style to "Back and Forth" or "Cycle", but as I found out, this has limited use for two reasons. They can bug out and go on and off very rapidly even though you just clicked them once if your character is standing in the wrong place. When in the Logic Editor "State Two" is "flame on", which brings me to the second problem with toggling. The two brazier states are like binary 0 and 1, but for whatever reason, Runic hasn't given us any logic gates (AND, OR, NOT) and the way the counter handles these two states when they are used in the "Add" input is inconsistent. In the end I went with the "No Loop" style and added a timer that periodically resets my braziers if the user hasn't entered the correct response in the alloted time. I would like to ask how gates work these days, as the timeline node I see doesn't work like the one I've seen in the videos, (I'm using Steam and TorchED v.1.0.67.156), the gate appears as a unit trigger for me.

On to my puzzle.Basically a simple 3x3 bit image puzzle (enter the correct image or "rune" and the units spawn or gate opens)

0=brazier off, 1=brazier on
Code: Select all
000                     110
000                     010
000                     011
initially              correct rune


Eventually I intend to replace the unit spawner in this logic group with a gate.
Image

In this logic group the counter will activate on 5 meaning that the 5 correct braziers are on and no others. If any others are on they will cause the counter to subtract and the counter will never reach 5. If the 15 second timer is up before the counter is activated the puzzle and counter will reset. Once all monsters spawn the puzzle and timer are disabled and the correct rune remains visible. Set the counter to "Activate only once" or you might get something weird going on.

This puzzle could be made to work at any size 4x4, 5x5,... there will just be more lines.

Note: because the counter is enabled at all times it is possible to plan to enter an incorrect rune only to have the units spawn and the puzzle become locked before you complete it.
eg. 1-6= braziers turned on (in order) 0=braziers left off
Code: Select all
 
120
030
645


In-editor screenshot of solved puzzle:
Image

Hit Me up on Steam if you need help with your dungeons, I've got some fun ideas.

EDIT: I figured out Gates and have finished my dungeon entrance chunk.
Nightrune85 on Steam
User avatar
exhumen
 
Posts: 2
Joined: Wed Nov 25, 2009 12:55 pm


Return to Torchlight Mod Discussion

Who is online

Users browsing this forum: No registered users and 6 guests