Home   Help Search Login Register  

Author Topic: Deactivating an END2????  (Read 2975 times)

0 Members and 1 Guest are viewing this topic.

Offline NightJay0044

  • Former Staff
  • ****
  • Let's make OFPEC great again
    • My Steam Workshop
Deactivating an END2????
« on: 07 Jul 2004, 02:38:59 »
My mission that iam making has a trigger that sets off an alarm.  Then that trigger makes anoteher trigger that i have end the mission because the alarm was set off.  I only want the alarm to set off when you are spotted before objective 1 is complete, not after.

My question is, how can i Deactivate the "END2" trigger, so the mission does not end when the alarm is set off and  objective 1 is complete. Becuase objective 1 is to destroy the hinds and then once the hinds are destroyed it wont matter if the alarm is set off or not.  If anybody could help me out that would be great, that's the last thing i need to do to my mission.
Who's hyped for Arma4, long live Arma!

Offline ZNorQ

  • Members
  • *
  • ehr... uhm... duh...
Re:Deactivating an END2????
« Reply #1 on: 07 Jul 2004, 10:24:41 »
If I understand you correctly, you want objective one achieved without setting an alarm. If alarm is triggered - the game is ended in a loss. But if objective is completed - the alarm won't matter? So you need atleast 2 triggers; (I assume you are West? Forgive me if I'm wrong  ;))

First trigger that is an area trigger set to END2, WEST DETECTED BY EAST - and which is covering the area in question. In the condition field you could put something like "this and !ObjectiveComplete"

ObjectiveComplete is a boolean (true or false) variable that is set to true if objective one is completed;

The next trigger is the objective 1 completed trigger. Now, as I don't know what the objective is all about, I'll just use an example; Lets say you are going to kill an officer - id enemyCaptain - you use a trigger with the following settings;

