UE3 - General Kismet problem, dual trigger

  • Two Factor Authentication is now available on BeyondUnreal Forums. To configure it, visit your Profile and look for the "Two Step Verification" option on the left side. We can send codes via email (may be slower) or you can set up any TOTP Authenticator app on your phone (Authy, Google Authenticator, etc) to deliver codes. It is highly recommended that you configure this to keep your account safe.

Chimeray

New Member
Nov 1, 2010
3
0
0
The issue:
Player walks through trigger A (the right one in the sequence), nothing should happen. Player walks towards trigger B(the left one in the sequence) and *takes bag*. Player walks back through trigger A again and now enemies spawn.

Breakdown in logic:
Enemies can only spawn if Trigger A was activated AND Trigger B is activated again, every other possible combination should give a false output and thus, don't make enemies spawn.

This is so simple, yet I can't seem to get it to work in kismet :(

kismetsequence.jpg

So, if you walk through the Bagtrigger, an output should be generated. It should start with false and only change to true if you walk through it. So basically when you walk through it, it is activated... And stays true.

Second block is the enemies that spawn in the elevator, it has a toggle. Not in the trigger area? => false. In the area => true.

Also... I think there'll be a problem if both outputs are false, it's not really an "AND logic gate", right? :s


Anyone knows what I did wrong?
 
Last edited:

Sjosz

(╯°□°)╯︵ ┻━┻
Dec 31, 2003
3,048
0
36
Edmonton, AB
www.dregsld.com
First off, that first picture has a Compare Bool action with no Bool hooked up.
Secondly, don't use a Toggle action to check a Bool, because it changes the bool, doesn't compare.
The correct setup would be if you hook up the bool that's hooked up to Target in BagTaken to the Bool pin on the Compare Bool, and make sure that when you trigger the bool value to change it changes to whatever you want to let the logic go through and trigger enemies to spawn. Right now you're setting your Bool to compare against to false where the Compare Bool lets through logic if the bool is True.
 

Chimeray

New Member
Nov 1, 2010
3
0
0
Thanks a lot for the help! I'm still kinda confused though, I think I don't fully understand the nodes yet, even though I've spent lots of time looking at the reference on UDN. That's why I came to these forums, cos I'm at a halt :s

So, first and foremost, yes indeed... I forgot to hook up the bool, I had a ton of nodes around to test things out. And to make that screenshot I deleted the ones that were superflous to make things clearer, but seems like I hooked up that target to the toggle instead of the compare bool. So let's just pretend I did indeed hook it up to the compare bool.

1) The Bool you assign to the Bool pin in the Compare Bool node is static, right? I thought it was dynamic and changed accordingly to the input of the Bagtaken touch. Because the touch triggers a SetBool, which is by default false, and changes to true if touched. So I thought this would mean the Bool pin in Compare Bool is able to check between true and false, but (if we assume I did hook the target up to the bool pin, that it will always check against true? Or is it in fact, like I thought... dynamic and dependant on the setbool?

Simplified: Oh, Bagtaken is false cos Bagtaken trigger wasn't touched. And then later, now it's triggered and true, let's compare against true.

So, dynamic or static? :s

Then 2)
I don't really understand why I can't use a toggle right before a compare bool? I want to be able to check wether my second trigger is being touched at the very moment, or not. Thus check the active state, against the state of the 2nd trigger.


Anyways, would you be so kind as to try to explain it again? I'd very much appreciate it, I resolved the issue using a different (and easier) method. But I would like to understand it so if I need it in the future, I can use it.

In case you're wondering what I did now:
kismetsequencefixed.jpg

The trigger that spawns enemies is disabled by default, it activates when you take the bag (and thus will be activated when you walk back again, and through it). Which is what I was going for.

Thanks again for taking the time to respond!
 

Sjosz

(╯°□°)╯︵ ┻━┻
Dec 31, 2003
3,048
0
36
Edmonton, AB
www.dregsld.com
You are going about this in an inefficient way. I will take a few minutes in my lunch break to set up an example setup for what you need that does what you want it to, and I will post a screenshot of it here.

