Jump to content
Sign in to follow this  
julyTenth

A Trigger Question

Recommended Posts

I've been playing around with a mission where the player (West) should remain undetected by the East. A "West detected by East" Trigger would seem to be the best way to check that this happens, but I'm having some problems with it.

Specifically, even if I take out an East unit in one shot, with no other units around to see either me or the victim, the trigger still fires. This would appear to mean that I'm being detected by a DEAD east unit.

Is there a way to make a trigger fire only if the west is detected by a living enemy?

thanks

Share this post


Link to post
Share on other sites

the only other way is that he may already activate it before you kill him.... and i dont understand why your using west and east to activate a trigger.... whats the specific thing your trying to achieve? confused.gif

Share this post


Link to post
Share on other sites

I think that the only way to do it properly is to use the "knowsabout" command...

Share this post


Link to post
Share on other sites

You are detected (as per the trigger) once they know of your presence. If you make noise like shooting, (or driving heavy vehicle/chopper) they'll know you're there even if they cannot pinpoint you.

Share this post


Link to post
Share on other sites

</span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Quote (Kegetys @ Feb. 13 2002,14:07)</td></tr><tr><td id="QUOTE">I think that the only way to do it properly is to use the "knowsabout" command...<span id='postcolor'>

How do you use this "knowsabout" command?

Share this post


Link to post
Share on other sites

</span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Quote </td></tr><tr><td id="QUOTE"></span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Quote </td></tr><tr><td id="QUOTE">I think that the only way to do it properly is to use the "knowsabout" command...<span id='postcolor'>

How do you use this "knowsabout" command?<span id='postcolor'>

From the unoffical OFP guide...

</span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Code Sample </td></tr><tr><td id="CODE">KnowsAbout

Description :

Tells how much one unit knows about another.

Syntax :

Unit1 KnowsAbout Unit2

Unit1 is the name of a unit

Unit2 is the name of another unit

Returns :

Value between 0 and 4.

0 means Unit1 does not know about Unit2

4 means Unit1 knows exactly where Unit2 is, and what he is.

This value will decrease over time and distance. Will also lower if unit1 is not in view of unit 2 (i.e. behind bushes).  

Example :

?(MyEnemy KnowsAbout MyGuy > 2): exec "soundalarm.sqs"

Notes :

Units will not fire at an enemy unit if the knowsabout value is 1 or less.

<span id='postcolor'>

Share this post


Link to post
Share on other sites

sorry, i made a bit of a mistake with my testing of the trigger.

turns out i was being "detected" by another East unit, but i was fooled into thinking I wasn't because he didn't respond in any way - ie he was standing in "Safe" mode, but he didn't bring his gun out or otherwise react (does this mean his knowsAbout of me was less then 2?)

Can the "knowsabout" command be somehow used in script that runs through ALL Eastern units to check how much they know about the player, and then if one or more Eastern units knowsAbout >= 2, then a global variable player_detected is set to true or something?

Share this post


Link to post
Share on other sites

Whilst I was testing one of my scripts with 4 guys on a sentry WPoint I had the knowsabout value reported to me at regular intervals. The first sighting returned less than 1 generally, .6 typically and this made the sentry move a bit but he didn't really react or take his gun off his back. Generally I'd see a proper reaction around 1.3 ish.

Hope this helps.

Louis

Share this post


Link to post
Share on other sites

I've been doing tests to see what the behaviour is of various aspects of the game relative to this detection issue.

The "awareness" level, as determined by the KnowsAbout function has given me some interesting values.

Scenario... A detection trigger -- West Detected by East.  Effect set to sound the alarm.

