Home   Help Search Login Register  

Author Topic: Join Group/leave group addaction  (Read 2172 times)

0 Members and 2 Guests are viewing this topic.

Offline danturn

  • Members
  • *
Join Group/leave group addaction
« on: 15 May 2008, 02:36:46 »
Is there a command you can put in a unit's init field to create an add action that when selected they will join the group so you can order them about etc and then as you add them to your group a new add action appears to make them leave the group?

If there isn't a direct command does anyone no a script?

Thanks

Offline schuler

  • Contributing Member
  • **
Re: Join Group/leave group addaction
« Reply #1 on: 15 May 2008, 03:11:01 »
You should script it but could;
Use radio alpha name it join up
[ap2,ap3,ap4,ap5,ap6,ap7,ap8] join ap1   note join might be assignTeam in arma

Then radio bravo name it something else
Send them to a waypoint and deleteVehicle  them.or unassignTeam
If you wont need them again
Just a simple suggestion and easy way out of scripting  :dunno:
but your idea is best i would like to see a script for this myself too ;)

Semper Fi

Offline danturn

  • Members
  • *
Re: Join Group/leave group addaction
« Reply #2 on: 15 May 2008, 03:47:58 »
I understand that if i would probably need to use two scripts, one for the Join group and at the end of the script it would delete the addaction and create a new one for the leave group script.

Whilst on the subject of scripts, in OFP you were able to place the script in the mission file, but in ArmA i seem to be unable to find a mission file or nething related to the mission name, any ideas where the scripts go etc?

Just had a quick think, the init something like

Code: [Select]
this addaction ["join group","join group.sqs"]and
Code: [Select]
this addaction ["leave group","leave group.sqs"]
Then with the scripts

Code: [Select]
_person1 join player
_removeaddaction ["join group","join group.sqs"]
_addaction ["leave group","leave group.sqs"]

Code: [Select]
_person1 leave player
_removeaddaction ["leave group","leave group.sqs"]
_addaction ["join group","join group group.sqs"]

person1 represents the name of the person you would like to join
player represents player name (just so there is no confusion)

Am i anywhere near? This is just and "educated" guess
« Last Edit: 15 May 2008, 03:57:20 by danturn »

Offline schuler

  • Contributing Member
  • **
Re: Join Group/leave group addaction
« Reply #3 on: 15 May 2008, 04:23:23 »
i would put it all in one script, with the addAction _join then deleteAction _join, then the script would have addaction for _leave as the last command to be used.
i am not a scripter but something like this might be able to end up in the ed depot.
lets see what others have to say. meanwhile i will do some looking around too
BTW its a good idea too  ;)
Semper Fi

Offline danturn

  • Members
  • *
Re: Join Group/leave group addaction
« Reply #4 on: 16 May 2008, 03:12:47 »
Thanks very much. Just figured it makes sense to be able to choose people to join your group and then ask them to leave, thinking more along the lines of RPG, so you can have help in missions or do them alone.

EDIT:
Ok, iv started trying to create this script, and it's throwing up errors i dont understand.

my script looks like this
Code: [Select]
_[a] join player;
_a addaction ["Remove Grouping", "Remove.sqs"];
_a removeaction ["Join Group", "join.sqs"]

the error i get is

Code: [Select]
'_a |#|removeaction ["Join group", "join.sqs"]'
Error removeaction: Type any, expected object

I don't understand, anyone shed some light? thanks

The other problem is I don't actually no the phrase to use for removing a particular unit from a group. I'v looked through the comref but with no luck.
« Last Edit: 20 May 2008, 08:50:26 by h- »

Offline WinKIller0

  • Members
  • *
  • Me pandaren, you like me
Re: Join Group/leave group addaction
« Reply #5 on: 19 May 2008, 07:24:23 »
First of all if you're doing a RPG mission, better try with this:
Code: [Select]
;List of Don's missions
myaction1 = mies addAction ["test1", "join.sqs"]
;List of Don's missions end

;List of vendor begin
myaction3 = ase2 addaction ["test2","test.sqs"]
;List of vendors end
This makes your scripting easier and more understandable, as you will see below. That scrip above is meant to start straight after the mission start (Prefered to put the exec to init field of the player)

Code: [Select]
'_a |#|removeaction ["Join group", "join.sqs"]'
that's kinda stupid thing to do it, like if you'd do it as a myaction it would something like this:
Code: [Select]
myaction1 = unitiliketojoin [Joingroup","join.sqs"]

and for the join.sqs:

unitiliketojoin removeaction myaction1
Nice and easy way to handle thse, there was two thing wrong in your script if you prefer that way still: _a points to a global user, there should be instead the name of the unit (normally player, but it has to be named like it) and to remove action, only thing you need to do is to write the name of the  user who uses the script "removeaction" "actionname"

Cheer, hopefully i helped
« Last Edit: 19 May 2008, 07:26:59 by WinKIller0 »
You haven't seen the end of The Devil yet...

Offline danturn

  • Members
  • *
Re: Join Group/leave group addaction
« Reply #6 on: 19 May 2008, 17:27:41 »
Yes!

Thanks a lot, It's all sorted now  :D.

Except for one thing, what do i use to remove the person from the group? Only thing i can find it the comref is "deletegroup" but this deletes everyone from the group i think. How do i just remove the one person from the group?
« Last Edit: 19 May 2008, 17:29:49 by danturn »

Offline WinKIller0

  • Members
  • *
  • Me pandaren, you like me
Re: Join Group/leave group addaction
« Reply #7 on: 19 May 2008, 17:32:51 »
Never figured that out neither so I just move it other way around, I made a man to the map somwewhere,and when unit you want to remove the group make him join this man, not the most estetic solution but works

EDIT: When the "uni" joins the nwe owner it will automaticly move close to the owner
« Last Edit: 19 May 2008, 17:36:46 by WinKIller0 »
You haven't seen the end of The Devil yet...

Offline Gcfungus

  • Members
  • *
Re: Join Group/leave group addaction
« Reply #8 on: 19 May 2008, 23:41:02 »
I dont have ArmA, but this works in OFP.
Something similar to
Code: [Select]
[playername] join grpnull
The object of war is not to die for your country, but to make the other bastard die for his.
~George Patton

Offline danturn

  • Members
  • *
Re: Join Group/leave group addaction
« Reply #9 on: 20 May 2008, 03:01:02 »
Excellent, joingroup nul works a treat, means the unit stays where you left him. Thanks everyone for your help!

Offline Rommel92

  • Members
  • *
Re: Join Group/leave group addaction
« Reply #10 on: 22 May 2008, 22:35:27 »
« Last Edit: 26 May 2008, 14:01:00 by Rommel92 »