EDIT:
Some quick answers to your second post's questions:
1)
- The bool hooked up to the Compare Bool is indeed not static. It would not make sense for a Compare Bool to exist if the Bool it checks against never changes.
- The way the Compare Bool action works, is that it checks against the Bool that is hooked up to it, and then outputs whatever value it has at the time.
- You have your setup for SetBool backwards. The Target pin is the Bool that will change (and that same bool needs to be hooked up to the pin the Compare Bool checks against), and the Value pin is the value the SetBool will set the Target bool to be.

2)
You cannot use a Toggle action before your Compare Bool action because a Toggle action does not check anything, it toggles. What your setup in the first screenshot does:
- When BagTaken occurs, it set the target Bool (initially set to TRUE) to FALSE.
- Then, when you hit the other trigger, it first toggles that same bool to TRUE (Turn On = TRUE, Turn Off = FALSE) and then it goes through the Compare Bool, and because you just toggled it to TRUE with the Toggle action, it will always be TRUE at the Compare Bool action.

I hope this clarifies things a bit more, and if not, I will be posting later today with a screenshot example of what you are looking to do, but set up in a way that works and isn't breakable.



EDIT:
Example time. I've emulated the setup you showed in your screenshots as best I can. Click the thumbnail for the full size version.

[screenshot]http://img230.imageshack.us/img230/4278/kismetexamplechimeray.png[/screenshot]

Several points of note for you about the why and how I set this up:

- I have commented every single thing in the example sequence so you can see how things interact and what they do. Commenting is super handy when things eventually get complicated and you forget what that one thing did again.

- Sequential kismet is always better than parallel kismet. You could probably get away with spawning the enemies and triggering the matinee, but in general building things in a sequence where no 2 things can happen at the same time (which can cause issues if you require precision) is better.

- The Log action in my setup is only there so you can clearly see the connection from the True pin on Compare Bool to Close on the Gate. The log is useless in this case, but it was hard to see the line going through both actions.

- I have used Gate actions to make sure that things that get triggered only happen once. The Gate in the Bag picked up/triggered section automatically closes after the trigger goes through it once. The Gate below it only closes after the Compare Bool passes through True.
 
Last edited:

Chimeray

New Member
Nov 1, 2010
3
0
0
Thanks a ton for your time! Very, very useful information!
It took a lot of reads to get rid of my misconceptions though.

1) So, I understand the SetBool node now. Unfortunately the UDN wasn't clear enough for me or this could've been resolved pretty easily. Thank you for this.


2) The Compare Bool was a bit dodgy for me, I did some tests and along with your information I think I finally understand it, but I'll state my information nonetheless and see if it's correct if that's all right.

The "In" of Compare Bool tells the node when to perform the comparison (for instance, trigger touched => signal to compare => perform compare operation now).
The Compare Bool operation itself however, has nothing to do with the "In". It just outputs the value of the bool pin, if value is true, the true output is triggered. And vice versa.

In other words, Compare Bool doesn't compare 2 dynamic bools to eachother ("In" to bool pin). No, when Compare Bool is triggered, it merely gives an output signal through the false or true output, which signal is chosen is dependant on the current bool value of the bool pin.

Silly me, I thought it treated the input of "In", which is not really a value input but just a signal input (if I understand things right), as a bool (signal received (thus touched)=true, not receiving any signal at all = false) with the Bool pin. If both bool pin and "In" input are equal, output is true. If both are not equal, it goes through the false output.

I hope I finally got it right this time. It all makes sense now... "In" isn't even in red, so it has nothing to do with bools in the first place...

Kind of stupid that at its base, it's not really a comparison node, since you can't compare it to a different bool. In all honesty and in my humble opinion... not that intuitive :p If I read the UDN on compare bools now, then it does exactly what it says it does though. Guess I got carried away by the name of compare bools... and it messed with how I viewed things :/ Plus my inexperience with kismet use.


3) See how I used a toggle for the "In", I was using it as a bool input... Now I get why I can't use toggle. Essentially, I guess I could use one. But then it will only say, I touched the trigger, toggle on, fire signal and you may continue to the Compare Bool operation. Or the opposite. Well... and this whole thing is redundant cos your trigger already says when to do or not do things.


