Home   Help Search Login Register  

Author Topic: i need a trigger condition please...  (Read 3285 times)

0 Members and 1 Guest are viewing this topic.

Offline filth

  • Members
  • *
  • Who's the bad man?
i need a trigger condition please...
« on: 21 Jun 2007, 15:43:07 »
i need a trigger to fire when:

any four members of a group are present inside the trigger area.

and i don't know the syntax for the condition field.

can anyone help please?

cheers,

filth.
« Last Edit: 29 Jun 2007, 13:10:32 by filth_merchant 101 »

Offline filth

  • Members
  • *
  • Who's the bad man?
Re: i need a trigger condition please...
« Reply #1 on: 21 Jun 2007, 17:11:44 »
actually...

a slight amend...

i need the trigger to fire when any four members of two different groups are present inside the trigger area.

that is to say if i start the mission with two squads of eight soldiers each, any four of those 16 soldiers can be present inside the trigger for it to fire.

cheers,

filth.

Offline bedges

  • Administrator
  • *****
    • OFPEC The Editing Center
Re: i need a trigger condition please...
« Reply #2 on: 21 Jun 2007, 17:29:07 »
 :dry:

you've been a member of this site long enough to know about the modify button... do not double post.

condition

Code: [Select]
((_x in thislist) count units group_one) + ((_x in thislist) count units group_two) > 4
« Last Edit: 21 Jun 2007, 17:32:28 by bedges »

Offline Mr.Peanut

  • Former Staff
  • ****
  • urp!
Re: i need a trigger condition please...
« Reply #3 on: 21 Jun 2007, 18:46:28 »
Should be > 3
urp!

Offline filth

  • Members
  • *
  • Who's the bad man?
Re: i need a trigger condition please...
« Reply #4 on: 21 Jun 2007, 19:41:13 »
er.. actually, i've never used the modify button. and didn't know it was there. sorry. but i know now.

thanks for the condition line. but it's throwing up the error:

local variable in global space.

also, will this check to see if the members of the groups are within the trigger area?and if i name the groups alpha and bravo, should the syntax be as follows:

((_x in thislist) count units group_alpha) + ((_x in thislist) count units group_bravo) > 3

?

thx.
« Last Edit: 21 Jun 2007, 20:07:57 by bedges »

Offline bedges

  • Administrator
  • *****
    • OFPEC The Editing Center
Re: i need a trigger condition please...
« Reply #5 on: 21 Jun 2007, 20:08:37 »
my error, it should be

Code: [Select]
({_x in thislist} count units group_one) + ({_x in thislist} count units group_two) >= 4
curly braces.

Offline filth

  • Members
  • *
  • Who's the bad man?
Re: i need a trigger condition please...
« Reply #6 on: 21 Jun 2007, 21:19:18 »
i'm not getting the trigger to fire :(

this is what i have in the leader of the first groups' init line:

alpha = group this.

this is what i have in the init line of the second group leader:

bravo = group this

this is what i have in the condition field of the trigger:

({_x in thislist} count units alpha) + ({_x in thislist} count units bravo) >= 4

i have 6 members of two groups (three from each) standing inside the trigger.

but it's not firing.

can anyone explain why?

thx.

Offline bedges

  • Administrator
  • *****
    • OFPEC The Editing Center
Re: i need a trigger condition please...
« Reply #7 on: 21 Jun 2007, 21:37:49 »
what is the trigger activated by? east? west? none? it needs to know what's supposed to trigger it before it can populate thislist.

incidentally - there's no need to space your posts out like that - it's taking up a lot of space for not much content.

Offline filth

  • Members
  • *
  • Who's the bad man?
Re: i need a trigger condition please...
« Reply #8 on: 21 Jun 2007, 22:00:13 »
blimey. i've never been criticised for the way i post on this site. i thought i was just being clear by using the line spacing the way i did. i didn't realise the post police were so strict these days. anyway, as i said in my first post, i need the trigger to fire when four members of two squads are present inside the trigger area. i was hoping that the person who answered my question would be able to give me the answer to what actually sets off the trigger, as that was the original question.

