Jump to content

Recommended Posts

Can someone?

 

Like others already stated, you're missing one "}".

I can remember that you claimed to have no problems debugging your own script despite those terrible naming conventions you're following.

Take the hint, find that missing bracket and continue debugging from there on.

Relying on others to help debug your code won't work out in the long run (due to already mentioned reasons), especially when you're too lazy to check for a correct bracket count yourself.

 

Cheers

Share this post


Link to post
Share on other sites
//(snip)
for "n" from 1 to count _this do {
//(snip)
Still nothing.

 

 Well, have a look at the above line and search the "}" which is closing that for-loop. You will not find it, because it's missing.

 

Now, let me show you how I would have indented your code. Since I can't understand it either, you decide whether that's correct.

_this = [p0,[["B_Heli_Transport_01_F"],["B_Slingload_Cargo_01_F"],["B_quadbike_01_F","B_quadbike_01_F"],"",false]];

switch (playerside) do {
    case blufor: {
        _slo = "B_Slingload_01_Cargo_F";
    };
    case opfor; {
        _slo = "O_Slingload_01_Cargo_F";
    };
};

_lv = 1;
_slp = _this select 0;
slghd = creategroup west;

for "n" from 1 to count _this do {
    _la = _this select _lv;
    _lv1 = 0;
    _lst4 = true;
    _lst = true;
    _lst1 = true;
    _loc = 0;
    
    while (_lst) do {
        if ((ahd find _lv1) != -1) then {
            _lv1 = _lv1 + 1;
        } else {
            ahd append _lv1;
            _lst = false;
            hint str(_lv1);
        };
    };
    
    call compile format ["sthdd%1 = false;", _lv1];
    _lo = createVehicle [(_la select 0) select 0, _slp, [], 0, "FLY"];
    createvehiclecrew _lo;
    
    If ((count _la select 0) > 1) then {
        _lo1 = createVehicle [(_la select 0) select 1, _slp, [], 0, "FLY"];
        while (_lst4) do {
            _lo1 setpos getpos _lo;
            sleep 0.5;
        };
    };
    
    if (!isnull (_la select 1)) then {
        _loc = createVehicle [_la select 1, _slp, [], 0, "FLY"];
        _lo setSlingLoad _loc;
        
        while (_lst1) do {
            if (alive crew _lo) then {
                if (call compile format ["sthdd%1", _lv1]) then {
                    _lo setslingload objnull;
                };
                
                if (isnull getSlingLoad _lo) then {
                    _lst4 = false;
                    _lst1 = false;
                    
                    if (!isnull (_la select 2)) then {
                        _lp = getpos _loc;
                        _lp1 = getposatl _loc;
                        
                        {
                            createvehicle [_x, _lp, [], 0, "NONE"];
                            
                            if ((_lp1 select 3) > 4) then {
                                _x call KK_fnc_paraDrop;
                            };
                            sleep 0.5;
                        } foreach (_la select 2);
                    };
                };
            } else {
                _lst1 = false;
            };
        };
    } else {
        if (!isnull (_la select 2)) then {
            if (!(_lo canslingload _la select 2)) then {
                _loc = createVehicle [_slo, _slp, [], 0, "FLY"];
                
                while (_lst1) do {
                    if (alive crew _lo) then {
                        if (call compile format ["sthdd%1", _lv1]) then {
                            _lo setslingload objnull;
                        };
                        
                        if (isnull getSlingLoad _lo) then {
                            _lst4 = false;
                            _lst1 = false;
                            _lp = getpos _loc;
                            _lp1 = getposatl _loc;
                            deletevehicle _loc;
                            
                            {
                                createvehicle [_x, _lp, [], 0, "NONE"];
                                if ((_lp1 select 3) > 100) then {
                                    _x call KK_fnc_paraDrop;
                                };
                                sleep 0.5;
                            } foreach (_la select 2);
                        };
                    } else {
                        _lst1 = false;
                    };
                };
            } else {
                _loc = createVehicle [(_la select 2) select 0, _slp, [], 0, "FLY"];
                while (_lst1) do {
                    if (alive crew _lo) then {
                        if (call compile format ["sthdd%1", _lv1]) then {
                            _lo setslingload objnull;
                            _lst1 = true;
                        };
                        
                        if (isnull getSlingLoad _lo) then {
                            _lst4 = false;
                            _lp = getpos _loc;
                            _lp1 = getposatl _loc;
                            
                            if ((_lp1 select 3) > 100) then {
                                _loc call KK_fnc_paraDrop;
                            };
                            
                            if (count (_la select 2) > 1) then {
                                {
                                    createvehicle [_x, _lp, [], 0, "NONE"];
                                    if ((_lp1 select 3) > 100) then {
                                        _x call KK_fnc_paraDrop;
                                        sleep 0.5;
                                    } foreach (_la select 2 set [0,objnull]);
                                };
                            };
                        } else {
                            _lst1 = false;
                        };
                    };
                };
                _lo setSlingLoad _loc;
            };
        };
        
        if (!isnull (_la select 3)) then {
            call compile format ["sthdihd%1 = false;", _lv1];
            call compile format ["sthdicd%1 = false;", _lv1];
            _lg = [_slp, side player, _la select 3] call BIS_fnc_spawnGroup;
            
            if (_la select 4) then {
                {
                    if ((_loc emptyPositions "cargo") > 0) then {
                        _x moveInCargo _loc;
                    } else {
                        _x moveInCargo _lo;
                    };
                } foreach units _lg;
            } else {
                {
                    _x moveInCargo _lo;
                } foreach units _lg;
            };
            
            _lg join group player;
            _lst2 = true;
            _lst3 = false;
            
            while (lst2 or _lst3) do {
                if (call compile format ["sthdihd%1", _lv1]) then {
                    {
                        if ((vehicle _x) == _lo) then {
                            [_lo,_x,130] execVM "eject.sqf";
                        };
                    } foreach units _lg;
                };
                
                if (_la select 4) then {
                    _lst3 = true;
                    if (call compile format ["sthdicd%1", _lv1]) then {
                        {
                            if ((vehicle _x) == _loc) then {
                                [_loc,_x,130] execVM "eject.sqf";
                            };
                        } foreach units _lg;
                    };
                };
            };
        };
        
        crew _lo join slghd;
        [playerside,hq] commandchat "Transport identification: " + str (_lv1);
        
        if (_lv == count _this) then {
            slghd join group player;
        };
        _lv = _lv + 1;
    };
//} is missing here

 

Note that there is a ";" (semicolon) on line 7 when it has to be a ":" (colon):

case opfor; {

Also, have a look at line 126 to 134:

if (count (_la select 2) > 1) then {
    { //<-- what is this?
        createvehicle [_x, _lp, [], 0, "NONE"];
        if ((_lp1 select 3) > 100) then {
            _x call KK_fnc_paraDrop;
            sleep 0.5;
        } foreach (_la select 2 set [0,objnull]);
    }; //<-- and this?
};

Is that going to work? I doubt it.

 

Please, for the sake of saving life time and nerves, start your ArmA 3 with the startup parameter -showScriptErrors (with the leading "-"), because it's going to show you things like that!

 

And finally, let me tell you on behalf of I guess all of us who posted here:

You cannot expect the community to help you if you provide obfuscated code like this. It doesn't matter if you provide a list of what these obfuscated variables mean. If we cannot read the code as-is, we won't help simply because WE CAN'T.

Share this post


Link to post
Share on other sites

 Well, have a look at the above line and search the "}" which is closing that for-loop. You will not find it, because it's missing.

 

Now, let me show you how I would have indented your code. Since I can't understand it either, you decide whether that's correct.

_this = [p0,[["B_Heli_Transport_01_F"],["B_Slingload_Cargo_01_F"],["B_quadbike_01_F","B_quadbike_01_F"],"",false]];

switch (playerside) do {
    case blufor: {
        _slo = "B_Slingload_01_Cargo_F";
    };
    case opfor; {
        _slo = "O_Slingload_01_Cargo_F";
    };
};

_lv = 1;
_slp = _this select 0;
slghd = creategroup west;

for "n" from 1 to count _this do {
    _la = _this select _lv;
    _lv1 = 0;
    _lst4 = true;
    _lst = true;
    _lst1 = true;
    _loc = 0;
    
    while (_lst) do {
        if ((ahd find _lv1) != -1) then {
            _lv1 = _lv1 + 1;
        } else {
            ahd append _lv1;
            _lst = false;
            hint str(_lv1);
        };
    };
    
    call compile format ["sthdd%1 = false;", _lv1];
    _lo = createVehicle [(_la select 0) select 0, _slp, [], 0, "FLY"];
    createvehiclecrew _lo;
    
    If ((count _la select 0) > 1) then {
        _lo1 = createVehicle [(_la select 0) select 1, _slp, [], 0, "FLY"];
        while (_lst4) do {
            _lo1 setpos getpos _lo;
            sleep 0.5;
        };
    };
    
    if (!isnull (_la select 1)) then {
        _loc = createVehicle [_la select 1, _slp, [], 0, "FLY"];
        _lo setSlingLoad _loc;
        
        while (_lst1) do {
            if (alive crew _lo) then {
                if (call compile format ["sthdd%1", _lv1]) then {
                    _lo setslingload objnull;
                };
                
                if (isnull getSlingLoad _lo) then {
                    _lst4 = false;
                    _lst1 = false;
                    
                    if (!isnull (_la select 2)) then {
                        _lp = getpos _loc;
                        _lp1 = getposatl _loc;
                        
                        {
                            createvehicle [_x, _lp, [], 0, "NONE"];
                            
                            if ((_lp1 select 3) > 4) then {
                                _x call KK_fnc_paraDrop;
                            };
                            sleep 0.5;
                        } foreach (_la select 2);
                    };
                };
            } else {
                _lst1 = false;
            };
        };
    } else {
        if (!isnull (_la select 2)) then {
            if (!(_lo canslingload _la select 2)) then {
                _loc = createVehicle [_slo, _slp, [], 0, "FLY"];
                
                while (_lst1) do {
                    if (alive crew _lo) then {
                        if (call compile format ["sthdd%1", _lv1]) then {
                            _lo setslingload objnull;
                        };
                        
                        if (isnull getSlingLoad _lo) then {
                            _lst4 = false;
                            _lst1 = false;
                            _lp = getpos _loc;
                            _lp1 = getposatl _loc;
                            deletevehicle _loc;
                            
                            {
                                createvehicle [_x, _lp, [], 0, "NONE"];
                                if ((_lp1 select 3) > 100) then {
                                    _x call KK_fnc_paraDrop;
                                };
                                sleep 0.5;
                            } foreach (_la select 2);
                        };
                    } else {
                        _lst1 = false;
                    };
                };
            } else {
                _loc = createVehicle [(_la select 2) select 0, _slp, [], 0, "FLY"];
                while (_lst1) do {
                    if (alive crew _lo) then {
                        if (call compile format ["sthdd%1", _lv1]) then {
                            _lo setslingload objnull;
                            _lst1 = true;
                        };
                        
                        if (isnull getSlingLoad _lo) then {
                            _lst4 = false;
                            _lp = getpos _loc;
                            _lp1 = getposatl _loc;
                            
                            if ((_lp1 select 3) > 100) then {
                                _loc call KK_fnc_paraDrop;
                            };
                            
                            if (count (_la select 2) > 1) then {
                                {
                                    createvehicle [_x, _lp, [], 0, "NONE"];
                                    if ((_lp1 select 3) > 100) then {
                                        _x call KK_fnc_paraDrop;
                                        sleep 0.5;
                                    } foreach (_la select 2 set [0,objnull]);
                                };
                            };
                        } else {
                            _lst1 = false;
                        };
                    };
                };
                _lo setSlingLoad _loc;
            };
        };
        
        if (!isnull (_la select 3)) then {
            call compile format ["sthdihd%1 = false;", _lv1];
            call compile format ["sthdicd%1 = false;", _lv1];
            _lg = [_slp, side player, _la select 3] call BIS_fnc_spawnGroup;
            
            if (_la select 4) then {
                {
                    if ((_loc emptyPositions "cargo") > 0) then {
                        _x moveInCargo _loc;
                    } else {
                        _x moveInCargo _lo;
                    };
                } foreach units _lg;
            } else {
                {
                    _x moveInCargo _lo;
                } foreach units _lg;
            };
            
            _lg join group player;
            _lst2 = true;
            _lst3 = false;
            
            while (lst2 or _lst3) do {
                if (call compile format ["sthdihd%1", _lv1]) then {
                    {
                        if ((vehicle _x) == _lo) then {
                            [_lo,_x,130] execVM "eject.sqf";
                        };
                    } foreach units _lg;
                };
                
                if (_la select 4) then {
                    _lst3 = true;
                    if (call compile format ["sthdicd%1", _lv1]) then {
                        {
                            if ((vehicle _x) == _loc) then {
                                [_loc,_x,130] execVM "eject.sqf";
                            };
                        } foreach units _lg;
                    };
                };
            };
        };
        
        crew _lo join slghd;
        [playerside,hq] commandchat "Transport identification: " + str (_lv1);
        
        if (_lv == count _this) then {
            slghd join group player;
        };
        _lv = _lv + 1;
    };
//} is missing here

 

Note that there is a ";" (semicolon) on line 7 when it has to be a ":" (colon):

case opfor; {

Also, have a look at line 126 to 134:

if (count (_la select 2) > 1) then {
    { //<-- what is this?
        createvehicle [_x, _lp, [], 0, "NONE"];
        if ((_lp1 select 3) > 100) then {
            _x call KK_fnc_paraDrop;
            sleep 0.5;
        } foreach (_la select 2 set [0,objnull]);
    }; //<-- and this?
};

Is that going to work? I doubt it.

 

Please, for the sake of saving life time and nerves, start your ArmA 3 with the startup parameter -showScriptErrors (with the leading "-"), because it's going to show you things like that!

 

And finally, let me tell you on behalf of I guess all of us who posted here:

You cannot expect the community to help you if you provide obfuscated code like this. It doesn't matter if you provide a list of what these obfuscated variables mean. If we cannot read the code as-is, we won't help simply because WE CAN'T.

Thank you, fixed what you marked, still do not working, started checking the script by pieces, the part do not giving needeble result:

for "_lv1" from 1 to 3 do {
		call compile format ["sthdd%1 = false", _lv1];
					while {true} do {
							if (call compile format ["sthdd%1", _lv1]) then {
								hint "t";
							};
					};
};

If someone know how to make that working and can write it i would be very pleasure.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×