4) One thing though, the UDN on Compare Bool: "This condition fires the appropriate output link depending on the comparison of the attached bool variables."
It says "variables", meaning you can actually hook up more than 1 bool to the Bool pin? I tried messing around with it, but my experiments didn't really ring any bell. Can I check 2 bools against eachother this way, or does it do something completly different?
But the info on the output links: "True – Fires if the value of the linked bool variable is true." Talk in singular again, so perhaps a typo... or...?


5) I guess I seriously should check up on a general kismet syntax tutorial and not just assume things. This could all have been avoided I guess! I worked with Kismet some time before, for some really really simple things. I should've checked upon the basics again now. So... my bet, I am sorry for having wasted your time on these simple things, but I couldn't have done it without your information, thanks again! Proves again how important a solid base is.


So, if what I said... is true. Then it means I understood SetBools, the Toggle issue, and Compare Bools. So, the only thing that's unresolved is my question in point 4 and then I'll be gone and waste your time no more! :) (And check back in a week, or 2 for the release of my map!)
 
Last edited:

Sjosz

(╯°□°)╯︵ ┻━┻
Dec 31, 2003
3,048
0
36
Edmonton, AB
www.dregsld.com
Thanks a ton for your time! Very, very useful information!
It took a lot of reads to get rid of my misconceptions though.

1) So, I understand the SetBool node now. Unfortunately the UDN wasn't clear enough for me or this could've been resolved pretty easily. Thank you for this.

You're welcome. :)

2) The Compare Bool was a bit dodgy for me, I did some tests and along with your information I think I finally understand it, but I'll state my information nonetheless and see if it's correct if that's all right.

The "In" of Compare Bool tells the node when to perform the comparison (for instance, trigger touched => signal to compare => perform compare operation now).
The Compare Bool operation itself however, has nothing to do with the "In". It just outputs the value of the bool pin, if value is true, the true output is triggered. And vice versa.

In other words, Compare Bool doesn't compare 2 dynamic bools to eachother ("In" to bool pin). No, when Compare Bool is triggered, it merely gives an output signal through the false or true output, which signal is chosen is dependant on the current bool value of the bool pin.

This description is correct in how it works. UDN can sometimes be a bit on the stuffy side when it comes to describing things.

3) See how I used a toggle for the "In", I was using it as a bool input... Now I get why I can't use toggle. Essentially, I guess I could use one. But then it will only say, I touched the trigger, toggle on, fire signal and you may continue to the Compare Bool operation. Or the opposite. Well... and this whole thing is redundant cos your trigger already says when to do or not do things.

Yep.

4) One thing though, the UDN on Compare Bool: "This condition fires the appropriate output link depending on the comparison of the attached bool variables."
It says "variables", meaning you can actually hook up more than 1 bool to the Bool pin? I tried messing around with it, but my experiments didn't really ring any bell. Can I check 2 bools against eachother this way, or does it do something completly different?
But the info on the output links: "True – Fires if the value of the linked bool variable is true." Talk in singular again, so perhaps a typo... or...?

A single Compare Bool action can check several Bool variables at the same time. Say that you have 3 conditions that have to be True before you want a certain event to fire. You can add SetBool actions for each of the 3 events that need to happen first, and then hook up the 3 Bool variables to the Compare Bool for the event that happens after. The Compare Bool will check all the variables it is hooked up to, so if all 3 of them are True, the True out pin will fire. If 1 or 2 of those 3 variables is False, it will output the False pin. Make sense?

5) I guess I seriously should check up on a general kismet syntax tutorial and not just assume things. This could all have been avoided I guess! I worked with Kismet some time before, for some really really simple things. I should've checked upon the basics again now. So... my bet, I am sorry for having wasted your time on these simple things, but I couldn't have done it without your information, thanks again! Proves again how important a solid base is.

Kismet becomes very easy to use if you start from scratch and just learn where to go with things. It can do some awesome things if you know how. And it's not a waste of time if you now understand how things work (which seems to be the case).


So, if what I said... is true. Then it means I understood SetBools, the Toggle issue, and Compare Bools. So, the only thing that's unresolved is my question in point 4 and then I'll be gone and waste your time no more! :) (And check back in a week, or 2 for the release of my map!)

Good luck with your level. :)