OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting Multiplayer => Topic started by: srk on 02 Aug 2006, 17:50:22

Title: Problems with titleParam
Post by: srk on 02 Aug 2006, 17:50:22
I'm trying to make a script which allows the admin to select difficulty level at the begin of the mission with titleParam. Basicly it should increase the skill of the enemy, once a harder difficulty is selected. The problem is that their skill level wont increase. ??? Everything else works fine - no errors or anything.
Here's the scripts I made...

description.ext
Code: [Select]
titleParam1 = "Difficulty";
valuesParam1[] = {1,2,3};
defValueParam1 = 2;
textsParam1[] = {"Easy","Normal","Hard"};

difficulty.sqs (gets executed in init.sqs)
Code: [Select]
?(Param1 == 1) : goto "easy"
?(Param1 == 2) : goto "normal"
?(Param1 == 3) : goto "hard"

#easy
hint format["%1",skill enemy1]
goto "exit"

#normal
"_x setSkill 0.5" foreach terrorists
~5
hint format["%1",skill enemy1]
goto "exit"

#hard
"_x setSkill 1" foreach terrorists
~5
hint format["%1",skill enemy1]
goto "exit"

#exit
exit

The hint always shows enemy1's skill as 0.2, even if I select harder difficulty.
I also made a trigger that covers the whole map and wrote terrorists = thisList; on it's activation field, activation = Resistance (the enemies).

Please help! :'(
Title: Re: Problems with titleParam
Post by: Seven on 02 Aug 2006, 18:38:50
execute your script from a trigger once the map is loaded
maybe add a delay of 0.5 seconds

condition: true
on activ: [] exec "difficulty.sqs"
Title: Re: Problems with titleParam
Post by: srk on 02 Aug 2006, 19:04:11
execute your script from a trigger once the map is loaded
maybe add a delay of 0.5 seconds

condition: true
on activ: [] exec "difficulty.sqs"
Well that was simple. Seems to work fine now. Thanks a lot. :)