OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting Multiplayer => Topic started by: Mr.BoDean on 07 Jul 2004, 22:34:43
-
Is there a way to ensure that the group leader is actually filled by a human player? My mission is based around that premise. Although an AI leader could work in that position, some events would not occur and the mission is best run with that unit being a player.
Aside from putting a note inthe description part of the setup screen, would this be done in description.ext or Init.sqs and how? ??? Thanks. :)
-
I believe you can do so by using this:
? ( !(local <unitname>) OR (player == <unitname>) ) : <everything is ok>
This needs to run server side only. Do not use in the Init.sqs
This will check if unit is not local to a server (meaning controlled by a client machine and therefore a client player) OR if it IS the player on the server
-
Thanks for the reply, Crash, but not sure if I follow correctly. :-\
I have 8 playable units.
P1 is Alpha Black Leader , who needs to be a human player.
So, would I run a script from Init.sqs that would use the check line you stated ? Would that also ensure the unit was not AI and not Disabled all together? ???
Init.sqs:
HumanLeader = false
[] exec "Leader.sqs"
Leader.sqs:
? !(local server): exit
#LeaderCheck
? ( !(local P1) OR (player == P1 ) : goto "Start"
~1
goto "LeaderCheck"
#Start
(seems like I would need something here to enable the "Launch" button in setup with:)
HumanLeader = true; publicvariable "HumanLeader"
-
INIT.sqs
tx_HumanLeader = false
?(player == P1 ) :tx_HumanLeader = true; Publicvariable "tx_HumanLeader"
;;; have a wait period that gives enough time for the PV to be received over poor networks
~2
?!(tx_HumanLeader): goto "END"
#END
hint "Error: Lead unit must be a player, please reassign"
exit
or you could use the query
?(tx_HumanLeader): do whatever
If unit P1 is controlled by a player, every machine's version of "tx_HumanLeader" would change from false to true
hope that helps
-
Thanks again, terox. Is there something to this naming things with tx_ ...... in the prefix?
At any rate , I assume this method would only show up once the Admin clicks OK to launch and the players would then see this ERROR (hint) on their screen? Which means I could then keep the intro from starting, or vehicles from being fuelled or something, huh? :o
-
Ok Terox, so I managed to get this to work after figuring out where to put it. But it works great! ;D Using this version, the titles come up, but the Intro cutscene gets interrupted and the error HINT is displayed. I also left 2 groups of players with no fuel, hehe. ;) :-*
So that is a workable solution, unless there is some way to keep the game from launching at all from setup if there is no human player for P1 . ???
-
i use a tag tx_ for all my global variables, this ensures that no global variable that i create conflicts with any addon or mod variable. Its a good habit to get into
No you wont be able to stop the server from loading the mission.
What you can do is set your endmission trigger off just after the hint line to shut the mission down completely
-
A.) i use a tag tx_ for all my global variables, this ensures that no global variable that i create conflicts with any addon or mod variable. Its a good habit to get into
B.) What you can do is set your endmission trigger off just after the hint line to shut the mission down completely
A.) Ah, ok ...never thought of those pesky variables buried in .pbo's of addons. 8)
B.) Ohh, what a delicious idea! ;D ;)
Thanks again. :)
-
oh 1 more thing.
Mod makers and addon makers have a "Tag library" on OFPEC, they register their tag there, so that other mod teams dont use the same one.
These tags are 3 letters long, hence why i use only 2 as there aint a missionmakers tag library