OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting Multiplayer => Topic started by: RedLion on 07 Sep 2002, 09:32:22

Title: Jumping from squad leader to squad leader
Post 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
Title: Re:Jumping from squad leader to squad leader
Post by: Backoff on 09 Sep 2002, 21:11:23
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
Title: Re:Jumping from squad leader to squad leader
Post by: RedLion on 15 Sep 2002, 00:22:00
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
Title: Re:Jumping from squad leader to squad leader
Post by: Chris Death on 19 Sep 2002, 02:30:45
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
Title: Re:Jumping from squad leader to squad leader
Post by: Backoff on 20 Sep 2002, 17:31:42
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