Arma 3
BettIR (Legacy v0.2.1)
Vestarr  [developer] Oct 19, 2020 @ 3:18pm
How to make my/someone's mod compatible with BettIR?
People request compatibility a lot and it absolutely makes sense. I'd like to support everything but of course I also have to remain reasonable about it. There's so many mods and there's a lot of requests - then also adding more and more to the base mod will just keep increasing the size of it, size of the memory and calculations used to determine important pieces of it, etc. - and then there's also the concern of constant updates and server administrators hating me for it. And, not to mention the fact that it also takes me time to sort these things out.

I might be making the compatibility mods its own separate mod on the workshop just to keep things cleaner - let me know what you think about it!

Regardless, if my mod doesn't support the NVGs/attachments you'd like to use, you're not doomed just yet! Here are your options:

How to add your custom items to the mod without messing with the mods

That's easy. When you create a mission in the mission editor, just go to its folder wherever it's saved and create a file called initPlayerLocal.sqf - it runs for every player locally at the game start (more or less) so it's a perfect place for us to extend the config.
There are variables that store important information in arrays. For weapon attachments it's BettIR_compatibleAttachments and BettIR_compatibleAttachmentsOffsets. The former is an array of the classnames of weapon attachments that are compatible with BettIR. The latter contains the offsets (where the lightsource should be relative to the weapon proxy) for these attachments. The rule of the game is to make sure that both these arrays are the same length. If you don't know what the offset should be, don't stress; it's an approximate position, and you can probably just copy one of the existing values in that array anyways.
The above applies for the NVG's too - there are variables called BettIR_compatibleNVGs and BettIR_compatibleNVGsOffsets which do the same thing.

So your initPlayerLocal.sqf could look like this:

// these two lines will make an item called "somecustommod_pvs15" compatible with BettIR BettIR_compatibleNVGs pushBack 'somecustommod_pvs15'; BettIR_compatibleNVGsOffsets pushBack [0,0.15,0.14]; // offset from __base_NVG // the below two lines will make an attachment called "somecustommod_dbal" compatible with BettIR BettIR_compatibleAttachments pushBack 'somecustommod_dbal'; BettIR_compatibleAttachmentsOffsets pushBack [0, 0.28, 0.12]; // offset from __base_topRailPointer

If you put it in a mission, all your players should be able to use your custom mod items with BettIR just like anything else.

This is obviously just an easy and temporary solution, in case you'd like to have it available ASAP

The better way

You can either encourage your modmaker to make their items compatible with BettIR or make the compatibility mod on your own. The config is awfully simple, there's more information in the mod description. Just bear in mind that the compatibility API will change at some point soon to accommodate a lot more detail, realism and precision in the mod. That will come later though and I'll try to do my best to notify all modmakers about the big change when it comes.
Last edited by Vestarr; Nov 4, 2020 @ 7:46am
< >
Showing 1-12 of 12 comments
PiZZADOX Oct 20, 2020 @ 6:25am 
Instead of having two separate arrays for the offset and classname, why not nest the arrays like this?
BettIR_compatibleNVGs pushBack ["somecustommod_pvs15", [0,0.15,0.14]];
that way you can use the array in a script with:
BettIR_compatibleNVGs apply { _x params ["_className", "_offset"]; }
and you can keep adding elements to the array element and param classes along with default values for them.
Vestarr  [developer] Oct 20, 2020 @ 7:20am 
@PiZZADOX
I inteded to do it this way but it makes it more costly to loop through. I wish JSON was supported natively...l
D. Dwyer Oct 21, 2020 @ 1:57pm 
How would you format it to give multiple NVGs compatibility with the initPlayerLocal.sqf?
Last edited by D. Dwyer; Oct 21, 2020 @ 1:58pm
Vestarr  [developer] Oct 21, 2020 @ 2:05pm 
I'm afraid you have to do what I just mentioned for each variant of your NVGs, adding all classnames and respective offsets into the arrays the way I described
Saavedra Nov 4, 2020 @ 4:06am 
@Vestarr

I think what Dwyer might have been asking, and what I´m asking now too (because I barely know anything about modding Arma), is how exactly do you write down the array in the sqf for BettIR so it will recognize more than one NVG or attachment. Say you want three NVGs to be recognized. How would you put this together?

BettIR_compatibleNVGs pushBack 'NVG1';
BettIR_compatibleNVGs pushBack [0,0.15,0.14]; // offset from __base_NVG

BettIR_compatibleNVGs pushBack 'NVG2';
BettIR_compatibleNVGs pushBack [0,0.15,0.14]; // offset from __base_NVG

BettIR_compatibleNVGs pushBack 'NVG3';
BettIR_compatibleNVGs pushBack [0,0.15,0.14]; // offset from __base_NVG
Last edited by Saavedra; Nov 4, 2020 @ 5:14am
Vestarr  [developer] Nov 4, 2020 @ 7:59am 
@Saavedra
I've just realised I've done a booboo in the main post, fixed it now.

