Welcome to the Iron Front Fan Forums!
Sign up Latest Topics
 
 
 


Reply
  Author   Comment  
Haz

Sergeant
Registered:
Posts: 89
Reply with quote  #1 
PrimaryTargetsCaptured = 0;

NumberOfAOs = (paramsArray select 6);

while {PrimaryTargetsCaptured < NumberOfAOs} do {code...};

Any idea? It has to be something simple. [smile]

Dirty Haz
0
BRS

Captain
Registered:
Posts: 195
Reply with quote  #2 
Too less information I mean.
So I just can guess:

How big is that 'paramsArray' while using NumberOfAOs = (paramsArray select 6); ?
Possible you have 6 items inside? If so, the selection goes from select 0 to select 5.

Or your 'paramsArray' is empty, notinitialized the moment you'll use it?
paramsArray = [] should fail, paramsArray = [0,0,0,0,0,0]; would be better.

Or you call that code containing function without filling in the count of parameters?
[0,1,2,3,4] spawn myfunc would fail,
[0,1,2,3,4,5] spawn myfunc would transmit the 6. parameter (5) to your function.
(0,1,2,3,4,5 are just free named placeholders in this case)
Sorry if no idea hit the point, as said, too less input.
0
Haz

Sergeant
Registered:
Posts: 89
Reply with quote  #3 
Sorry about that. In my init.sqf I wait for paramsArray to exist like so:
if (isNil "paramsArray") then {
if (isClass (missionConfigFile/"Params")) then {
for "_i" from 0 to (count (missionConfigFile/"Params") - 1) do {
_paramName = configName ((missionConfigFile >> "Params") select _i);
missionNamespace setVariable [_paramName, getNumber (missionConfigFile >> "Params" >> _paramName >> "default")];
};
};
} else {
for "_i" from 0 to (count paramsArray - 1) do {
missionNamespace setVariable [configName ((missionConfigFile >> "Params") select _i), paramsArray select _i];
};
};

Then in my description.ext I have for the "Number Of AOs" this:
class NumberOfAOs {
// paramsArray[6]
title = "Number Of AOs";
texts[] = {"1", "2", "3", "4", "5", "6", "7", "8"};
values[] = {1, 2, 3, 4, 5, 6, 7, 8};
default = 1;
};


Dirty Haz
0
BRS

Captain
Registered:
Posts: 195
Reply with quote  #4 
Sorry, I didn't used this paramsArray things up to now [frown]
Anyhow, do you really have at least seven of these classes inside your description.ext so you can select the paramsArray[6]?

0
Haz

Sergeant
Registered:
Posts: 89
Reply with quote  #5 
Huh? I have 8?

Dirty Haz
0
Haz

Sergeant
Registered:
Posts: 89
Reply with quote  #6 
Solved. Somehow I forgot to include the parameters file in description.ext lol. [smile]

Dirty Haz
0
BRS

Captain
Registered:
Posts: 195
Reply with quote  #7 
Don't know if you have 8 classes there, but if you select 6 this means that it is the seventh entry [smile]
Good to see that you solved it. You were right, it was something simple [smile]
0
Previous Topic | Next Topic
Print
Reply

Quick Navigation:

Easily create a Forum Website with Website Toolbox.