Home   Help Search Login Register  

Author Topic: group trigger problem  (Read 867 times)

0 Members and 1 Guest are viewing this topic.

Offline .pablo.

  • Former Staff
  • ****
  • When in doubt, empty the magazine.
group trigger problem
« on: 23 Jun 2003, 00:01:37 »
a couple groups need to be in a certain area for a trigger to go off
the groups are set to playable

i want it so that if one or more playable groups are not being used (ie they are not being used by players or ai and thus are not created at the start of the mission), the trigger will still go off when all the used groups get to the trigger area.  is there a way i can check if they exist or something?

new question:
the top of the briefing has this weird text, how do i change it?
(it says "__cur_mp")
« Last Edit: 23 Jun 2003, 07:34:46 by pablom123 »

peter

  • Guest
Re:group trigger problem
« Reply #1 on: 23 Jun 2003, 17:15:04 »
@2: in the editor (where you can change time of day, weather situation, ...) is a "name"-field ...

@1: have a look at this one ... :
[Up to 5 soldiers (each = one group) move towards the jeep, if all groups (exist & alive) are in the trigger-area around the jeep global var "cond" ist set "true" and another trigger (named "End") is activated.]
« Last Edit: 23 Jun 2003, 18:01:14 by peter »

Offline .pablo.

  • Former Staff
  • ****
  • When in doubt, empty the magazine.
Re:group trigger problem
« Reply #2 on: 24 Jun 2003, 07:09:23 »
how does victory.sqs work?
and what is _i, _j, _c, "scalar", format ["%1",count units (_grpA select _j)], etc.

thx for the script tho, works perfect

edit:
ok what i have so far is this:

cond = false   ***  says that the condition has not been fulfilled yet
_grpA = _this   ***  names the trigger _grpA

#Start
~1
_trig = +(list trig1)   ***  says that _trig is something, not sure what the + means
_i = 0   ***  defines a variable, not sure what the variable does
_j = 0   ***  defines a variable, not sure what the variable does
_c = 0   ***  defines a variable, not sure what the variable does


the rest is is a jumble without knowing what the first part is

#Cond
? (format ["%1",count units (_grpA select _j)] == "scalar") : goto "Loop"
? !(alive (leader (_grpA select _j))): goto "Loop"
? ((_trig select _i) in (units (_grpA select _j))) : goto "Loop"
_i = _i + 1
? (_i == (count _trig)): goto "Start"
goto "Cond"

#Loop
_c = _c + 1
? (_c == (count _grpA)): goto "End"
_j = _j + 1
? (_j == (count _grpA)): goto "Start"
_i = 0
goto "Cond"

#End
cond = true
~5
hint format ["Objective Done"]

Exit
« Last Edit: 24 Jun 2003, 07:18:12 by pablom123 »

Offline .pablo.

  • Former Staff
  • ****
  • When in doubt, empty the magazine.
Re:group trigger problem
« Reply #3 on: 24 Jun 2003, 08:15:54 »
ok i tried it and it doesnt work, i think i know why.

for my mission you start off with a bunch of groups in an area, and for the mission to complete every group needs to be in that area (with another requirement which isnt important).  so what i have now is one trigger for each group which continuously checks for whether the group is home or not; if group1 is not home, group1home = false, if it is group1home = true, etc.

when group1home == true and group2home and etc. then westhome = true, if one of the groups is not home then westhome = false.

the final trigger checks to see if westhome == true and requirement2 == true.  the only problem is that every group is set to playable, so that if a group is not set to human or ai (doesnt exist) it is permanently set to grouphome = false.

the thing with victory.sqs is that it is only for the groups being in the area once, and mine needs to check continuously.  what do i do?

peter

  • Guest
Re:group trigger problem
« Reply #4 on: 24 Jun 2003, 20:11:19 »
_grpA is an array with the groups you want to be in the trigger-area, each group needs a name:

[grp1,grp2,grp3] exec victory.sqs -> _grpA = [grp1,grp2,grp3]

_i,_j are used to move through the arrays -> (_grpA select _i)
_c counts the groups who pass the #Cond - thing ...

_trig is the copy of the array with all units in the trigger-area -> +(list trig1)
the + does the copy and trig1 is the name of the trigger

how does it work ?
1. _grpA gets the groups you want to be in the area
2. #Start: we do a copy of the units actually in the trigger-area (_trig) and set all other vars to 0
3. #Cond: answers following questions: does group exist ? / is group alive ? / any groupmember in trigger-area ?
4. #Loop: if the group doesnt exist: _c +1 / if the group is not alive: _c +1 / if a groupmember is in trigger-area: _c +1 -> if _c == number of groups needed in trigger-area => goto "End"


(format ["%1",count units (_grpA select _j)] == "scalar")
looks if the group exists: counts units in group, if doesnt exist expression "scalar" is returned, the format command is needed to make it a string, so that you can compare it ...

Offline .pablo.

  • Former Staff
  • ****
  • When in doubt, empty the magazine.
Re:group trigger problem
« Reply #5 on: 24 Jun 2003, 21:09:39 »
"if a groupmember is in trigger-area: _c +1"

so does that mean that if i had a group of 3 people i would only need to get one person of that group in the trigger area?

peter

  • Guest
Re:group trigger problem
« Reply #6 on: 24 Jun 2003, 21:28:02 »
right, but i think groups usually stay together ...

Offline .pablo.

  • Former Staff
  • ****
  • When in doubt, empty the magazine.
Re:group trigger problem
« Reply #7 on: 25 Jun 2003, 02:38:32 »
in my mission there is the possibility that someone will get left behind, as to get from your base to the mission you use a helicopter.  i wanted it so that no one could be left behind.