I seem to be having some weird issues with the shoot_enable_modifier. I have copied the Modify_DisableHold function from modifiers.scar and changed the modifier blueprint. I did the same thing for the move_enable_modifier and that works fine. However, with the shoot_enable_modifier enabled, the vehicle's gun / turret seems to behave strangely with a lot of jerking. Also, it still fires, but often with a "fake" shot followed by a "real" shot in very rapid succession. I have yet to test the shoot_enable_modifier through RGD actions, but is it possible this modifier is just bugged? I seem to remember having to use enable_weapon_modifier in the past, but that has to be done per-hardpoint. I would prefer shoot_enable_modifier because it would (in theory) prevent the unit from using any weapons. Any insight would be greatly appreciated!
Edit:Code:function Modify_ShootEnable(groupid, enable) local factor = -1.0 if ( enable == true ) then factor = 1.0 end local modifier = Modifier_Create(MAT_Entity, "modifiers\\shoot_enable_modifier.lua", MUT_Enable, false, factor, "") local result = {} local _ApplyModifierToSquad = function(gid, idx, sid) local modid = Modifier_ApplyToSquad(modifier, sid) table.insert(result, modid) Modifier_AddToSquadTable(sid, modid) end local _ApplyModifierToEntity = function(gid, idx, eid) local modid = Modifier_ApplyToEntity(modifier, eid) table.insert(result, modid) Modifier_AddToEntityTable(eid, modid) end if (scartype(groupid) == ST_SGROUP) then -- apply this to each squad in the group SGroup_ForEachEx(groupid, _ApplyModifierToSquad, true, true) elseif (scartype(groupid) == ST_EGROUP) then -- apply this to each entity in the group EGroup_ForEach(groupid, _ApplyModifierToEntity) end return result end
I just tested the shoot_enable_modifier through RGD actions and I get the same results, so the code is fine. Has anyone else had success with this modifier?