A rolling SideChat repeating every 2 seconds to tell me the KnowsAbout value of Target1 (the guy I'm going to shoot).  There are no other enemies close enough to detect my rifle shot.  For brevity, I'll use "KA =" for the KnowsAbout

Scenario 1

Move undetected to within about 10 metres behind Target1.  Shoot him in the head with Kozlice.  Whether he dies or not, KA = 4.  If he dies, KA drops in small decimal amounts (e.g. 4, 3.98723, 3.9218.....).  Naturally, the alarm sounds.

Scenario 2

Move as above, but fire with HK.  If he drops dead from 1 shot, KA = 1.5 (consistently), otherwise KA jumps to 4 unless you didn't hit him, in which case KA = 0.25.  The first two cases set off the alarm, the last one does not.

There are variations to what action causes what KA level, but the key I think is what KA level activates the alarm (in other words, triggers my "Busted" Trigger).  From the data above, I am guessing a KA level >= 1 will constitute "detection".

The Problem

Well, that is how to determine who detected you.  Simply put, we see that a soldier whom you've just introduced to God is able to trigger "Detection", and this should not be so.

It seems the Trigger is using KA to determine whether or not Detection has occured, but is failing to consider if the detecting entity has just died.

Further more, the KA level drops very slowly afterwards, which says that the Trigger is not considering at all the status of the detecting unit (as opposed to maybe just being a simple timing issue).

In short, this Trigger scenario has a bug in it.

Solution

I can see only one way to address this...Replace the detection criteria of a trigger with our own script.  This script will be started at the beginning of the mission and run throughout (or at least as long as secrecy on your part is required).

Here is what I suggest...

In your init.sqs add "Busted = False"

Place a trigger on your map, Activation=None, Condition = Busted.  I might be wrong about Activation (comment anyone?)

The script's job is to test each and every enemy unit to see if KA >= 1 and the unit is alive.  If that condition is met, the script sets "Busted" to "True", setting off our trigger which can then sound an alarm, trigger an end to the game (I'm assuming you want this condition to constitute Mission Failure).

This script should continue to loop, but I believe it should have a delay after completing each pass through the enemy ranks.  Just how much delay I'm not sure... 0.25?  1?  More?  You'll have to suck it and see.

Important Variation

I found this whole idea fascinating, but would like for myself to continue the mission, perhaps with increased enemy activity for the next "x" minutes as a result (like a Hind searching for me for a while).

So, my "Busted" trigger has no "End" selections, but On Activation is going to call "RedAlert.sqs"

This script is going to coordinate the "search effort", and will decide when to return to "normal" vigilance status.

The search effort can be as clever as you want it to be.  Maybe this routine should do a quick KA iteration to determine which unit did the spotting.  This gives you a KA level, and a location on the map.  I would suggest the KA determine how long Red Alert status lasts, and of course the map location determines where the search begins.

Well, time to get offline and try to write all the above sad.gif

Share this post


Link to post
Share on other sites

thanks for your input, ConanOfOz smile.gif

the basic design of my mission was (in theory) pretty much what you described in your solution and variation, but i'm stuck for ideas on how to implement a script that would cycle through every unit from the eastern side to perform the relevant functions (checking for signs of life, and their knowsAbout value)

any ideas you can provide in this regard would be greatly appreciated

Share this post


Link to post
Share on other sites

</span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Quote (julyTenth @ Feb. 16 2002,01:28)</td></tr><tr><td id="QUOTE">thanks for your input, ConanOfOz smile.gif

the basic design of my mission was (in theory) pretty much what you described in your solution and variation, but i'm stuck for ideas on how to implement a script that would cycle through every unit from the eastern side to perform the relevant functions (checking for signs of life, and their knowsAbout value)

any ideas you can provide in this regard would be greatly appreciated<span id='postcolor'>

I think I'm pretty close to a solution. So long as I don't run into something unexpected, I think I'll have an answer for you (us, really, this is a generic solution) tomorrow.

Share this post


Link to post
Share on other sites

*bump* "Ouch"!

I just ran into something unexpected sad.gif

You wouldn't expect it... My script will not Loop. That's right, a simple Goto "somelabel" is not functioning. You'll see a couple of posts from me asking some questions -- these explain the problem(s) so I won't repeat it here.

The good news is I beleive I have the logic of what we need correctly developed but, of course, I can't test that arrogance until I can make the script work biggrin.gif

I'll keep you posted. Once I have a functioning "ScanForDetection.sqs" I'll probably start a new topic to announce it, and invite improvements from others...

Share this post


Link to post
Share on other sites

Alright, for the moment, the behemoth know as ScanForDetection.sqs has been adbondoned.

A far simpler script has taken it's place and, blow me down, seems to work quite as well as it's big brother.

I've placed it in a new topic called SimpleScan, since this is the name of the new script.

BTW, it works for me...

Share this post


Link to post
Share on other sites

I had some minor issues with the west detected by east or vice versa. If other soldiers detect you the problem is obvious. My problem was even if no one else can detect you and you instantly kill your target, I guess technically he still knows of your presense for a split second. My solution was to put a timeout timer on the trigger. That way they have to detect you for however long you specify, and if they die before that timer runs out, it won't trigger. This may not be exactly what you need, but it is helpful anyway.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×