OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting Multiplayer => Topic started by: icarus_uk on 12 Feb 2003, 14:14:39
-
Heya peoples.
I want to use a parameter command thingy to let the server admin choose if they have respawn on a map, or if its one life no respawns.
How do I do that? I know I have to specify the type of respawn in the description.ext, but how do I get the option to display on the mission setup, and how do I turn it off?
-
Never tried setting the parameters for game time and score to choose between respawn and no respawn
---------------------------------------------------------------------------------------------
This is how i do it for optional weather and time of day
Description.ext file
respawn=3
respawndelay=10
disabledAI = 1
showCompass = 1
showNotepad = 1
showGPS = 1
onLoadIntro=""
onLoadMission="ctf@ 34 Armourgheddon(nam) by Terox"
//onLoadMission
titleParam1 = "Time:";
valuesParam1[] = {1800,1802,1804,1806};
defValueParam1 = 1802;
textsParam1[] = {"First Light","Midday","Last light", "Night"};
titleParam2 = "Score to win:";
valuesParam2[] = {9000,9200,9400};
defValueParam2 = 9000;
textsParam2[] = {"Clear","Overcast","Heavy Mist"};
Then i place the following line into my Init,.sqs, to activate the Time_Weather script
[]exec "Time_Weather.sqs"
which then runs the following script
;;Time_Weather.sqs
~0.01
?(param1 == 1800):goto "Dawn"
?(param1 == 1802):goto "Midday"
?(param1 == 1804):goto "Dusk"
?(param1 == 1806):goto "Night"
goto "weather"
#Dawn
skipTime 0
goto "weather"
#Midday
skipTime 6.25
goto "weather"
#Dusk
skipTime 12.6
;; The following line is simply a script that delays the launch of an automatic flare system during a dusk game (eg when it gets dark enough)
[]exec "delay.sqs"
goto "weather"
#Night
skipTime 18
[]exec "arcflare1.sqs"
[]exec "arcflare2.sqs"
[]exec "arcflare3.sqs"
[]exec "arcflare5.sqs"
goto "weather"
#weather
?(param2 == 9000):goto "clear"
?(param2 == 9200):goto "overcast"
?(param2 == 9400):goto "mist"
exit
#clear
0 setovercast 0
0.5 setfog 0.5
goto exit
#overcast
1 setovercast 1
0.5 setfog 0.5
goto exit
#mist
0.9 setfog 0.9
goto exit
#Exit
exit
The values for Parameter 1 are the gamelength in seconds
As most non coop missions are for 30 minutes, the difference of a few seconds isnt really that important, so you can manipulate these values a bit to your own extent
I would imagine your mission is going to be a coop, if so, then you need to bump the number of seconds up very high so you dont run out of time
---------------------------------------------------------------------------------------------
So what you could do is something similar to this
(You will have to excuse this, the syntax may not work)
Paste this into your description.ext file
respawndelay=10
//The following line disables all the AI players during the player selection phase
disabledAI = 1
showCompass = 1
showNotepad = 1
showGPS = 1
onLoadIntro=""
onLoadMission="My Map name by me"
//onLoadMission
titleParam1 = "Respawn type:";
valuesParam1[] = {1800,1802,1804,1806,1808};
defValueParam1 = 1800;
textsParam1[] = {"None","Bird","Instant", "Base","Group" };
?(param1 == 1800):goto "None"
?(param1 == 1802):goto "Bird"
?(param1 == 1804):goto "Instant"
?(param1 == 1806):goto "Base"
?(param1 == 1808):goto "Group"
#None
//No respawn
respawn=0
goto "Exit"
#Bird
//Respawns as a bird
respawn=1
goto "Exit"
#Instant
//Respawn at place of death after respawn delay
respawn=2
goto "Exit"
#Base
//Respawn at respawn marker eg respawn_west
respawn=3
goto "Exit"
#Group
//Respawns into any surviving AI
respawn=4
goto "Exit"
#Exit
[/color]
This will give you a default setting of no respawn.
In the box that normally shows the gamelength, it will instead display your respawn options
NB if you wish to have respawn=4 as an option, dont use the line
disabledAi=1 or there will be no AI to respawn into
-
Hmm.... may I make a suggestion?
Just bear in mind that I have little/no MP mission making experience here... instead of making your Param1 a really wierd value like 1800 etc., why not make it the value of the type of respawn. So instead of:
titleParam1 = "Respawn type:";
valuesParam1[] = {1800,1802,1804,1806,1808};
defValueParam1 = 1800;
textsParam1[] = {"None","Bird","Instant", "Base","Group" };
?(param1 == 1800):goto "None"
?(param1 == 1802):goto "Bird"
?(param1 == 1804):goto "Instant"
?(param1 == 1806):goto "Base"
?(param1 == 1808):goto "Group"
#None
//No respawn
respawn=0
goto "Exit"
#Bird
//Respawns as a bird
respawn=1
goto "Exit"
#Instant
//Respawn at place of death after respawn delay
respawn=2
goto "Exit"
#Base
//Respawn at respawn marker eg respawn_west
respawn=3
goto "Exit"
#Group
//Respawns into any surviving AI
respawn=4
goto "Exit"
Try out:
titleParam1 = "Respawn type:";
valuesParam1[] = {0,1,2,3,4};
defValueParam1 = 0;
textsParam1[] = {"None","Bird","Instant", "Base","Group" };
respawn = Param1
I assume there is some reason why that doesn't work ? :P
-
Im assuming then that on the mission setup you see a number 1 - 4, and not; Bird, AI, None etc.
-
From what I understand, you should see a dropbox with the options: None, Bird, Instant, Base and Group in it...
I've only ever used this sort of thing once, and that was with time limits...
However you still needed the:
textsParam1[] = ...
line, and it had to have string values in it (I think I had "15","30","45"... etc.)
Anyway, In mission you saw 15, 30, 45... so I think that's how it works ;)
-
Okdokey then. Ive not tested it out yet, (as the rest of the mission isnt done yet), but I shall eventually get around to it :)
-
The parameter variables can't be read from within description.ext. Description.ext is closer to C than the scripting language, so a lot of scripting commands can't be expected to work, and it can't be expected to function like any other script. Besides, description.ext is run once as the mission is started, and by the time the parameter is selected by the admin, it's too late to change the respawn value. Even setting the default to 3 didn't help, so it seems the param1 variable isn't being read. Read a dialog tutorial to see how "variables" are done in description.ext: with define and class.
The conclusion is that you can't give a respawn option at side selection.
-
I agree with Tac. The description.ext does not stop to wait until the admin made his choices in setup. It is processed at once from begining to end. So the earliest moment, the changes to the params by the admin can take effect is in the init.sqs.
In order to achive what u want, u will have to do some heavy skript-plumbing :)
You could count how often a player respawns, for example, and according to the Param values, make the player respawn and be able to play again or repawn him and start a camscript that kind of simulates the seagull, for example.
Awful lot of work :)