Condition: "!(alive enemyCaptain)"
OnActivation field: "ObjectiveComplete = true"
(if this is a MP mission - I suggest you use the publicVariable "ObjectiveComplete" too, in which case the onActivation line would look like this;
ObjectiveComplete = true; publicVariable "ObjectiveComplete"

I hope this helps you out...

There are problably other and better ways to do this, but it should work..

ZNorQ

Offline NightJay0044

  • Former Staff
  • ****
  • Let's make OFPEC great again
    • My Steam Workshop
Re:Deactivating an END2????
« Reply #2 on: 07 Jul 2004, 15:45:03 »
HI, thanks for your reply, it didnt work,  :( . Okay this mission you play as a black op, the name is his name box is "Jay". then you have to find enemy hinds and destroy them, there two of them, the name are "Mi1", "Mi2".  First of all i have alarm triggers in each town, and when they are set off the mission fails a few seconds later, only if objectives 1 is incomplete, but like you said if objective 1 is complete, it won't matter if the alarm is sounded.  Okay here are my triggers that i have that complete objective 1.  

-----TRIGGER 1-------(In each enemy base)

AXIS A & B= 575
West/Detected by east
TYPE: Switch
Condition: this
ON ACITAVTION: Alarm=true; Hint "You were spotted"; "1" ObjStatus "FAILED"; endmission=true

Alright on to talking about it. I have the "TYPE" in the trigger as "SWITCH", because it switches to the alarm that actually sounds, and then to the deactivation alarm that deactivates the alarm. But we really only need to worry about the 1st trigger that sets it off. NOw the first trigger, i have syncronized to each enemy unit on the map so they all go crazy once the alarm sounds. And then the "Endmissin=true" i have there becuase it ends the mission once the alarm is triggered before objective 1 is complete, and so it goes to another trigger and ends it.  

----TRIGGER 2-----(MAKES A CHECK IN THE BRIEFING ONCE THE HINDS ARE DESTROYED)

AXIS A & B: 0
CONDTION: not (alive mi1) && not (alive mi2)
ON ACTIVATION: "1" ObjStatus "DONE"; hint "Objective 1 Complete"; jay addrating 4000

Alrightk, that's pretty self exsplanatory. So i hope you get what i mean now, i tried doing what you said and it didnt work. Maybe you could explain it a little better or but maybe what i put will make up for that.. Thanks.   :)
Who's hyped for Arma4, long live Arma!

Offline h-

  • OFPEC Site
  • Administrator
  • *****
  • Formerly HateR_Kint
    • OFPEC
Re:Deactivating an END2????
« Reply #3 on: 07 Jul 2004, 15:56:32 »
-----TRIGGER 1-------(In each enemy base)

AXIS A & B= 575
West/Detected by east
TYPE: Switch
Condition: this && !objective1Complete
ON ACITAVTION: Alarm=true; Hint "You were spotted"; "1" ObjStatus "FAILED"; endmission=true

----TRIGGER 2-----(MAKES A CHECK IN THE BRIEFING ONCE THE HINDS ARE DESTROYED)

AXIS A & B: 0
CONDTION: not (alive mi1) && not (alive mi2)
ON ACTIVATION: "1" ObjStatus "DONE"; hint "Objective 1 Complete"; jay addrating 4000; objective1Complete = true
(of course you can cook up a variablename of your own..)


Should work, but no guarantees, this is no car dealership... ;D
« Last Edit: 07 Jul 2004, 15:57:13 by HateR_Kint »
Project MCAR   ---   Northern Fronts   ---   Emitter 3Ditor
INFORMATIVE THREAD TITLES PLEASE. "PLEASE HELP" IS NOT ONE..
Chuck Norris can divide by zero.

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:Deactivating an END2????
« Reply #4 on: 07 Jul 2004, 16:09:55 »
You would also need to write this in your init.sqs

objective1complete=false

This is called initialising the variable.    "Initialising" a variable just means telling the game that this variable is going to be used somewhere.    When the game meets a variable it doesn't know about, for example in trigger1 in HateR_Kint's answer, it defines the whole expression as false.    If you didn't initialise the variable, the expression "this && !objective1complete" would always be false and the trigger would never fire.

In this case the variable objective1complete is a boolean variable - it is true or false.   variables can also take values like 3 or "M16".     One of the important ways variables are used is to convey information from one trigger to another, which is what is happening here.

Trigger1 does not in fact need to be a switch trigger, because the mission is ending so it doesn't matter what the guarding groups do.    The remaining missing piece of this jigsaw is a third trigger, which looks something like this

AXIS A & B= 575
West/Detected by east
TYPE: Switch
Condition: this
ON ACITAVTION: Alarm=true

The vital thing to grasp is that a trigger can only detect one condition, one thing happening.   You have been trying to detect two different things (detected and hinds destroyed on the one hand, and detected but hinds not destroyed on the other) with only one trigger, which is why it's not been going well.    ;D

Minor detail in case you're not sure:
&& means and
! means not

"this && !objective1complete" means "this and not objective1complete"

ZNorQ and HateR_Kint have both said much the same thing in different ways, which hopefully will make things clearer.
Plenty of reviewed ArmA missions for you to play

Offline NightJay0044

  • Former Staff
  • ****
  • Let's make OFPEC great again
    • My Steam Workshop
Re:Deactivating an END2????
« Reply #5 on: 07 Jul 2004, 16:10:21 »
LOL, Not a car dealership... Thanks but that didn't work also.  The sucky part is you can't put anything in the conditon field of the alarm trigger, besides "THIS" other wise it wont set off, i've tested it out.. This is hard. i don't think what you put will deactivate the END2 Trigger.  Maybe i should give the END2 Trigger a name in the "TEXT" filed. THen do something with that.  I don't know.  It's a little confusing, i don't know if anbody has tried to deactivate an end2 trigger before. :)
Who's hyped for Arma4, long live Arma!

Offline NightJay0044

  • Former Staff
  • ****
  • Let's make OFPEC great again
    • My Steam Workshop
Re:Deactivating an END2????
« Reply #6 on: 07 Jul 2004, 16:12:12 »
Thanks MACGUBA, i havent tested yours out yet, i was just sayig the other guys didnt work......
Who's hyped for Arma4, long live Arma!

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:Deactivating an END2????
« Reply #7 on: 07 Jul 2004, 16:23:52 »
The name field of the trigger doens't come into it at all - forget about it.   It's all about condition fields and boolean variables.

This is hard, and its hard to explain too.     Forget the technicalities of what to put where in what trigger, before we get to that you need to get clear in your head how many triggers you need.    (Try thinking about them under the old fashioned name "sensors":  they sense things, detect them.  What things do you want them to sense?)    Don't worry, you're not the first person to have this problem and you won't be the last.  

The other guys' answers do basically work although they might require a bit of detailed tweaking before they fit your mission perfectly.  It's very rare to see an answer to a question that can just be dropped into a mission, it almost always requires some interpretation and understanding along the way.
« Last Edit: 07 Jul 2004, 16:26:58 by macguba »
Plenty of reviewed ArmA missions for you to play

Offline NightJay0044

  • Former Staff
  • ****
  • Let's make OFPEC great again
    • My Steam Workshop
Re:Deactivating an END2????
« Reply #8 on: 07 Jul 2004, 16:41:50 »
Your didnt' work MACGUBA, do you want me to send you my mission and you can take a look at it in the mission editor, so you know what im talking about???
Who's hyped for Arma4, long live Arma!

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:Deactivating an END2????
« Reply #9 on: 07 Jul 2004, 17:04:38 »
No.   ;D   We understand what the problem is:    the information you need to solve it is already in this thread.    Read through the thread again, carefully:  if there any bits you don't fully understand ask and we'll explain them better.    (You're probably getting frustrated that it doesn't work so it might be better to sleep on it, let your back brain digest what you've read and come back fresh tomorrow.)

Try drawing a flow chart of what you want to happen, that sometimes helps.   You know the kind of thing I mean:   has objective1 been completed?  Yes -> one direction, No -> another direction.

Plenty of reviewed ArmA missions for you to play

Offline h-

  • OFPEC Site
  • Administrator
  • *****
  • Formerly HateR_Kint
    • OFPEC
Re:Deactivating an END2????
« Reply #10 on: 07 Jul 2004, 23:21:54 »
My example works, tested it...

Of course, macguba is right about the variable initalisation...
It comes so automatically for me that I don't even notice it anymore, so that's probably why I failed to mention that... sry...

And, of course the alarm won't set off because you have the alarm=true variable there...

maybe you should make another alarm trigger with condition: this && objective1Complete and have the Alarm=true also in that trigger so when the objective 1 is completed the alarms would still sound, but would not result in END#2 trigger 'firing'...

Oh, and I assume the END#2 trigger of yours has the condition: endmission...
« Last Edit: 07 Jul 2004, 23:22:45 by HateR_Kint »
Project MCAR   ---   Northern Fronts   ---   Emitter 3Ditor
INFORMATIVE THREAD TITLES PLEASE. "PLEASE HELP" IS NOT ONE..
Chuck Norris can divide by zero.

CrashnBurn

  • Guest
Re:Deactivating an END2????
« Reply #11 on: 08 Jul 2004, 01:23:41 »
Why don't you just change the condition of your first trigger to:

this && (alive mi1) or this && (alive mi2)

If one or both of the helos are alive the alarm will sound. If they're both destroyed the trigger won't activate.

Offline h-

  • OFPEC Site
  • Administrator
  • *****
  • Formerly HateR_Kint
    • OFPEC
Re:Deactivating an END2????
« Reply #12 on: 08 Jul 2004, 06:20:56 »
Why don't you just change the condition of your first trigger to:

this && (alive mi1) or this && (alive mi2)

If one or both of the helos are alive the alarm will sound. If they're both destroyed the trigger won't activate.
Hmm...

Would work, but of course it would be quite odd to have no alarms sounding if you infiltrate a base with none of those targets alive...
I think they would generally sound the alarm in any case if an nme was spotted... ::)

Alternatively, NightJay, you could separate a endmission trigger (I still presume you use the endmission to actually activate the END#2 trigger) from the alarm trigger, so you would have the alarms sounding when Alarm=true and then in the new trigger
Condition: Alarm && !objective1Complete
On Act.: endmission=true...
« Last Edit: 08 Jul 2004, 06:22:06 by HateR_Kint »
Project MCAR   ---   Northern Fronts   ---   Emitter 3Ditor
INFORMATIVE THREAD TITLES PLEASE. "PLEASE HELP" IS NOT ONE..
Chuck Norris can divide by zero.

CrashnBurn

  • Guest
Re:Deactivating an END2????
« Reply #13 on: 08 Jul 2004, 08:22:01 »
Hmm...

Would work, but of course it would be quite odd to have no alarms sounding if you infiltrate a base with none of those targets alive...
I think they would generally sound the alarm in any case if an nme was spotted... ::)

Alternatively, NightJay, you could separate a endmission trigger (I still presume you use the endmission to actually activate the END#2 trigger) from the alarm trigger, so you would have the alarms sounding when Alarm=true and then in the new trigger
Condition: Alarm && !objective1Complete
On Act.: endmission=true...


Ya I agree, but, he says in the first post "I only want the alarm to set off when you are spotted before objective 1 is complete, not after."  ???

Offline h-

  • OFPEC Site
  • Administrator
  • *****
  • Formerly HateR_Kint
    • OFPEC
Re:Deactivating an END2????
« Reply #14 on: 08 Jul 2004, 09:05:48 »
Oh yeah... Sry... :P

I somehow got tangled in the
Quote
it wont matter if the alarm is set off or not

Well, the alarms should go off all times then... :P
Project MCAR   ---   Northern Fronts   ---   Emitter 3Ditor
INFORMATIVE THREAD TITLES PLEASE. "PLEASE HELP" IS NOT ONE..
Chuck Norris can divide by zero.

Offline ZNorQ

  • Members
  • *
  • ehr... uhm... duh...
Re:Deactivating an END2????
« Reply #15 on: 08 Jul 2004, 11:13:24 »
@macguba

I've been following you and other great contributors in the community and want to thank for your work. It is therefor with great reluctance I have to disagree with you on two points;

#1 The initialiaztion part; I agree with most of your comments to NightJay0044, but as for the initalization of the boolean variable IN THIS CASE I do disagree. The variable isn't in fact 'false' - its 'scalar bool-something-something' in which case the !objective1Complete would work. The thing that matters is that the objective1Complete isn't TRUE.. Am I right? (I don't wanna argue with you, cus I'm abit uncertain on this point :D )

#2 There is logic in using 'switch' in his trigger - if he uses the !objective1Complete as we told him. Thats because if he managed to do objective 1 before seen, the enemy would start chasing him down (oh, well, if he uses waypoints and sycronizations right - that is).

Comments?

ZNorQ

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:Deactivating an END2????
« Reply #16 on: 08 Jul 2004, 11:38:50 »
Lol you should never be reluctant to disagree with somebody's answer, they are wrong sometimes and I'm not exception.    Anyway, we're discussing, not arguing.  :)

On the variable initialisation.    If the objective has not been completed, then the variable must be in one of two states:  either false or undefined.     If it is false, that's fine, that's what we want:  when west is detected the trigger will fire.    However, if it is undefined (i.e. not initialised) then the whole expression ("this and objective1complete") will return false.   Therefore the trigger won't fire even if west has been detected and the objective has not been completed.

As for the switch trigger, all I meant was that if a trigger effectively ends the mission then it doesn't matter if its type switch or not because the groups it is switching won't be able to do anything before the mission ends.    But yes, you're right, the objective1complete trigger that doesn't end the mission should indeed be type switch.
Plenty of reviewed ArmA missions for you to play

Offline ZNorQ

  • Members
  • *
  • ehr... uhm... duh...
Re:Deactivating an END2????
« Reply #17 on: 08 Jul 2004, 12:12:27 »
Hehe, yes I'm saying it with a tad of irony to it :D.

Anyway, I see your point on the initialization bit. You might be right. If it wasn't for this work - I'd be poking the puter @ home and trying it out for myself. Hehe.

As for the switch trigger; Yes - an end trigger without any exceptions - I agree - no need to make that a switch trigger.. But NightJay0044 said he wanted (correct me if I'm wrong here) the alarm to go off no matter what - but it wouldn't end the mission if he already completed objective one. In which case the switch would make sence.

Basically, we agree with each other, macguba..  ;D

ZNorQ

Offline h-

  • OFPEC Site
  • Administrator
  • *****
  • Formerly HateR_Kint
    • OFPEC
Re:Deactivating an END2????
« Reply #18 on: 08 Jul 2004, 12:24:06 »
Actually, I'm a bit with ZNorQ on this, but also a bit with macca... ::)

It is true that boolean variables do not necessarily need to be initialised, but it's safe to do that as all of you know that OFP uses what I like to call 'The Murphy's Law' engine which means that anything that can go wrong goes wrong (and sometimes even the things that can't go wrong, go wrong...).. ::) :P

As for what macguba said about that sentence returning false is also true:
When AND/OR or IF/THEN/ELSE are used all the variables in that sentence need to be of some value, not for example that "xxxcoeefe blah blah" (it's not a value, it's a string)...
When numeric variables are used (as I like to do, 0=false, 1=true) the variables must always be initialised or else they won't exist.

I can say for a fact that for example in this particular mission the endmission variable is not initialised, but when set to true it triggers the endmission trigger...

So, when booleans are used alone they don't need to be initialised, but it is very wise to do so...


The type switch on a trigger does only apply when used on a waypoint.
I have tried huge amounts of different things with type 'none' and then with type 'switch' and only difference between them seems to appear only when synching them with waypoints...
Of course, I can be wrong... :P
« Last Edit: 08 Jul 2004, 12:33:42 by HateR_Kint »
Project MCAR   ---   Northern Fronts   ---   Emitter 3Ditor
INFORMATIVE THREAD TITLES PLEASE. "PLEASE HELP" IS NOT ONE..
Chuck Norris can divide by zero.

Offline ZNorQ

  • Members
  • *
  • ehr... uhm... duh...
Re:Deactivating an END2????
« Reply #19 on: 08 Jul 2004, 13:43:21 »
Yes, I do also think that the best thing is to initialize variables. Actually, I like programming languages that requires variable declarations before using them.

As for the switch type triggers - afaik (thx macguba for explaing that word - comes in handy now  ;D) switch is used only for waypoint; ie. a waypoint loop where you move a group from one point and back to the start using MOVE and CYCLE waypoints. Then add a SEARCH AND DESTROY type to another location. Only way (afaik (i just love that word)) to break the loop is to include a trigger of type switch. The strange part is that you have to sync it with the CYCLE - NOT the S&D waypoint... Where is the logic in that...?

ZNorQ

PS! Just remembered that there are script commands that can force change of waypoints...
« Last Edit: 08 Jul 2004, 13:46:56 by ZNorQ »

Offline h-

  • OFPEC Site
  • Administrator
  • *****
  • Formerly HateR_Kint
    • OFPEC
Re:Deactivating an END2????
« Reply #20 on: 08 Jul 2004, 14:34:21 »
Quote
switch is used only for waypoint; ie. a waypoint loop where you move a group from one point and back to the start using MOVE and CYCLE waypoints. Then add a SEARCH AND DESTROY type to another location. Only way (afaik (i just love that word)) to break the loop is to include a trigger of type switch. The strange part is that you have to sync it with the CYCLE - NOT the S&D waypoint... Where is the logic in that...?
Quite.
But some people seem to have quite a few misconceptions about the type 'switch'...
So those test I made (were a loong while ago) because I wanted to make sure myself that it has no effect on anything else than waypoints :P

And for the logic, well, there are quite a few of things in OFP that have no logic what so ever.. ;D
Switch trigger usage is just one of them... ::)
Project MCAR   ---   Northern Fronts   ---   Emitter 3Ditor
INFORMATIVE THREAD TITLES PLEASE. "PLEASE HELP" IS NOT ONE..
Chuck Norris can divide by zero.

Offline NightJay0044

  • Former Staff
  • ****
  • Let's make OFPEC great again
    • My Steam Workshop
Re:Deactivating an END2????
« Reply #21 on: 08 Jul 2004, 15:56:03 »
Hi everyone, thanks a lot for your answers..I finally got it to work thanks to Hater_kint... Appreciate it, and you can find my mission under "beta missions" in these forums under my old post the i had of "conclusion.....Thanks again.. :) ,  ;D
Who's hyped for Arma4, long live Arma!