Salk

Reset triggers

Recommended Posts

Hello!

 

A simple question: how do I reset a trigger?

 

In the game, once you enter the "hot zone" and start the trigger, you don't need/want it to trigger again upon re-entering the same area but in other cases that is desirable. Any help? :)

 

Thanks!

Share this post


Link to post
Share on other sites

A trigger is an object in the module that runs a script whenever something enters its area. I might be wrong about that and it only fires the script when the player enters but I don't think so.

 

Anyway, the script will always be fired so every trigger is repeatable by itself. In order to make it not repeatable, you can either destroy the trigger at the end of the script that was fired or simply have a condition in the beginning of the script (like VariableX == 0) and then set VariableX to 1 in the script so that the next time the script is called, the condition is no longer fulfilled. In that case, you could use another script to reactivate the trigger by setting VariableX to 0 again.

Share this post


Link to post
Share on other sites

Just adding on to what Kexikus said (he pretty much covered it):

 

Depends on the trigger, but I believe k_inc_utility or k_inc_generic has three functions; one that determines whether a trigger has fired (local boolean 10, just like people talking), one that sets whether the trigger has fired, and one that will erase a trigger after it has fired (if the trigger is meant to be a one-shot).

 

Given that, you'd need to dig into the Trigger's scripts with DeNCS to see what happens when it activates and then go from there.

Share this post


Link to post
Share on other sites

Hello and thanks for your help.

 

I am not sure I understand the mechanics though. If a trigger starts a cutscene (let's say), if it does not reset itself, how does the same cutscene not run again when the trigger is activated?

 

Also, I would really need to learn how those local booleans work. You are mentioning local boolean 10, Fair Strides. Could you please elaborate some about it?

 

Thanks a lot again!

Share this post


Link to post
Share on other sites

I can't help you with the local booleans, but your other question I can answer:

 

When the trigger fires (and starts the cutscene) this is done by a script. So in order to not have the cutscene triggered again this script will either have a condition that has to be met to start the cutscene (which might be related to the local booleans of the trigger) or the script will simply destroy the trigger object so that at a later point there no longer is a trigger that could start the cutscene.

Share this post


Link to post
Share on other sites

As for Local Variables (Booleans and Numbers), stoffe said it best:

 

http://www.lucasforums.com/showthread.php?t=173587

 

I will warn you that I don't tend to use local variables because of two reasons, the first being a very stupid one:

 

1. I don't have much experience with them.

2. In my few tests during the Pazaak Tourney I found one type (I believe Local Numbers, but can't be sure now) to be unreliable when it came to modifying the value after setting it once.

Share this post


Link to post
Share on other sites

I have spent quite some time to rework the Sith Armor quest in Taris without practically adding any Global Number or Boolean or using Local Booleans either.

 

My testing so far has been very promising.

 

I made it also sure that the player will be unable to descend to the Lower City without having both Sith Uniforms on (the dialogue with the Sith Guard/Sith Door will spawn Carth if he is not already in the party).

 

Thanks for your support, guys! ;)

  • Like 1

Share this post


Link to post
Share on other sites

I've used local numbers just fine a lot of times, almost exclusively really. Then again maybe KOTOR1 is different than KOTOR2 in that way.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.