Home   Help Search Login Register  

Author Topic: Params  (Read 1075 times)

0 Members and 4 Guests are viewing this topic.

Jim666

  • Guest
Params
« on: 26 Mar 2005, 14:27:01 »
How do i make a parameter, to select the time of day?

I know you put

titleParam1 = "Time of Day";
valuesParam1[] = {1, 2, 3, 4};
defValueParam1 = 2;
textsParam1[] = {"Dawn", "Day", "Dusk", "Night"};

That in to make the params show up. But i dont know how to get it to work!

Help apreciated

Offline Artak

  • The old beanbag shaker
  • Former Staff
  • ****
  • You want to talk about it, yes?
    • OFP Team Finlanders
Re:Params
« Reply #1 on: 26 Mar 2005, 22:37:14 »
So you've got the description.ext part of it figured out?
Code: [Select]
titleParam1 = "Gear";
valuesParam1[] = {1, 2, 3, 4, 5};
defValueParam1 = 2;
textsParam1[] = {"Stealth", "Default", "Agressive", "Mixed", "Random"};

titleParam2 = "AI Skill";
valuesParam2[] = {1, 2, 3, 4, 5};
defValueParam2 = 2;
textsParam2[] = {"Poor", "Default", "Hard", "Elite", "Random"};

After that all you got to do is start using the values given to the parameters. Consider the starting parameters as variables storing a real number, which the player can assign.

In the above for example if 1st parameter would be selected as 'stealth' the variable param1 would have a value of 1. If it was selected as 'aggressive' it's value would be 3.

So, in your script somewhere, the init.sqs for example, you check which value the variable has like this:
Code: [Select]
?param1 == 1: {removeallweapons _x} foreach units grp1; {_x addmagazine "hk"} foreach units grp1; {_x addweapon "hk"} foreach units grp1
?param2 == 3: {removeallweapons _x} foreach units grp1; {_x addmagazine "m60"} foreach units grp1; {_x addweapon "m60"} foreach units grp1
...
You get the idea.
The above would result in grp1 group having H&K's when parameter1 was selected as 'stealth', as in 'value 1' and M60's when selected 'aggressive, as in 'value 3'.  :)
Not all is lost.

Offline Flauta

  • Members
  • *
  • There is no knownledge, that is no power
    • Chek mi FLog
Re:Params
« Reply #2 on: 27 Mar 2005, 05:28:12 »
If it shows the buttons.. add those lines to the description.ext



Code: [Select]

;not sure if skiptime (- daytime)  works... or just put the mission time in 0 am
skiptime (- daytime)

? Param1 == 1 : skiptime 5
? Param1 == 2 : skiptime 8
? Param1 == 3 : skiptime 19
? Param1 == 4 : skiptime 24


play whit the number of the skiptime.... i think that shuld work.. not tested..


Flauta

Offline Ghost644

  • Members
  • *
    • Ghostland
Re: Params
« Reply #3 on: 15 Jun 2006, 13:22:02 »
is there a way to have the param so it sets the time to lets say 0500 and when the mission loads it displays 0500. then when the mission ends it does not count how many hours you skiped. Having the param do a skip of like 5 hours means that at the end of the mission it will show "x" hours of play plus 5 hours. ie 5hours and 4 mins for only 4 mins of fighting.
Ghost