SceptreOfficial / Simplex-Support-Services

Support system for Arma 3
Other
26 stars 12 forks source link

2 Items as requirement for access #71

Closed xMetro closed 3 years ago

xMetro commented 3 years ago

Is there a way so i can make 2 item as a requirement?

I want to make to roles Forward Observer and JTAC And they both use the ACRE_PRC117F plus a ekstra item that seprate the 2 roles

SceptreOfficial commented 3 years ago

It just checks for any of the items listed. If you need more specialized restrictions, use the access condition for more customization. What are the extra items that you want to separate the 2 roles?

xMetro commented 3 years ago

My plan was ACRE_PRC117F & ACE_artilleryTable = Artillery ACRE_PRC117F & ACE_SpottingScope = CAS

I already limited so its only 2 specific units that can use SSS with access condition. Is there a way to seperate them even more?

SceptreOfficial commented 3 years ago

The access condition is the best way to control access. I would just use the artillery table and spotting scope as the items, then check for the acre radio in the players inventory via access condition, plus whatever else you want to use to prevent others from accessing the supports. Or just forget the access item option entirely and check for everything in the condition, which is what I would do.

To clarify, if any of the listed access items are found, the support will be available. There isn't a way to change it to check for ALL of the access items, currently.

xMetro commented 3 years ago

Yeah, that was my thought aswell. ill figure something out, im just not the best at script stuff, so if you could point me in a direction that would be a big help

SceptreOfficial commented 3 years ago

What do you currently have in your access condition?

xMetro commented 3 years ago

This "player getVariable ["canUseSSS",false]" and the the player init aswell

SceptreOfficial commented 3 years ago

Actually thinking about it more, just use the acre radio in the access items, then use this code in the condition:

player getVariable ["canUseSSS",false] && "ace_spottingscope" in _targetItems

_targetItems is an array of all the inventory items on the player that can be accessed in this scope. The class name of the spotting scope/artillery table need to be lower case. The acre and tfar radios have special handling which the access item bit accounts for.

xMetro commented 3 years ago

Thanks, im gonna test it out!

xMetro commented 3 years ago

Wuhu that worked! thanks for the help!