---QUOTATION--- There's no need to do that, fluffy. Weapons configs are part of system config, so it's simpler to read required values from system_ini()... ---END QUOTATION---
local sys_ini = system_ini()
local active_weap = db.actor:active_item()
local active_section = active_weap and active_weap:section() or "none"
if sys_ini:section_exist(active_section) and
sys_ini:line_exist(active_section, "scope_status") and
sys_ini:r_string(active_section,"scope_status") == 1 then
---QUOTATION--- My script controls some shader settings. For activating my nightvision scopes on-demand I need to know two things: First, if the player currently uses the scope, i.e. is in zoom/aim mode. That one I already got. And second, if the player's current weapon has a scope or not. That's what I'm looking for. ---END QUOTATION---
Wait, did you just mention that you're working on adding nightvision scopes?
---QUOTATION--- I created one a couple of years ago.
Oh really? Interesting. Could you provide a link? Did you use ppe's or shaders?
I just used an expanded set of ppe's.
It's triggered by checking conditions and can attach to a limited set of weapons as determined by ltx entry. It also makes use of a battery.
I haven't released it as I have it buried in the SMP2.5 along with a bunch of other new mods. I'm expecting the beta for that will be out soon. I've played with it for quite some time now and it seems to work fine.