Home   Help Search Login Register  

Author Topic: Setting Trigger When Johnny Comes Home  (Read 2105 times)

0 Members and 1 Guest are viewing this topic.

Offline sharkyjoe

  • Members
  • *
  • Have you taken a BMP out at 500 meters??
Setting Trigger When Johnny Comes Home
« on: 19 Feb 2003, 17:47:33 »
How do you set a trigger to end game when a Hostage named Johnny makes it back to home base. SITREP- (MP-game) Hostage gets rescued by any Multi-player black-ops group. He joins one of the groups and they take him back to base. When Johnny walks  into the trigger area the mission ends.    I can make one, when he dies, NOT(alive johnny) mission ends "you lose" but not the other way.  Any Ideas??? ???
Remember the 7 Ps??--- Proper Previous Planning Prevents Pathetically Poor Performance

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:Setting Trigger When Johnny Comes Home
« Reply #1 on: 19 Feb 2003, 18:33:10 »
Create a trigger over the base.

Go into Groups mode (F2) and drag anddrop a blue line from the trigger to Johnny.    Now open up the trigger and you will find new options in the activation box.

 .... actually, it occurs to me that that won't work, since Johnny won't be group leader.

OK, try this.   Create a trigger over the base, activation West (or whatever side Johnny is on) present.    Now, in the conditon field, write

Johnny in thislist

The syntax maybe be wrong so check it.  Make thte trigger type End#1 and whatever else you like.     Now, when Johnny is in the trigger area, the mission will end.  Hope that makes sense.
Plenty of reviewed ArmA missions for you to play

Offline sharkyjoe

  • Members
  • *
  • Have you taken a BMP out at 500 meters??
Re:Setting Trigger When Johnny Comes Home
« Reply #2 on: 19 Feb 2003, 22:29:24 »
Hey that worked great. Thanks :D
Now I have another question. I did post this on the Multi-player Editing. How to join Johnny to Multi-player group, doesn't matter, witch-ever group gets there first. I'd rather not use waypts because they Blackops group is in the general area and they need to find him. Solutions?? :-\
Remember the 7 Ps??--- Proper Previous Planning Prevents Pathetically Poor Performance

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:Setting Trigger When Johnny Comes Home
« Reply #3 on: 20 Feb 2003, 00:51:42 »
I don't know how to do this  ??? because I don't know enough about arrays, but I'm pretty confident that it can be done.   It's not particularly a multiplayer issue.    The command to make the hostage join a group is, you've guessed it, join[/i].

NearestObject might come in handy too.




Ah, I've thought of a way.    :P  Create a whole bunch of triggers, one for each Rescue Group.     Give them a diameter of say 10m or whatever you like and place them over the hostage.      In Groups mode link each Group to one of these triggers, and change the activation box to any group member present.    Then in each trigger put:

condition:   this and (not joined)
on activation:    Johnny join group1; joined=true

In your init.sqs write

joined=false

The variable "joined" is required so that once Johnny has joined one group the other triggers are all effectively switched off.    

Check the syntax of the join command, I can never remember the precise details.    Obviously you put the name of the group who are linked to that particular trigger.

It's not pretty, but in principle it should work.    As soon as a loon from one of the rescue groups comes within a trigger area, Johnny will join that loon's group.   Make sure the groups all have space to take a new recruit i.e. no more than 11 members.

Plenty of reviewed ArmA missions for you to play

Offline sharkyjoe

  • Members
  • *
  • Have you taken a BMP out at 500 meters??
Re:Setting Trigger When Johnny Comes Home
« Reply #4 on: 20 Feb 2003, 03:38:54 »
No Go  Error message-   '/#/': Error Invalid Number In Expression  -is what I received when I previewed it in my test map. I double checked everything-even the init.sqs   :o
Remember the 7 Ps??--- Proper Previous Planning Prevents Pathetically Poor Performance

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:Setting Trigger When Johnny Comes Home
« Reply #5 on: 20 Feb 2003, 10:14:04 »
Probably something wrong with the syntax .... check it out in the command ref guides int he Ed Depot - its worth looking at both the official and unofficial ones (in tutorials - references).      

As a test measure remove all the triggers and groups except one, see if you can make it work like that.   Then add the rest back in.
Plenty of reviewed ArmA missions for you to play

Offline Chris Death

  • Former Staff
  • ****
  • Finally Death's gonna get ya
    • OFPEC
Re:Setting Trigger When Johnny Comes Home
« Reply #6 on: 20 Feb 2003, 15:41:58 »
Well, you can do it this way:

Some pre-definitions before i explain the method;

Hostage name: hosta

3 groups: w1grp - w2grp - w3grp

init.sqs: held = true

TriggerA

axis: 0/0

condition:
held AND "hosta distance _x < 10" count (units w1grp) > 1

onActivation: [hosta] join leader w1grp; held = false

TriggerB

axis: 0/0

condition:
held AND "hosta distance _x < 10" count (units w2grp) > 1

onActivation: [hosta] join leader w2grp; held = false

TriggerC

axis: 0/0

condition:
held AND "hosta distance _x < 10" count (units w3grp) > 1

onActivation: [hosta] join leader w3grp; held = false