Offline savedbygrace

  • Intel Depot
  • Administrator
  • *****
  • Be swift to hear...slow to speak...slow to wrath.
Re: i need a trigger condition please...
« Reply #9 on: 21 Jun 2007, 22:25:50 »
I think he did answer it Filth Merchant 101. I tried the code and it worked. You must have detected by west/east or whatever selected in order for the Trigger to activate. Once a unit of that side enters the area, the condition field takes over and checks if the units meet the condition. I'm not "exactly" clear on your request but change the number at the end to fit the amount you want to activate it. Example: If you want any one unit out of only those 16 to activate the trigger, just change the 4 to 1.
Sorry to Hijack your thread Filth but I am still a noob at code syntax and since it was mentioned here by Bedges.........  :whistle: Can anyone explain the difference between the Curly {}, curved() and square[] brackets and where it is required to use them. Or at the least, provide a link to a thread or tute on them? Pleeeeeease? :D
« Last Edit: 21 Jun 2007, 22:28:15 by savedbygrace »

Offline bedges

  • Administrator
  • *****
    • OFPEC The Editing Center
Re: i need a trigger condition please...
« Reply #10 on: 21 Jun 2007, 22:48:08 »
curved brackets define discreet parts of a statement.

for example 1 + 2 * 3 = 7, because the multiplier has precedence. (1 + 2) * 3 = 9, because the brackets keep the first bit discreet.

square brackets are used in conjunction with arrays, for example loon setpos [getpos loon select 0, getpos loon select 1+2]

curly brackets are interchangeable with "" quotes, so the above example could just as well be written

Code: [Select]
("_x in thislist" count units group_one) + ("_x in thislist" count units group_two) >= 4
thus indeed, the question is answered. and if anyone needs a test missionette to prove it, just ask.

Offline filth

  • Members
  • *
  • Who's the bad man?
Re: i need a trigger condition please...
« Reply #11 on: 21 Jun 2007, 23:16:12 »
i cant' get it to work. i've set the trigger condition to this: ({_x in thislist} count units alpha) + ({_x in thislist} count units bravo) >= 4 and set it to activate when west is present, but nothing happens. :( - a test missionette would be invaluable, thank you.

Offline bedges

  • Administrator
  • *****
    • OFPEC The Editing Center
Re: i need a trigger condition please...
« Reply #12 on: 21 Jun 2007, 23:31:44 »
your wish is my command. see attached.

Offline filth

  • Members
  • *
  • Who's the bad man?
Re: i need a trigger condition please...
« Reply #13 on: 21 Jun 2007, 23:45:13 »
thank you very much for this bedges. but i still have a problem. and i think i may have worked out the problem is. you see, i want the trigger to fire when 4 members of either group enter the trigger zone. the trigger with your condition only seems to fire if there are members of both groups present inside the trigger area. i want the trigger to fire even if all the members of bravo squad are dead (and are nowhere near the trigger area) and four members of alpha squad enter the trigger area. how can i do this? the reason your trigger didn't fire when i tried it is because my man wasn't grouped as bravo. i was waiting for four members of alpha group to fire the trigger, and they don't seem to, unless a member of bravo is present too. i hope that makes sense.

Offline bedges

  • Administrator
  • *****
    • OFPEC The Editing Center
Re: i need a trigger condition please...
« Reply #14 on: 21 Jun 2007, 23:59:03 »
the condition still holds.

run the test mission and stay where you are. wait for the conga line. the trigger will fire as soon as four of them enter the trigger, even if you're miles away.

EDIT - to explain a bit better, the condition can be thought of as saying this:

when (the total number of units from group A within the trigger area) added to (the total number of units from group B within the trigger area) is equal to or greater than 4, activate the trigger.

thus even if there are no units from group A within the trigger, when the total number of units from group B in the trigger area reaches 4, it'll activate. if there is one loon from group A in the trigger area, it'll fire as soon as three from group B walk in, and so on.
« Last Edit: 22 Jun 2007, 00:07:17 by bedges »