Home   Help Search Login Register  

Author Topic: Trigger to end mission when objectives are complete ??  (Read 578 times)

0 Members and 1 Guest are viewing this topic.

Harvey

  • Guest
Hi there

Im fairly new to all this and I have a question to which I thought the answer was fairly simple. Well, I havent been able to work it out !!

Basically I have a mission with 3 objectives. What I want is a trigger that ends the mission when all 3 objectives are complete. So I have the objective triggers set up fine, they all complete and tick off correctly in the briefing, but I cant get the mission to end :-( I suspect it is the trigger I am using to end the mission, which has the condition field :

(obj==DONE and obj2==DONE and obj3==DONE)

with Type End #1.

Any help on this would be much appreciated !

Thanks !

Harvey

  • Guest
Re:Trigger to end mission when objectives are complete ??
« Reply #1 on: 06 Dec 2004, 10:31:45 »
OK, well I now have a variable in each of the objective triggers which reads :

"1/2/3" objstatus "DONE"; obj1/2/3=TRUE (with / just indicating the use of 3 different numbers)

But I still cant work out what to put in the end trigger condition field....:-((

I had the idea it might be :

"(obj1=TRUE and obj2=TRUE and obj3=TRUE) but it doesnt like that....

Help please !! :-)
« Last Edit: 06 Dec 2004, 10:32:05 by Harvey »

Offline h-

  • OFPEC Site
  • Administrator
  • *****
  • Formerly HateR_Kint
    • OFPEC
Re:Trigger to end mission when objectives are complete ??
« Reply #2 on: 06 Dec 2004, 10:34:08 »
http://www.ofpec.com/editors/resource_view.php?id=67 :P

Furthermore, your condition field should just read:
obj1 && obj2 && obj3

&& means 'and'...

EDIT:
When checking boolean variables (true/false)
Code: [Select]
? !variableNamechecks if the variable variableName is false,
Code: [Select]
? variableNamechecks if variableName is true...

! means the same as 'not'...

EDIT2:
Aw....
So, in a triggers condition field you just put obj1 and the trigger activates when the variable obj1 is set to true somewhere...

So that obj1 && obj2 && obj3 will activate the trigger once all of those three variables are true...
« Last Edit: 06 Dec 2004, 10:39:41 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 MachoMan

  • Honoured
  • Former Staff
  • ****
  • KISS, Keep it Simple Stupid
Re:Trigger to end mission when objectives are complete ??
« Reply #3 on: 06 Dec 2004, 10:45:40 »
Furthermore, your condition field should just read:
obj1 && obj2 && obj3

&& means 'and'...


Not quite, using and is also correct.
see the comref.

The rest is all true.
Get those missions out there you morons!

Harvey

  • Guest
Re:Trigger to end mission when objectives are complete ??
« Reply #4 on: 06 Dec 2004, 10:47:56 »
OK it returns an error when I put "obj1 && obj2 && obj3" in the condition field of the end trigger - "Error &&:Type expected object, Bool"

Let me reclarify :-)

I have 3 triggers each with the activation - "1/2/3" objstatus "DONE", etc and the relevant condition. These all work fine and tick off correctly in the briefing. I have added the line "obj1/2/3=TRUE" to each activation field, this doesnt seem to effect whether the trigger triggers or not.

So now I just need an end trigger which triggers the end of the level when all 3 triggers are true or complete or whatever.

Offline h-

  • OFPEC Site
  • Administrator
  • *****
  • Formerly HateR_Kint
    • OFPEC
Re:Trigger to end mission when objectives are complete ??
« Reply #5 on: 06 Dec 2004, 10:55:09 »
Quote
Not quite, using and is also correct.
Eh...
Yes, I know that... ::)

I'm just so used to use &&, !, || etc., so I can't type with any other way anymore :P
Even in normal text I sometimes find myself using && instead of and ;D

Quote
OK it returns an error when I put "obj1 && obj2 && obj3" in the condition field of the end trigger - "Error &&:Type expected object, Bool"
What the hell??!!
That's impossible ;D

Altough, I hope you're not using any of those "" quotes in there, other than that this sounds very weird...

EDIT:
Just a thought, do you have some vehicles/men/etc named as obj1, obj2 and/or obj3??
If so, that causes the problem...
« Last Edit: 06 Dec 2004, 10:56:56 by HateR_Kint »
Project MCAR   ---   Northern Fronts   ---   Emitter 3Ditor
INFORMATIVE THREAD TITLES PLEASE. "PLEASE HELP" IS NOT ONE..
Chuck Norris can divide by zero.

Harvey

  • Guest
Re:Trigger to end mission when objectives are complete ??
« Reply #6 on: 06 Dec 2004, 11:07:33 »
Ahh I have it sorted now :-)
Thanks guys !!

The problem was I had the "name" of each trigger as "obj1/2/3" and then I was also calling a line in the activation field as "obj1/2/3=true" so using the same name twice...

It works now anyway, thanks :-)

Offline h-

  • OFPEC Site
  • Administrator
  • *****
  • Formerly HateR_Kint
    • OFPEC
Re:Trigger to end mission when objectives are complete ??
« Reply #7 on: 06 Dec 2004, 11:34:08 »
Yeah, the reason for this is that the variables you set in the triggers are called global variables, they are available anywhere in the mission (triggers, waypoints, scripts..) and the names of the different objects (triggers, men,vehicles,etc...) are also global variables so two of the same global variables cause problems...

Oh, and when problem is solved, use the 'solve' button ;)
Project MCAR   ---   Northern Fronts   ---   Emitter 3Ditor
INFORMATIVE THREAD TITLES PLEASE. "PLEASE HELP" IS NOT ONE..
Chuck Norris can divide by zero.