--------------------------------------------------------------------------

This should work now  ;)

~S~ CD
Dont argue with idiots....they will bring you down to their level and beat you there with experience.

How to use Waypoint type Scripted

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:Setting Trigger When Johnny Comes Home
« Reply #7 on: 20 Feb 2003, 15:52:20 »
ah yes, I forgot the [ ]
Plenty of reviewed ArmA missions for you to play

Offline sharkyjoe

  • Members
  • *
  • Have you taken a BMP out at 500 meters??
Re:Setting Trigger When Johnny Comes Home
« Reply #8 on: 20 Feb 2003, 20:02:18 »
I am a idiot :help: I ran Chris's trigger No Go either.  Error as follows- hosta /#/ distance_x<10':Error unkown operator distance_x. What in the world of OFP am I doing wrong. Macguba I did download and go through OFF. and NON-OFF. Refer. Gud.  I also put [] around Johnny it didn't work either. I set the name for hosta/Johnny in the name field, just above the skill level, of a unit as well as in the commander of the group. Could naming the groups be wrong?? Do I need to use the initial. field in the group of Blackops?? Just  grasping at straws right now.
Remember the 7 Ps??--- Proper Previous Planning Prevents Pathetically Poor Performance

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:Setting Trigger When Johnny Comes Home
« Reply #9 on: 20 Feb 2003, 22:42:16 »
Fundamentally, what both Chris Death and I have proposed works ... the trick is that (obviously) you have to have the syntax perfect and everything linked together in just the right way.   That's why I mentioned teh command refs, if you (I mean anybody who has posted a question, not you personally) does actually understand the answer then they are never going to get it to work.

The secret with all of these things is to break the problem down into little bits until you find the one that is [are] going wrong.

OK try this.    Create a new clean mission, just so we can play.   Create a West loon and name him Johnny.      Now create a West group and in the init field of the leader write this

rescue = group this

Now make a trigger 10x10 round Johnny.    Start the Group 100m away and give them a move waypoint within the trigger area.      The trigger should be like this

activation box:  West present
condition:  this
on activation:    [Johnny] join rescue

Now play the mission as a member of the group and see what happens.      If it works, start adding back the stuff that I discussed before.   If it doesn't work, see if you can figure out what is going wrong.




I suspect - though I don't know - that the problem with Chris Death's script may be that there is a missing "foreach".    (apologies Chris Death if I'm wrong) and it should be

count units ("Johnny distance _x < 10" foreach units group w1grp) >=1

I'm pretty confident that's wrong but hey, you never know.    You might be able to play with the syntax and make it work.   The point is that the right combination of the commands count, distance, foreach and > will work.


Plenty of reviewed ArmA missions for you to play

Offline Chris Death

  • Former Staff
  • ****
  • Finally Death's gonna get ya
    • OFPEC
Re:Setting Trigger When Johnny Comes Home
« Reply #10 on: 21 Feb 2003, 00:47:27 »
Quote
hosta /#/ distance_x<10':Error unkown operator distance_x.

Well, upon the error message i suppose, you did not put
a blank in between DISTANCE and _X.

Your's looks like: distance_x

while it should look like: distance _x

The correct syntax of counting a groups approach to a single
unit is:

"hosta distance _x < 10" count (units w1grp) > 1

or:
"_x distance hosta < 10" count (units w1grp) > 1

:note - expecting, you did name the group by any of it's units
init fields: w1grp = group this
and you did name your hostage unit by it's name field: hosta

The foreach command you will need if you want to execute
commands foreach unit of an array/group.

_x as a condition you need to do by the count command

~S~ CD
Dont argue with idiots....they will bring you down to their level and beat you there with experience.

How to use Waypoint type Scripted

Baphomet

  • Guest
Re:Setting Trigger When Johnny Comes Home
« Reply #11 on: 21 Feb 2003, 01:22:25 »
This is exactly the dilemma I'm faced with. Only the solutions presented here seem... rather overly complicated. Isn't there away in the condition string to allow it only to run the trigger if a specific unit is present?

EDIT

Hm. It looked like the advice for placing a trigger with "nameofunit in thislist" worked. It didn't the first time and I wonder why. Oh well. Thanks again guys. As usual you have saved my bacon.
« Last Edit: 21 Feb 2003, 01:54:13 by Baphomet »

Offline Sui

  • Former Staff
  • ****
    • OFPEC
Re:Setting Trigger When Johnny Comes Home
« Reply #12 on: 21 Feb 2003, 02:10:32 »
Hey everybody...

I seem to remember a previous thread a bit like this one...

Have a look here to see how Jakerod got it done ;)

Offline sharkyjoe

  • Members
  • *
  • Have you taken a BMP out at 500 meters??
Re:Setting Trigger When Johnny Comes Home
« Reply #13 on: 21 Feb 2003, 20:26:23 »
SetRep: Well Macguba's or Chris's did not work. I wish I could have made them work. I'll try working on them but I'm not versed in programing language. However I did follow Sui string and advice and it worked in preview mode with different resuce units. I will test it out on pbo mode later. Thankyou All for your Kind help :wave: ;D
Remember the 7 Ps??--- Proper Previous Planning Prevents Pathetically Poor Performance