Essentially the way you put it in the code... Almost. The offest should go into BettIR_compatibleNVGsOffsets array; so it would have to be
BettIR_compatibleNVGs pushBack 'NVG1'; BettIR_compatibleNVGsOffsets pushBack [0,0.15,0.14]; // offset from __base_NVG BettIR_compatibleNVGs pushBack 'NVG2'; BettIR_compatibleNVGsOffsets pushBack [0,0.15,0.14]; // offset from __base_NVG BettIR_compatibleNVGs pushBack 'NVG3'; BettIR_compatibleNVGsOffsets pushBack [0,0.15,0.14]; // offset from __base_NVG
I haven't tested it myself, but it should work. The only scenario where I could see it not working is when the mission's initPlayerLocal actually runs earlier than BettIR init, which is probably possible in certain cases.
In which case, you can run:
['ace_settingsInitialized', { BettIR_compatibleNVGs pushBack 'NVG1'; BettIR_compatibleNVGs pushBack [0,0.15,0.14]; // offset from __base_NVG BettIR_compatibleNVGs pushBack 'NVG2'; BettIR_compatibleNVGs pushBack [0,0.15,0.14]; // offset from __base_NVG BettIR_compatibleNVGs pushBack 'NVG3'; BettIR_compatibleNVGs pushBack [0,0.15,0.14]; // offset from __base_NVG }] call CBA_fnc_addEventHandler;

Try that and lemme know :)
Saavedra Nov 4, 2020 @ 12:29pm 
Thanks for your help! This worked perfectly:

// these two lines will make an item called "somecustommod_pvs15" compatible with BettIR
BettIR_compatibleNVGs pushBack 'NVG1';
BettIR_compatibleNVGsOffsets pushBack [0,0.15,0.14]; // offset from __base_NVG

BettIR_compatibleNVGs pushBack 'NVG2';
BettIR_compatibleNVGsOffsets pushBack [0,0.15,0.14]; // offset from __base_NVG

BettIR_compatibleNVGs pushBack 'NVG3';
BettIR_compatibleNVGsOffsets pushBack [0,0.15,0.14]; // offset from __base_NVG



Now I´m trying to make it work with attachments. I have an IR laser for a pistol from the CUP addon, but it doesn´t work:

// the below two lines will make an attachment called "somecustommod_dbal" compatible with BettIR
BettIR_compatibleAttachments pushBack 'CUP_acc_MLPLS_Laser';
BettIR_compatibleAttachmentsOffsets pushBack [0, 0.28, 0.12];

Did you happen to make the addon work only with rifle attachments at the time, or is there something I´m missing here?
Last edited by Saavedra; Nov 4, 2020 @ 12:47pm
Vestarr  [developer] Nov 5, 2020 @ 1:11pm 
Yeah, unfortunately it's only compatible with primary weapons for now bud
Mirek Dec 7, 2020 @ 7:50am 
Iam triing to get BetIR working with W40K NVGs in my mission.

//This works
BettIR_compatibleNVGs pushBack 'TIOW_IG_NVG';
BettIR_compatibleNVGs pushBack [0,0.15,0.14]; // offset from __base_NVG

//This doesnt despite it being the same NVG glases but with different collor.
BettIR_compatibleNVGs pushBack 'TIOW_IG_NVG_Green';
BettIR_compatibleNVGs pushBack [0,0.15,0.14]; // offset from __base_NVG

//This doesnt work
BettIR_compatibleNVGs pushBack 'TIOW_PhotovisorGoggles';
BettIR_compatibleNVGs pushBack [0,0.15,0.14]; // offset from __base_NVG

//This doesnt work
BettIR_compatibleNVGs pushBack 'ML700_Photo_NVG';
BettIR_compatibleNVGs pushBack [0,0.15,0.14]; // offset from __base_NVG

//This doesnt work
BettIR_compatibleNVGs pushBack 'TIOW_Bionic_Eye';
BettIR_compatibleNVGs pushBack [0,0.15,0.14]; // offset from __base_NVG

//This doesnt work
BettIR_compatibleNVGs pushBack 'TIOW_Bionic_Eye_Green';
BettIR_compatibleNVGs pushBack [0,0.15,0.14]; // offset from __base_NVG

//This doesnt work
BettIR_compatibleNVGs pushBack 'TIOW_Bionic_Eye_2';
BettIR_compatibleNVGs pushBack [0,0.15,0.14]; // offset from __base_NVG

//This doesnt work
BettIR_compatibleNVGs pushBack 'TIOW_Bionic_Eye_2_Green';
BettIR_compatibleNVGs pushBack [0,0.15,0.14]; // offset from __base_NVG

so far i was succesfull only with one particular NVG. BUt i canot make it work with none of the others. What are the requirements the NVG must have to work with BetIR?
Last edited by Mirek; Dec 7, 2020 @ 7:51am
Vestarr  [developer] Dec 8, 2020 @ 11:20am 
@Mirek
See my latest comment in this thread.
MdioxD Jan 9, 2021 @ 3:28pm 
Just noticed that changing the offset doesn't change the position of the light source for me...
Any idea ?
Tex May 12, 2021 @ 7:10pm 
I've got that error as well now @MdioxD
< >
Showing 1-12 of 12 comments
Per page: 1530 50