OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting Multiplayer => Topic started by: RedLion on 07 Sep 2002, 09:32:22
-
??? Hey Guys!
For the intention of controling more than one squad in a MP game, Is it possible for example, to have 5 squads or any # of squads, and jump from one squad leader to the next as if taking over the leader or becoming the leader yourself ?
Many thanks in advance for your help!
Regards,
RedLion
-
Hey,
it would be possible using the join command:
[PlayersToJoin] join GroupToJoin
So, the following script will do the trick:
;-----------------------------------------------------------
;Switch group leader
;By Backoff
_player = _this select 0
_param = _this select 1
_GroupArray = [group1,group2,group3,group4]
?(_param > count _GroupArray): hint "param out of range";Exit
[_player] join grpNull
[Units (_GroupArray select _param)] join group _player
Exit
;-----------------------------------------------------------
How to call this script:
[PlayerID, GroupArray#] exec "switch.sqs"
Where PlayerID is the player you want to be the leader
GroupArray# is the position in the _GroupArray of the group you PlayerID to lead.
You have to modify the value of _GroupArray with the group names you defined in your mission.
Hope this helps
-
Hi Backoff: :)
Thank you for your reply.
I am not quite sure what you mean by changing the GroupArray values, :-\ but I did try to follow the instructions you specified.
I activated the script by using radio alpha and the response was: "1 follow 1". No errors were reported but I was not able to jump from squad to squad as their commander. ???
I just stood there, in the middle of the field echoing my own words ;D
Sorry for the lack of experience, but I will continue to try.
Thanks Backoff :)
Best Regards,
RedLion
-
Looks like you need following parameters to exec this script:
[player,0] exec "switch.sqs"
:note - the GroupArray value, for which i wrote 0 here
can be 0,1,2,3, because there are 4 squads.
In this case, you would take controll over group1
(GroupArray select 0 = group1 from the array: GroupArray)
:edit - ah yes, and to be able to switch between all the four
squads, you need to setup 4 triggers (one for each group)
~S~ CD
-
oops, forget this one...
Thanks Chris Death for the precisions :)
Also you will need to give names to the groups you want to control and put these names in the _GroupArray variable