OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting Multiplayer => Topic started by: Jim666 on 19 Feb 2005, 17:38:09
-
Ive seen this being used before in Multiplayer missions. At the start where you have all of the players waiting etc, to take slots. it has the paremeters for that missions. I'd like one for the mission im making where you can select, Day Dawn Dusk Night>
Appreciate any help.
-
titleParam1 = "DAYTIME";
valuesParam1[] = {1,2,3,4,5,6,7,8};
defValueParam1 = 1;
textsParam1[] = {"Random", "Dawn", "Midday", "Dusk & Autoflares", "Dusk", "Night & Autoflares", "Night", "24hrs & Autoflare", "24hrs"};
All in description.ext
Run a script where u handle all values:
?(param1 == 1):goto "Random"
?(param1 == 2):goto "Dawn"
?(param1 == 3):goto "Midday"
?(param1 == 4):goto "Dusk"
?(param1 == 5):goto "Dusknoflare"
?(param1 == 6):goto "Night"
?(param1 == 7):goto "Nightnoflare"
?(param1 == 8 ):goto "DAYNIGHTDAY"
?(param1 == 9):goto "DAYNIGHTDAYnoflare"
Use SkipTime to adjust time.
-
Um... ??? thats um confused, i dont get how you mean put the bottom stuff in a script? could you just make an example mission? i'd aprreciate!
-
MISSION EDITOR
NB>> set your mission time to midnight
then adjust the skiptime values for dusk & dawn so that you get your required light settings, eg just as the sun rises and sets.
These values will differ depending on the date throughout the year
DESCRIPTION.ext
titleParam1 = "DAYTIME";
valuesParam1[] = {1,2,3,4};
defValueParam1 = 2;
textsParam1[] = {"Dawn", "Midday", "Dusk", "Night"};
INIT.sqs
?(param1 == 1):goto "Dawn"
?(param1 == 2):goto "Midday"
?(param1 == 3):goto "Dusk"
?(param1 == 4):goto "Night"
#DAWN
skiptime 6.3
goto "Param1_END"
#MIDDAY
skiptime 12
goto "Param1_END"
#DUSK
skiptime 18.2
goto "Param1_END"
#NIGHT
;;;skiptime 0
goto "Param1_END"
#Param1_END
;;; add additional init.sqs entries
You only need 4 settings to create the 4 light settings, no need for all this
15:00 hrs
16:00 hrs
17:00 hrs mallarky
there are additional enhancements that you can add, such as an accelerated time frame, eg a full 24 hrs in 30 minutes of game, sunrise, sunset etc
you can also have some form of flare lighting to enhance your nightime missions ambience.
This requires additional scripting and knowledge of how client and servers work independantly to one n other.
For now, the above basic system will suit your needs.
There is also the possibility to use the Param2 values for additional options
eg
**************************************************
DESCRIPTION.ext
titleParam2 = "OPTIONS";
valuesParam2[] = {1,2,3};
defValueParam2 = 2;
textsParam1[] = {"Option A", "Option B", "Option C"};
INIT.sqs
?(param2 == 1):goto "Option_A"
?(param2 == 2):goto "Option_B"
?(param2 == 3):goto "Option_C"
#Option_A
;;; Examples of things you could do
deletevehicle XXXXX
Player setviewdistance XXXXX
0 setfog 1
Player removeallweapons
Player addweapon "XXXX"
Player addmagazines "XXXX"
goto "Param2_END"
#Option_B
;;; add option B entries
goto "Param2_END
#Option_C
;;; add option C entries
goto "Param2_END"
#Param2_END
good luck with your mission !!!!
-
Sweet it works, thanks!
-
I'd just like to add that you don't need to assign the names to numbers 1-7 or whatever your span is. You can assign them directly to the amount of time you want them to skip. Like so:
titleParam1 = "DAYTIME";
valuesParam1[] = {500,1200,1800,0};
defValueParam1 = 500;
textsParam1[] = {"Dawn", "Midday", "Dusk", "Night"};
I set the default value to the same value was dawn, as that's what would be chosen by default when you first choose the mission.