Jump to content
Sign in to follow this  
snkman

Leave group?

Recommended Posts

Hi Guy's

well i have a Chopper and when i go into the Chopper i use:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">Condition: alive UH60 and p1 in UH60

Activation: [UH60] join group p1

Now i can tell the pilot where he should fly to.

After i eject i like to have the pilot out of my group.

How can i do this?

Share this post


Link to post
Share on other sites

Just a thought - could you have him join another group. Maybe have a co-pilot in another group. Or some other group somewhere.

huh.gif?

Edit: Another thought:

Maybe you could use Alpha radio command to tell him to join the other group. Beta to join your group.

Share this post


Link to post
Share on other sites

Hmm... Yes that's what i was thinking about too.

But if someone know's a better way plz let me know. smile_o.gif

Share this post


Link to post
Share on other sites

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">[HeliPilot] join GrpNull in some trigger that verifies that 1) you have jumped in the chopper (set a variable in your first trigger for example) and 2) you jumped out of the chopper.

So, your 1st trigger would be

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">Condition: alive UH60 and p1 in UH60 and not playerInchopper

Activation: [UH60] join group p1; playerInChopper=true

The 2nd trigger would be

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">Condition : playerInChopper and not p1 in UH60

Activation : [UH60] join GrpNull;playerInChopper=false

For repeatability, set both triggers to "repeatedly"

Share this post


Link to post
Share on other sites

@whisper

Thank you for the answere but:

I get an error with the 2. Trigger.

Can you plz explain to me what does playerInChopper and GrpNull do?

@rrores

Welcome on Board rrores smile_o.gif what do you mean by that?

Share this post


Link to post
Share on other sites

Thanks smile_o.gif

other mode? (no inglish banghead.gif)

in INITIALIZATION of UH60:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">this addEventHandler ["getin", {[driver (_this select 0)] JOIN group p1; ACC = (_this select 0) addAction ["Land", "land.sqs"]}]; this addEventHandler ["getout", {if ((_this select 2) == p1) then {[driver (_this select 0)] JOIN grpNULL; (_this select 0) removeAction ACC}}]

Land.sqs:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

(_this select 0) land "land";

greetings

Share this post


Link to post
Share on other sites
@whisper

Thank you for the answere but:

I get an error with the 2. Trigger.

Can you plz explain to me what does playerInChopper and GrpNull do?

@rrores

Welcome on Board rrores smile_o.gif what do you mean by that?

Well, playerInChopper is a variable I set to check that the player has indeed jumped in the chopper. I use it because knowing that you are not in the chopper is not enough to know that you jumped out of it, because you also need to know that you were before in the chopper (simple logical thinking here wink_o.gif )

So, 1st trigger 1st verifies that you were not in chopper before (playerInChopper not = true) and that you are now in (player in UH60), meaning you just jumped in. In which case it makes chopper join your group, and set the playerInChopper variable to true.

2nd triggers verifies that you were in chopper (playerInChopper = true, ie the 1st trigger has been activated) and that you are not anymore now (player not in UH60), ie you just jumped out. In which case it makes chopper join a special group referencing "nothing", called grpNull ( "group Null", it's a predefined variable in the engine). It's the usual way to make a unit leave a group, make it join grpNull. The trigger also set playerInChopper to false, because you are not in chopper anymore. this way, 1st trigger can be activated again in case it is set to "repeatedly".

What is the error you get?

Share this post


Link to post
Share on other sites

Another way you could do this that may work would be to use the unAssignTeam command and place it in activation line of the trigger or waypoint where your team ejects.

This essentially kicks the unit from its present group.

Therefore put something like:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">unassignTeam driver choppername where chopper name is strangely enough the name you've given your UH60.

Share this post


Link to post
Share on other sites

@norrin

Well i have a Dynamic Mission and i can call the Heli at any time so there is no fixed Waypoint where i eject.

The heli is just for Support, if i get in big trouble so i can call him and flee with the UH60 to a better position.

@whisper

Thank you very much for the greate explanation slowly i start understanding how your code's work. smile_o.gif

About the Error:

At the beginning of the mission i get this: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">`playerinChopper and |#not p1 in UH60`

Error not: Typ Object, erwartet Bool

B.t.w.: erwartet means expected.

Share this post


Link to post
Share on other sites

I'm not 100% sure about what you want to do here but I do like Scillion's idea to link the commands to radio codes as this is probably how it would work in a real life situation.

If you are happy to do this then to get the chopper to leave your group you'd add to radio code "Alpha" something like what I've written above or: [choppername] join grpNull.  

You could then link radio code "Beta" to: [choppername] join p1.

One good thing about doing it this way is that you can then get the chopper to join and leave your group (p1) as often as you like.

Share this post


Link to post
Share on other sites

Okay norrin agreed! smile_o.gif This way is good to. wink_o.gif

man i did not know something about this GrpNull command....

Okay but i like to tell you what's it all about:

My Mission starts from the Airport ( I use Revive Respawn ) and at the Airport are placed some empty Choppers u can use to fly with them to the Combat Zone and one chopper ( UH60 ) i can controle with the Radio ( UH60 doMove getPos p1 and UH60 land "land" and UH60 doMove getPos Base.

The mission is to Recapture the North of Sahrani.

Also the Team fly with the Empty Chopper to the Combat Zone okay after some time you get wounded guy's or you are that big in trouble, that the only way out is by Air Rescue.

Now i call the UH60 with Alpha ( doMove getPos p1 ) than ( UH60 land "land" ) okay now the part i ask here: smile_o.gif

I enter the UH60 and the UH60 or the Pilot join's my team now i can tell the Pilot where he should fly to.

Okay we fly to the Position where i was telling and say: UH60 land "land" the Chopper goes down the Team leaves the UH60 and i order the UH60 ( UH60 doMove getPos Base ) now the UH60 is flying back to the Base but the Pilot ( UH60 ) is still in my team... crazy_o.gif

I really hate it to have this Chopper all the time in there although i don't need the UH60 right now.

So i like the way with Trigger's a bit more cuz no one other can do something if i play the mission with some other Guy's and the first thing what they do is to try the things in the Radio. smile_o.gif

Okay but like i told "Agreed" the radio thing is good too! wink_o.gif

Like always Thank you very much Guy's! thumbs-up.gif

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×