Results 1 to 6 of 6

shoot_enable_modifier

  1. #1
    Member eliw00d's Avatar
    Join Date
    Jul 2008
    Location
    USA

    shoot_enable_modifier

    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!

    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
    Edit:
    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?
    Last edited by eliw00d; 26th Aug 12 at 9:56 AM.

  2. Modding Senior Member Company of Heroes Senior Member  #2
    Celéstial by heart Celution's Avatar
    Join Date
    Apr 2008
    Location
    Sweden
    I actually haven't used the shoot_enable_modifier, but why don't you use the enable_weapon_modifiers? It basically works the same afaik, and I do know that that one works just fine.

  3. #3
    If your aim to to keep a unit from firing on another unit, couldn't you simply apply a range_weapon_modifier on a timed action to reduce the range of that unit's weapon to be lower than the distance between the two entities? In what limited experience with RGDs I have, the shoot_enable and weapon_enable modifiers are mostly interchangeable; Celestial is 110% correct in that regard.
    Your incessant button pounding is killing us!


    "We aim to remove what is preventing us from preventing our opponent from preventing us from achieving our goals." - Audemed

  4. #4
    Member eliw00d's Avatar
    Join Date
    Jul 2008
    Location
    USA
    @Celestial
    I know, I have used that one in the past. That is what I will use, then. I can't seem to get this one to work, so it may not have been properly implemented. Thanks.

  5. Modding Senior Member Company of Heroes Senior Member  #5
    Celéstial by heart Celution's Avatar
    Join Date
    Apr 2008
    Location
    Sweden
    The shoot_enable_modifier might indeed be a modifier that is part of CoHO, but requires other parts to work properly, there are several other modifiers that do not work because of this.

  6. #6
    Member I_am_a_Spoon's Avatar
    Join Date
    Jan 2010
    Location
    Western Australia
    I've never been able to get it working.

    Won't decreasing the range just result in units moving towards the enemy?

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •