OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting Multiplayer => Topic started by: Larsen on 09 May 2004, 00:35:36
-
Well, can someone tell what am i doing wrong ?
I created a script that allows to select weapons for players at start of the mission (based on a dialogue screen created with Dialog Maker by Razorwings).
When i run it on windows server it works ok, but at dedicated server with few human players on it - it gets duplicated and mixed up).
Am i using wrong parameters when running scripts? Are my variables wrong construced?
I don't oknow how to do it correctly. Please help.
To activate the script i'm using the Activation field of player units (every playable unit):
[this, 1] exec "menu.sqs"
the second parameter gets changed according to player specialization (see 'menu.sqs" for details).
The variable 'start_up' visible at start of my script is used with a trigger that sets the value of this variable to "1" once the mission is started - it makes the dialogues screen to appear after the mission start (without it dialogue screen appears at mission briefing which is bad).
## One other thing - i got a trigger - i want it activated when west human player goes into the trigger area and he's not in the air:
trigger activation field: (player in thislist) AND (getpos player select 2 < 1)
Is this correct? I want the trigger activated for all players (it changes the objective status and etc.).
## The other - other thing.
Will such a trigger end mission for every player (will it be "activated" for everyplayer?
ActivatedBy: Anybody
Type: End #1
Activation: (heli1 in thislist) AND (getpos heli1 select 2 <= 3) (maybe there should be also 'this' in the activation field?)
where heli1 is a name of players helicopter
Please help me with this stuff
-
to correctly get your weaponj dialog system working, use the following line at the end of the briefing when you want the dialog to pop up
?(local player):[] exec "menu.sqs"
there is no need to place it in the init field of every unit, as the only unit that requires it to be run on the client, is the players unit. The above line will do that nicely for you
-
But i want to use different run parameters for the script:
[this, 1] exec "menu.sqs"
1-9 - player specialization (it differs for player, thats why i'm using activation field of player units).
Can i put this in script to make sure it's ok?
?! (local player): exit
I'm not if it's gonna work (in fact i think i've tryed this line and it still doesn't work correctly).
Maybe there's different way to give the specialisations parameter (names of players?).
Please help.
-
well - it's then not by playernames but unitnames in combo
with the player:
?(unit1 == player): [unit1,1] exec "menu.sqs"
....and so on
btw - there would also be a method where you could use
a loop and an array with subarrays to optimize the whole
thing, but let's wait what you have to say first.
~S~ CD
-
Ok according to your suggestions i added the following lines to my init.sqs file:
?(unitname1 == player): [unitname1,4] exec "menu.sqs"
?(unitname2 == player): [unitname2,4] exec "menu.sqs"
...
?(unitname9 == player): [unitname9,1] exec "menu.sqs"
My menu.sqs file starts with:
_unit = _this select 0
_select_set = _this select 1
i will test it at evening, once my modified mission gets loaded to server.
In the meantime:
Will such a trigger end mission for everyone?
ActivatedBy: Anybody
Type: End #1
Activation: (heli1 in thislist) AND (getpos heli1 select 2 <= 3) and global_variable
global_variable gets"true" once the primary objective is done.
Or is there a better way to do it?