OFPEC Forum
Editors Depot - Mission Editing and Scripting => ArmA - Editing/Scripting General => Topic started by: danturn 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
-
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 ;)
-
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
this addaction ["join group","join group.sqs"]and
this addaction ["leave group","leave group.sqs"]
Then with the scripts
_person1 join player
_removeaddaction ["join group","join group.sqs"]
_addaction ["leave group","leave group.sqs"]
_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
-
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 ;)
-
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
_[a] join player;
_a addaction ["Remove Grouping", "Remove.sqs"];
_a removeaction ["Join Group", "join.sqs"]
the error i get is
'_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.
-
First of all if you're doing a RPG mission, better try with this:
;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)
'_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:
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
-
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?
-
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
-
I dont have ArmA, but this works in OFP.
Something similar to
[playername] join grpnull
-
Excellent, joingroup nul works a treat, means the unit stays where you left him. Thanks everyone for your help!
-
Check this Thread: http://www.ofpec.com/forum/index.php?topic=31520.new#new
:good: