Intel on dead bodies or in buildings

  1. 8 years ago

    Would there be a way in an Assymetric Insurgency mission to add a percent chance of finding Intel (the same kind you get from interrogating civilians) on dead enemy bodies or even just a chance to find some laying around in civilian buildings? I'd love to see this as an option either with ALiVE in the future with Spyder's Addons. But for now, has anyone attempted to tap into the current Intel system and find new ways of "discovering" it?

  2. Edited 8 years ago by incontinenetia

    This would be awesome!

    EDIT: Here it is.

    All credit goes to Dixon13 and SpyderBlack723 (and also ARJay for the marking units script).

    What it does

    This will add the possibility of dropping three tiers of intel items next to killed units of the asymmetric side of your choice and one tier to the other side (presuming you are playing as BLUFOR).

    For the asymmetric faction, it will either (a) temporarily reveal nearby installations, (b) temporarily reveal all spawned units of that side, or (c) temporarily reveal installations further away. (Working on something better but this is what I've got so far).

    For the non-asymmetric side, it will create intel items next to dead bodies that temporarily reveal spawned units of that side.

    My preference is to set the percentage chance of this to (a) 10, (b) 3, and (c) 1. You can change this yourself according to the instructions at the top of the fnc_intelHandlerEast.sqf or fnc_intelHandlerGuer.sqf scripts. You can also change the object spawned by editing these scripts according to the instructions in them.

    Be warned: the objects can be really hard to find in grassy areas. I think this creates a more realistic experience as you have to search for them, but if this is irritating then change the object to something large like a laptop. Unfortunately I haven't had the time to try to get an alternative way of spawning items to work properly just yet so the items spawn in a 3 meter radius. Ideally I'll reduce this and post a revised version when I get the chance.

    How to use it

    Add the stuff from either the AsymEast or AsymGuer folders to your mission root folder, using AsymEast if the asymmetric side is OPFOR, or AsymGuer if the asymmetric side is Independent. Obviously, if you already have an Init.sqf or Description.ext then just copy the code over from this into your original files.

    Be warned, this should work but I haven't had the time to test it and I've done a few edits to clean it up from an experimental thing I was (very slowly) working on. Let me know if there are any bugs.

    To test, set all the percentages in the fnc_intelHandler scripts to 100 and kill some guys in an ALiVE mission.

    If you do modify and redistribute, please keep all mentions of Dixon13, SpyderBlack723 and ARJay in the scripts.

    UPDATE: Removed sleep commands from intel handlers so it should hopefully work better now.

  3. Friznit

    11 Jan 2016 Administrator

    Hazey did something like this in his Insurgency mission if I recall.

  4. Is there any method of accomplishing this that doesn't have a strict license attached to it?

  5. I was diving into the civilian pop and insurgency scripts over the last few days and recall seeing the intel action handler. If you just want to replicate what's already being done in ALiVE when interacting with the civilian population, I can (try to remember to) post a rough outline of the script you'd need to attach to your bodies.

  6. If you could find any time to do that, that would be amazing.

  7. I think this is what you guys are looking for...

    Description.ext
    #define QUOTE(var1) #var1 class Extended_Init_EventHandlers { class CAManBase { init = QUOTE(_this call FUNC(handleKilled);); }; };

    'FUNC(handleKilled)' would be the function that would attach to units. That function would execute as soon as a unit spawns. There you can attach an event handler to the unit, i.e. "killed".

  8. How would this work in practice if you wanted to have, say, a 10 percent chance of finding Intel on a dead body, is there a layman's way to to do that? Sorry, I'm incredibly new to scripty type stuff

  9. @incontinenetia How would this work in practice if you wanted to have, say, a 10 percent chance of finding Intel on a dead body, is there a layman's way to to do that? Sorry, I'm incredibly new to scripty type stuff

    Yep. I have this exact question too.

    Thanks Dixon. I look forward to plugging this in. Just want to know what to expect.

  10. FUNC(handleKilled)

    _unit addEventHandler ["Killed",{
        if ((random 100) < 10) then { spawn intel on dead body with an addAction attach to the intel object };
    }];
  11. Change FUNC(handleKilled) to a file or function. I'm using FUNC from CBA macros.

  12. @dixon13 Change FUNC(handleKilled) to a file or function. I'm using FUNC from CBA macros.

    I'm not sure what this part means? Is the script above complete enough to copy/paste into the description.ext and have a 10% chance of gathering Intel? Or does it need further editing?

    And how do we "gather" the Intel exactly? Through a mousewheel scroll or something to that effect?

  13. Edited 8 years ago by HeroesandvillainsOS

    @dixon13 FUNC(handleKilled)
    #define QUOTE(var1) #var1 class Extended_Init_EventHandlers { class CAManBase { init = QUOTE(_this call FUNC(handleKilled);); }; }; _unit addEventHandler ["Killed",{ if ((random 100) < 10) then { spawn intel on dead body with an addAction attach to the intel object }; }];

    Like this in description.ext? Probably not because you same something needs to be changed but figured I'd ask.

  14. If I recall correctly, Hazey allowed for the function framework in his mission to be used in other missions. Would recommand reading over the license before doing so just in case.

  15. Edited 8 years ago by dixon13

    Description.ext

    class Extended_Init_EventHandlers { 
         class CAManBase { 
     		init = "_this call compile preprocessFileLineNumbers 'fnc_handleKilled.sqf'";
         }; 
    }; 

    init.sqf

    ["INS_HINT_EH",{params [["_text",""]]; hintSilent format["%1",_text]; }] call CBA_fnc_addEventHandler;

    fnc_handleKilled.sqf

    params[["_unit",objNull]];
    if ((side _unit == EAST) or (side _unit == RESISTANCE)) then { [_unit] call compile preprocessFileLineNumbers "fnc_intelHandler.sqf"; };

    fnc_intelHandler.sqf

    params ["_unit"]; 
    _unit addEventHandler["Killed", { 
    	params["_unit","_killer"]; 
    	if ((missionNamespace getVariable ["INS_DropRate",75]) > (random 100)) then { 
    		_pos = [_unit, (random 3), (random 360)] call BIS_fnc_relPos; 
                    _intelObject = "Land_Suitcase_F" createVehicle _pos; 
    		params[["_object",objNull]]; 
                    [-1, { 
    	        _this addAction ["<t color='#FF0000'>Pickup Intel</t>",{ 
    		/* somehow display intel from ALiVE Asymetric system haven't figured this out yet*/
    		deleteVehicle (_this select 0); 
    		if ((hasInterface) && !(isDedicated) && (local player) && (side player == WEST)) then { 
    			["INS_HINT_EH",[format["Intel has been found",]]] call CBA_fnc_globalEvent; 
    		}; 
    	}]; 
    }, _object] call CBA_fnc_globalExecute; 
    
    	}; 
    }]; 

    Wrote this up at work really quick so I hope it works. One problem is that I don't know anything about the Asymetric system and don't know how to integrate that into this set of scripts. I would have to tear the mod apart and figure that out. So for now all it would do is spawn intel, you pick it up, and that's it. No intel to display.

  16. Wrote this up at work really quick so I hope it works. One problem is that I don't know anything about the Asymetric system and don't know how to integrate that into this set of scripts. I would have to tear the mod apart and figure that out. So for now all it would do is spawn intel, you pick it up, and that's it. No intel to display.

    [_pos,_radius] call ALIVE_fnc_OPCOMToggleInstallations;

    That just displays all installations within the radius of the position. You could get trickier with it, but for a basic system it'll work

  17. For us complete scripting morons out there, how would you add the above into the script Dixon made? And which bits denote the key variables (Intel radius, drop chance etc)?

  18. Edited 8 years ago by SpyderBlack723

    You would replace the last section with this

    params ["_unit"]; 
    _unit addEventHandler["Killed", { 
    	params["_unit","_killer"]; 
    	if ((missionNamespace getVariable ["INS_DropRate",75]) > (random 100)) then { 
    		_pos = [_unit, (random 3), (random 360)] call BIS_fnc_relPos; 
                    _intelObject = "Land_Suitcase_F" createVehicle _pos; 
    		params[["_object",objNull]]; 
                    [-1, { 
    	        _this addAction ["<t color='#FF0000'>Pickup Intel</t>",{ 
    		_intel = _this select 0;
    		deleteVehicle _intel; 
    		[getPos _intel,2000] call ALIVE_fnc_OPCOMToggleInstallations;
    		if ((hasInterface) && !(isDedicated) && (local player) && (side player == WEST)) then { 
    			["INS_HINT_EH",[format["Intel has been found",]]] call CBA_fnc_globalEvent; 
    		}; 
    	}]; 
    }, _object] call CBA_fnc_globalExecute; 
    
    	}; 
    }];
  19. Spyder and Dixon, thank you both so much.

    Can't wait for your next iteration of Spyder addons by the way mate!

  20. Edited 8 years ago by HeroesandvillainsOS

    Wow. Thanks Dixon/Spyder! About to try it now.

    And which bits denote the key variables (Intel radius, drop chance etc)?

    Could I get some clarification on this part? I'd like to be able to know how to adjust the scripts' parameters if I find it necessary.

    I can't believe what you guys can cook up on the fly. It constantly amazes me.

  21. Newer ›
 

or Sign Up to reply!