Jump to content

Recommended Posts

Hello ! 

I would like to stop the units gear to ramdomize when I am making missions. It's both frustrating and annoying.

 

In an old topic I found this : this setVariable ["BIS_enableRandomization", false];

 

but it doesn't work at all, the units uniforms are still radom when I start the mission.

 

Is there an up to date solution somewhere ?

 

ps : I use units from the project opfor. 

 

Thanks for your answers ! 

Share this post


Link to post
Share on other sites

The units from project OPFOR has their own code and has no special handling from BIS_enableRandomization. They run their own function which randomizes outfits. You would have to either overwrite the event handler in the config; or overwrite the entries it uses to pick the equipment; or hijack the randomize function, but I think it is finalized from cfgFunctions so you cannot do that.

 

Interestingly, my own squad is experiencing some weird stuff when a new Zeus joins. Some project opfor units lose their pants. But we run multiple other addons so can't say for sure which one is at fault.

 

Another option if you use CBA, would be to define you own init event handler in description.ext, where you replace their equipment.

  • Like 1

Share this post


Link to post
Share on other sites

Hey ! Thanks for your answer. 
Which one of these solutions will purely and simply resolve the problem ?

If it's possible I rather remove randomization once and for all than manage each unit individually.

Share this post


Link to post
Share on other sites

After looking at it a bit. You can't overwrite the function since it is defined in cfgFunction and is final. There are in fact two places it is randomized, and one of them is run directly, so overwriting was never a choice anyway.  If you want to overwrite using CBA you would have to do something like this in description.ext:

class Extended_Init_EventHandlers
{
    class PO_ISTS_Infantry_B_Base_IND
    {
        init = "_this execVM ""myScript.sqf"";";
    };
};

You would have to repeat that for the inner Infantry_Base class for all of them. Your "myScript.sqf" in the mission should then revert the randomization. I think that should work - have done similar things using CBA event handlers before. Only other option is to modify, or make an extension addon, for project OPFOR, but that would mean getting permission and etc.. Best bet may be to ask project OPFOR to add such a feature: "PO_enableRandomization" .

  • Like 1

Share this post


Link to post
Share on other sites
Spoiler
11 hours ago, Muzzleflash said:

After looking at it a bit. You can't overwrite the function since it is defined in cfgFunction and is final. There are in fact two places it is randomized, and one of them is run directly, so overwriting was never a choice anyway.  If you want to overwrite using CBA you would have to do something like this in description.ext:



class Extended_Init_EventHandlers
{
    class PO_ISTS_Infantry_B_Base_IND
    {
        init = "_this execVM ""myScript.sqf"";";
    };
};

You would have to repeat that for the inner Infantry_Base class for all of them. Your "myScript.sqf" in the mission should then revert the randomization. I think that should work - have done similar things using CBA event handlers before. Only other option is to modify, or make an extension addon, for project OPFOR, but that would mean getting permission and etc.. Best bet may be to ask project OPFOR to add such a feature: "PO_enableRandomization" .

 

 

Damn, I see. Thanks for having a look at this.

If I am not wrong they have been busy IRL recently, and lost interest in the mod as Arma is not stable.
So I think I might have to get my hands on your CBA solution.

Share this post


Link to post
Share on other sites

How I mostly make my missions is starting with 6-10 units and just make them how I want them 1 by 1. (medic AT teamleader grenadier etc etc)

Then use those units for me mission itself just copy and paste them...

Now if it is an mission where you got reinforcement you could even cloth them separately while also increasing their skill. (think about VIPER reinforcement)

 

this setVariable ["BIS_enableRandomization",false];

Is more for the vehicles, for example at an offroad it randomizes the colors but also the bars and the bumpers.

Share this post


Link to post
Share on other sites
1 hour ago, Theo1143 said:

How I mostly make my missions is starting with 6-10 units and just make them how I want them 1 by 1. (medic AT teamleader grenadier etc etc)

Then use those units for me mission itself just copy and paste them...

Now if it is an mission where you got reinforcement you could even cloth them separately while also increasing their skill. (think about VIPER reinforcement)

 


this setVariable ["BIS_enableRandomization",false];

Is more for the vehicles, for example at an offroad it randomizes the colors but also the bars and the bumpers.

I see. Thanks for the hint ! :wink_o:

 

Edit : well I just thought of a quick and easy solution for my problem. I should have realised this earlier :
CUP units with Project OPFOR gear...
No more problem :face_palm: sorry for wasting your time guys

Edited by Mr_Sideburns
Realised something
  • Like 1

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

×