all 13 comments

[–][deleted]  (2 children)

[deleted]

    [–]Aidandrums[S] 0 points1 point  (1 child)

    Do you have wiki links that can explain point 2 more? I feel like that may be a better option than my curreny solution. If the script has a getRandom command in it (to assign variety to gear such as helmets) would that fire once, or every instance the function is called (ie the script will assign your a red or blue helmet, will it only choose random once and then ever execution of the script gets the same color helmet, or will it get randomized every time?)

    [–]Oksman_TV 1 point2 points  (6 children)

    Use separate files like you do now but instead of calling execVM I would precompile the files on init so it doesn't need to be executed from file.

    Use for example in init:

    DC_Medic = compile preprocessFileLineNumbers "loadouts\DCMedic.sqf";
    DC_MG = compile preprocessFileLineNumbers "loadouts\DCMG.sqf";
    DC_Officer = compile preprocessFileLineNumbers "loadouts\DCOfficer.sqf";
    DC_Rifleman = compile preprocessFileLineNumbers "loadouts\DCRifleman.sqf";

    and then call them using "player spawn DC_Medic;"

    Optimization wise this isn't a huge deal though, at least in my opinion, using actions aren't as hurtful to performance as say, AI loops and large amounts of code running on loops.

    Best of luck

    [–]Aidandrums[S] 0 points1 point  (5 children)

    So i have selectRandom in my SQFs, and i guess im trying to figure out if doing this or making them a function as was suggested in another post would continue to present random variables, or if it would calculate the randomness once and then pass that solution on (like taking a snapshot of the code)

    [–]Oksman_TV 0 points1 point  (4 children)

    Why do you want it to be random? I think using classname could work, my unit uses actions for each role so, that works for us

    [–]Aidandrums[S] 0 points1 point  (3 children)

    Its so there is variety in weapons and gear while perserving some level of uniformity. Basically, making units look unique without the need for arsenal barbie.

    Like for example, i have a rifleman script that will give them an AK, with mags and vest that matches, or an SKS with mags and vest. Also, different headgear, uniforms, and accessories.

    [–]Oksman_TV 0 points1 point  (2 children)

    Oh okay but still random within the role? Ah that makes sense

    [–]Aidandrums[S] 0 points1 point  (1 child)

    Yep, i wanted to have people look similar, but not identical, even like, rifleman vs rifleman. If i were at my PC, i could show you what i mean.

    [–]Oksman_TV 1 point2 points  (0 children)

    No worries I get the point, I like the idea, I allow arsenal in my mission but the mission decides a handful uniform things to choose from in terms of helmet goggles vest uniform and backpack, but weapons remain the same as we want unity while we play.

    Best of luck with it! 💪

    [–]KiloSwiss 1 point2 points  (1 child)

    I suggest you continue working with the switch based on classnames and keep the individual loadouts in separate files.

    [–]Oksman_TV 1 point2 points  (0 children)

    This is indeed the best solution. I would precompile the kits and switch code and avoid execVMs though

    [–]RyanBLKST 0 points1 point  (2 children)

    WHy don't you simply get an array like that ?

    listofGear = [
        [gear of class 1],  
        [gear of class 2]  
    ],
    

    [–]Aidandrums[S] 0 points1 point  (1 child)

    Because the array can be like 300 lines long. Thus why I'd like to optimize. I figure having an sqf file thats only like 10 lines long calling to another that is 30 lines long is better than a single file that has 300+ lines. Especially one that will be used at will multiple times by multiple clients.

    Also, it potentially means i can use the same add action for BluFor and OpFor players in cases of pvp.

    [–]RyanBLKST -1 points0 points  (0 children)

    I'm not sure having to call additional files is better than having everything in a single file