Home   Help Search Login Register  

Author Topic: Specific MP player slot requirements  (Read 1326 times)

0 Members and 4 Guests are viewing this topic.

Rocko Bonaparte

  • Guest
Specific MP player slot requirements
« on: 09 Mar 2005, 08:05:14 »
I have a mission here that requires at least two people.  One person must lead a squad, and the other must be a helicopter pilot.  There are 10 other slots available for more people.  However, the mission simply cannot work without those two slots filled.  The scripting involved in making those positions autonomous is too daunting for now -- specifically due to all the randomized unit positions.  

If I put that mission up some places, would those slot requirements be frowned upon?  What should I do to make it more clear?  Best I can think of right now is a warning on mission startup when the essential slots aren't filled.  I don't know if I should change my mission's description field to be a notice as well.

Offline Roni

  • Members
  • *
  • Play the Game !
Re:Specific MP player slot requirements
« Reply #1 on: 09 Mar 2005, 11:42:34 »
Hi RB

Okay, this is messy and it might not work but here goes . . .

Set up 12 playable units, all single unit groups.  Make all units SoldierWB (if West, otherwise make all units SoldierEB  :P ).  Put a Gamelogic on the map called server.  Create a script that runs from each playable units Init field as follows.

[this] exec "setPlayers.sqs"

; setPlayers.sqs
; if unit is not a player unit then delete it, exit script
_player = this select 0
? _player != player : deleteVehicle _player, exit

; pause to make sure all players in game then record player in an array
; shout it to the network so all players are added to count
~ random 1
playerCount = playerCount + [_player]
publicVariable playerCount

; stop all versions of script running except host version
? !(local server) : exit

; if number of players is less than 2 then end mission
? count playerCount < 2 : hint "Not enough players, at least two required !", ~5, forceEnd

; make first player the helicopter pilot
 (playerCount select 0) moveInDriver helo1

; make the second player the squad leader
; make all remaining players members of his group
_ x = count playerCount
#enlistPlayers
_x = _x - 1
 [playerCount select _x] join (playerCount select 1)
? _x >1 : goto "enlistPlayers"

; fill squad leader's group with AI units up to 12 members
_y = count units (playerCount select 1)
# enlistAI
_y = _y + 1
 "SoldierWB" createUnit [getPos (playerCount select 1), group (playerCount select 1)]
? _y < 12 : goto "enlistAI"

exit



You should be able to just cut and paste the above code straight in to a script (fingers crossed).  :thumbsup:

What it SHOULD do is delete all non-player playable units, assign the first player as the helo pilot, the second as the squad leader and the rest as members of the squad leader's group.   Here's hoping !  :P

Note that one problem that I can see with the script is that all player units must start as the same type, no matter who is boss.  Please feel free to thrash the script to see if you can get around this.

Hope that it works for you !



Roni

Rocko Bonaparte

  • Guest
Re:Specific MP player slot requirements
« Reply #2 on: 10 Mar 2005, 08:01:31 »
Well I could script around, just I'm wondering if that would be expected of me.  I'd just have to test if the squad leader slot and the helicopter slot are filled, and have a special ending trigger immediately if not.  That's the closest I can think of to enforcing the rules.  Alternately, I would have a comment in the briefing at least.  Unfortunately, I've been seeing even more dedicated people ignoring the briefing.  It's kind of important to the mission -- given the pilot has to hook up with the squad, and the squad is randomly positioned each time.

Perhaps I should put it up for beta testing now and just see what people around here think of the whole mess.

Offline Terox

  • Former Staff
  • ****
  • Follow the Sappers!
    • zeus-community.net
Re:Specific MP player slot requirements
« Reply #3 on: 11 Mar 2005, 17:36:19 »
possible way around this

name the 2 player slots that must be taken

eg
W1
W2


then place the following code in the Init.sqs





INIT.sqs
Quote
?(Player == W1): W1_Alive = true; Publicvariable "W1_Alive"
?(Player == W2): W2_Alive = true; Publicvariable "W2_Alive"

then at the end of the init.sqs run the following code

~1
?(W2_Alive) && (W1_Alive): exit
#ENDGAME
titlecut ["Player slot W1 & W2 need to be selected","black out",1]
~5
?! (W1_Alive):titletext[format["W1 slot has not been taken"],"PLAIN"]
?! (W2_Alive):~5
?! (W2_Alive):titletext[format["W2 slot has not been taken"],"PLAIN"]
titlecut ["","black in",1]
;;;; add whatever boolean you need to activate your endgame trigger etc

i would personally change the titletext message that states W1 or 2 to their group name or soldier slot

eg Alpha Black 1 or Pilot etc



as for gettting around the fact that players dont read the briefings, i have now opted for an intro system that simply fades to black and then pastes the important info on screen using titletext, instead of the more fancy camera work, its far more practical, you could even incorporate both, but i have found a plain black screen with some white text is more productive
Zeus ARMA2 server IP = 77.74.193.124 :2302
Teamspeak IP = 77.74.193.123

Rocko Bonaparte

  • Guest
Re:Specific MP player slot requirements
« Reply #4 on: 15 Mar 2005, 08:21:50 »
Terox: I was trying something similar to that:

Code: [Select]
StartTime = time
human_SquadLead = 0
human_Helipilot = 0

?player == Rescue1:human_SquadLead = 1, publicVariable "human_SquadLead"
?player == HeliPilot:human_Helipilot = 1, publicVariable "human_Helipilot"


And then a trigger with the conditions:
Code: [Select]
         expCond="(human_SquadLead == 0 || human_Helipilot == 0) && (time - StartTime >= 5)";
But the globals wouldn't be shared.  I tried with and without initializing first, and it didn't seem to matter on either machine I was using during the test.

I didn't realize you could script the endgame like that, or otherwise I wouldn't have bothered with the trigger.  I might try that tomorrow.