Home   Help Search Login Register  

Author Topic: triggers  (Read 714 times)

0 Members and 1 Guest are viewing this topic.

PimpD

  • Guest
triggers
« on: 07 Sep 2003, 18:40:49 »
hi im making a mission there   u gotta complete 2 objects then u win.

But my problem is, how do I make so when u have complete 2 objects the mission ends =/

GrimMonkey

  • Guest
Re:triggers
« Reply #1 on: 07 Sep 2003, 19:54:37 »
I'm not an expert on this but I think you put the 'End 1' or whatever number in the trigger of the one the has '"2" objstatus "Done"'. OR you make a single trigger with the 'End 1' and put 'obj1=true AND obj2=true'. Note, this line must not be altered (unless incorrect) because the AND must be there!  :)

Hope this helps :)

PimpD

  • Guest
Re:triggers
« Reply #2 on: 08 Sep 2003, 12:02:21 »
grr cant get it 2 work  >:(
« Last Edit: 08 Sep 2003, 12:03:01 by PimpD »

Offline Artak

  • The old beanbag shaker
  • Former Staff
  • ****
  • You want to talk about it, yes?
    • OFP Team Finlanders
Re:triggers
« Reply #3 on: 08 Sep 2003, 12:55:10 »
If you're using triggers to detect if the objectives have been met, you can do it like this (for example):

Trigger 1
Condition: what ever it takes to meet the objective
On activation: "1" objstatus "done"; obj1 = true

Trigger 2
Condition: what ever it takes to meet the objective
On activation: "2" objstatus "done"; obj2 = true

Trigger 3
Set this to #end1 and make sure you have no other triggers with #end1
Condition: obj1 AND obj2
On activation: titletext ["Mission complete","plain"]


If this doesn't work for you it most likely means that either one or both of the conditions have a fault and can't be met / haven't been met.

If you don't have objectives set in the briefing.html you can check if the triggers get activated by adding a line to both of the triggers which are used to determine if the objective is done. Use

hint "objective 1 ticked off"
for the firts trigger and
hint "objective 2 ticked off"
for the second trigger
Not all is lost.

Offline Burn

  • Members
  • *
Re:triggers
« Reply #4 on: 08 Sep 2003, 12:55:28 »
Make a end1 type trigger...
and in the condition field type:
"1" objStatus "done" && "2" objStatus "done"

[edit]
Or just do as Artak said ;D...
I was too slow :P...
« Last Edit: 08 Sep 2003, 12:57:42 by Bizon »

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:triggers
« Reply #5 on: 10 Sep 2003, 15:08:49 »
If you want to see a working example of this the Tutorial Mission in the Getting Started section of the tutes works just like Artak's suggestions.
Plenty of reviewed ArmA missions for you to play

PimpD

  • Guest
Re:triggers
« Reply #6 on: 10 Sep 2003, 17:28:23 »
well got it working :) well if I got 3 objects 2 do?

Can I type..


Condition: obj1 AND obj2 And obj

?

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:triggers
« Reply #7 on: 10 Sep 2003, 17:51:53 »
Yes, you can expand it to as many as you like.

If you want to get more sophisticated you can also use OR.  For example:-

obj1 and obj2 and (obj3 or obj4)
Plenty of reviewed ArmA missions for you to play

GaryP

  • Guest
Re:triggers
« Reply #8 on: 10 Sep 2003, 18:28:41 »
Do they have to be Boolean (true/false), or can I say NumOfSurvivors==2

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:triggers
« Reply #9 on: 10 Sep 2003, 18:49:13 »
The Condition field of a trigger must return a boolean, which obviously must be true for the trigger to fire.    You can acheive that in lots of different ways, including the one you suggest.

I suspect you want to learn about the command count.
Plenty of reviewed ArmA missions for you to play

Offline Artak

  • The old beanbag shaker
  • Former Staff
  • ****
  • You want to talk about it, yes?
    • OFP Team Finlanders
Re:triggers
« Reply #10 on: 10 Sep 2003, 18:50:11 »
you can check other values than boolean too in a trigger yes. For example

obj1 and obj2 and (numofsurvivors == 2)

and you can do a whole variety of these things

((not obj1 or obj2) and obj3 and numofsurvivors==2 and not (player distance gamelogic > 50)( ::))

hehe ok, you get the point

here's a line from a towing script.. so this is from a script but basicly it would work in a trogger too


Quote
?(repairtruck1 distance Vuosalmiofficer < 50) && (speed repairtruck1 == 0) && (vuosalmirepair == 0) && (_chk1 == 0): repairaction = repairtruck1 AddAction ["detach cart","action.sqs"]; _chk1 = 1
« Last Edit: 10 Sep 2003, 18:53:42 by Artak »
Not all is lost.