A3Wasteland / ArmA3_Wasteland.Altis

A3Wasteland is a survival sandbox mission for Arma 3 where two teams and independent players fight for survival. Built in collaboration between GoT, TPG, KoS, 404Games, and others.
http://a3wasteland.com
GNU Affero General Public License v3.0
102 stars 184 forks source link

playerSetupGear.sqf - No case for Assault Diver? #464

Closed Webman97 closed 7 years ago

Webman97 commented 7 years ago

https://github.com/A3Wasteland/ArmA3_Wasteland.Altis/blob/dev/client/functions/playerSetupGear.sqf

The switch statement does not have a case for the Assault Diver role. Calling diver and assaultdiver doesn't work. What is the variable for the Diver? Why isn't there a case for the Assault Diver role?

I'm aware that other servers have this function working, and I see them calling diver. However, it seems that they had to redefine the role of Assault Diver.

AgentRev commented 7 years ago

Gear setup is what goes in the inventory, my diver thing is just for clothing: https://github.com/A3Wasteland/ArmA3_Wasteland.Altis/blob/dev/client/functions/getDefaultClothing.sqf

Webman97 commented 7 years ago

Ahh. So you didn't extend the diver variable for gear? I'm trying to add gear to the Assault Diver role and end up breaking everything in the process.

For example:

    case (["_diver_", typeOf _player] call fn_findString != -1):
    {
        //Add Underwater Rifle and two 20Rnd Mags
        _player addWeapon "arifle_SDAR_F"'
        _player addMagazine "20Rnd_556x45_UW_mag";
        _player addMagazine "20Rnd_556x45_UW_mag";
        //Diver Items
        _player addVest "Vest_V_RebreatherB";
    }

That breaks the entire file.

What needs to be changed to allow divers to spawn with gear?

AgentRev commented 7 years ago

You do not add the vest in playerSetupGear. In fact, you do not need to add rebreathers, because divers already spawn with rebreathers, as defined in getDefaultClothing.

You do not add the weapon first, you need to add the magazine first, and then the weapon, so that the magazine is auto-loaded.

Your code is correct but has syntax errors. Please start the game with -showScriptErrors

Webman97 commented 7 years ago

Wow, just noticed many things at once. Easy syntax problems, got that.

So you excluded the diver role because there isn't any special gear you want to give the diver?

AgentRev commented 7 years ago

"Why is X missing" - usually because it's not been ever brought up before.

Webman97 commented 7 years ago

I got everything I needed to work working, thank you!

I figured it had been brought up before because your last update to this file states:

Re-added NVGs, added custom loadouts for all classes

The Assault Diver is missing a case, therefore assuming that note is true, you would have excluded the case on purpose because there was nothing to add to the Assault Diver role.

Webman97 commented 7 years ago

Nothing else to really note outside of the obvious:

    case (["_diver_", typeOf _player] call fn_findString != -1):
    {
            //Add diver items here (Keep getDefaultClothing.sqf in mind, I broke the entire file by adding a Slash Bandolier after the backpack and trying to remove it here.)
    };

It's easy to add this manually if someone wishes to add it. Thanks for the help!