"Join Assault" script and other scripting

  1. ‹ Older
  2. 9 years ago

    I have another question Spyder....

    Would it be possible to "build in" the "join assault" option into the default ALiVE scripting?

    So essentially...if I'm running an ALiVE mission I would have the auto tasking feature AND I could go to my scroll wheel at anytime and join an AI assault as well?

    Perhaps added in with ALiVE version 1.0?

    Just curious. I'm sure a lot of folks would enjoy that. It's a small tweak but very cool to just have your squad jump in with a full scale assault on an objective at anytime, regardless of what is going on with auto tasking.

  3. Edited 9 years ago by SpyderBlack723

    How would I go about adding multiple variants in the code?

    If you can get me the classnames, I can do it for you. Not too difficult. You could just define arrays of gear classnames and then pick one randomly, and assign it to the unit..

    _uniform = ["TRYK_U_B_PCUHsW6","classname2","classname3","andon..","","","",""] call BIS_fnc_selectRandom;

    You would do that for every piece of gear you want to add and then you add it down below like so

    _unit addUniform _uniform;

    It will add the randomly selected uniform from the array and add it to the unit. It's a boring process but it works pretty well. If you wanted to only have certain uniforms with certain weapons/backpacks, you could do it, but prepared to make some very long files.

    Would it be possible to "build in" the "join assault" option into the default ALiVE scripting?

    That's not up to me, you can either put up a feature request ticket here or hope someone sees your request in this thread.

  4. I'm at work but the classnames I'm modifying are the RH Escalation Russian MSV Infantry Flora troops. It really doesn't matter if its the MSV or VDV Russian troops because I'll be stripping them of their equipment, but it's the standard infantry in the MSV unit that I have in my mission right now.

    Thanks man.

  5. Classnames for the equipment right? I'll get that to you. Thanks man.

  6. Yeah just like the one you posted, just get the export code and paste them into a pastebin or something and link it. Make sure they are separated so you can tell where one ends and the next begins.

  7. I'll send it to you when I leave the office today. Thanks man.

    Side note: I was in Chicago just a few weeks ago for work. Saw you were from Illinois.

  8. Edited 9 years ago by SpyderBlack723

    Alright, decided it's probably easier to do it the long way because of the way BIS Arsenal exports classes.

    In the init.sqf you'll need to put something like this

    call compile preprocessFile "loadouts.sqf";

    Then you'll need a file in the root of your mission folder called

    loadouts.sqf

    Inside that file you will put..

    placeholder I'll finish that once you pass me the exported code for each class

    Using the customGear.sqf file you made earlier, you'll need to switch the code to reflect this

    private["_unit"];
    _unit = _this select 0;
    
    _loadout = [loadout_fnc_1,loadout_fnc_2,loadout_fnc_3,loadout_fnc_4,loadout_fnc_5,loadout_fnc_6,loadout_fnc_7,loadout_fnc_8,loadout_fnc_9,loadout_fnc_10,loadout_fnc_11,loadout_fnc_12] call BIS_fnc_selectRandom;
    
    if (side _unit == east) then {
    	//-- Remove unit's current gear
    	RemoveAllWeapons _unit;
    	{_unit removeMagazine _x} foreach (magazines _unit);
    	removeUniform _unit;
    	removeVest _unit;
    	removeBackpack _unit;
    	removeGoggles _unit;
    	removeHeadGear _unit;
    	removeAllAssignedItems _unit;
    	//-- Call the randomly selected function to add the custom gear
    	_unit call _loadout;
    };

    ----

    Side note: I was in Chicago just a few weeks ago for work. Saw you were from Illinois.

    Yeah I'm about two hours south of Chicago

  9. Test

  10. Edited 9 years ago by SpyderBlack723

    Confirmation (Just hit reload page it it's struggling and it will post)

  11. Well this is bizarre...It says I've posted my loadout reply but I can't see it here in the thread.

  12. It refuses to post my reply on here. Is it too long? These short replies are posting instantly...no sign of my loadout reply at all.

  13. Just paste it into a pastebin.com and hit submit, and drop the link

  14. http://pastebin.com/XKychxT6

    *note* I sent it via PM to your Bohemia user as well.

    Some of the backpacks were bugged and automatically gave my Russians some Stinger and NLAW rockets. You can ignore those.

    Thanks a ton man for the help.

  15. Edited 9 years ago by SpyderBlack723

    Some of the backpacks were bugged and automatically gave my Russians some Stinger and NLAW rockets. You can ignore those...

    Probably a pre-packed backpack. Meaning that they automatically come with items. You can get around it if necessary. I'll try to edit that real quick and post it back, leaving in like 5 min. Time is of the essence!

  16. Edited 9 years ago by SpyderBlack723

    Ok here we go

    Put this in your init.sqf

    call compile preprocessFile "loadouts.sqf";

    Paste all of this into a file called loadouts.sqf (put in the root of your mission folder)
    http://pastebin.com/DjaAhdcc

    Finally, in your customGear.sqf that we used to apply code to all units of side east, change it to this

    private["_unit"];
    _unit = _this select 0;
    
    _loadout = [loadout_fnc_1,loadout_fnc_2,loadout_fnc_3,loadout_fnc_4,loadout_fnc_5,loadout_fnc_6,loadout_fnc_7,loadout_fnc_8,loadout_fnc_9,loadout_fnc_10,loadout_fnc_11,loadout_fnc_12] call BIS_fnc_selectRandom;
    
    if (side _unit == east) then {
    	//-- Call the randomly selected function to add the custom gear
    	[_unit] call _loadout;
    };

    Hopefully that will work, if not I'll be back later with more time to check it more thoroughly.

  17. Dude, it works and it's AMAZING.

    Now I can run completely "Arctic inspired" missions with ease against the Russians.

    You are the man.

    I'll post my missions on here when I'm done tweaking them.

  18. Glad it worked, have fun

  19. Spyder,

    Could I do something similar w Civillians?

    There aren't any good European Civ mods. If I took the time to create a bunch of civ load outs in the arsenal and exported, would it spawn the Civ_F Civs in that custom gear?

    Then I could save that script and paste it into any European setting I wanted to.

  20. Edited 9 years ago by SpyderBlack723

    You could do it yes, you would just do if (side _unit == civilian) then {}; at the top to filter out for civilians.

    There aren't any good European Civ mods

    Might want to check out RDS civilian pack, haven't used it personally for myself but it ports Arma 2 civilians/vehicles and looks pretty nice.

    EDIT:
    http://pastebin.com/FZNqu0sa
    European civilians (Requires TYRK gear and Army of the Czech Republic mods) thanks to AUTigerGrad, implemented the same way as above but instead with..

    _civLoadout = [civLoadout_fnc_1,civLoadout_fnc_2,civLoadout_fnc_3,civLoadout_fnc_4,civLoadout_fnc_5,civLoadout_fnc_6,civLoadout_fnc_7,civLoadout_fnc_8,civLoadout_fnc_9,civLoadout_fnc_10,civLoadout_fnc_11,civLoadout_fnc_12,civLoadout_fnc_13,civLoadout_fnc_14,civLoadout_fnc_15,civLoadout_fnc_16] call BIS_fnc_selectRandom;
    
    
    if (side _unit == civilian) then {
    	[_unit] call _civLoadout;
    };

    Functions from pastebin file must be defined in loadouts.sqf and called from the init.sqf using

    call compile preprocessFile "loadouts.sqf";
  21. Edited 9 years ago by SpyderBlack723

    Actually got around to doing something that might be useful to any other scripters wanting to do stuff with ALiVE. Wanted to spice up some conventional missions so I dove into trying to mix my scripts into ALiVE's objective system so I could make things like counterattacks and reinforcements when objectives were being attacked/lost (ALiVE does this already but I was going to do some special stuff like paratroopers). Only have two functions right now but I am definitely gonna make more if possible since this is only the beginning of my project. Hopefully these functions don't already exist somewhere, otherwise I wasted my time :|

    Anyone who is interested in this type of stuff should also look into a few functions Cameroon made awhile ago.

    1. Get's all opcoms that control any of the passed factions

    ["OPF_F"] call Spyder_fnc_getFactionOpcoms;

    returns an array [_opcom,[_factions]] in which _opcom is the logic itself and _faction is an array of the factions that it controls that were picked from the array that was passed into the function (To provide more accurate results if an opcom controls multiple factions). If the opcom controls a single faction, _faction is structured as ["EAST"], if it controls multiple then it is structured as ["EAST","WEST"].

    Spyder_fnc_getFactionOpcoms = {
    	_factions = _this;
    	_result = [];
    	{
    		_opcom = _x;
    		_factionGroup = [];
    		_opcomFactions = [_opcom,"factions",[]] call ALiVE_fnc_HashGet;
    		{
    			_faction = _x;
    			if (_faction in _factions) then {
    				_factionGroup pushBack _faction;
    			};
    		} forEach _opcomFactions;
    		_data = [_opcom,_factionGroup];
    		_result pushBack _data;
    	} foreach OPCOM_instances;
    _result;
    };

    2. Get's all opcoms that control any of the passed sides

    ["EAST"] call Spyder_fnc_getSideOpcoms;

    Returns all opcoms that control any of the sides that were passed into the function.. [_opcom,_side]

    Spyder_fnc_getSideOpcoms = {
    	_sides = _this;
    	_result = [];
    	{
    		_opcom = _x;
    		_opcomSide = [_opcom,"side",""] call ALiVE_fnc_HashGet;
    		if (_opcomSide in _sides) then {
    			_data = [_opcom,_side];
    			_result pushBack _data;
    		};
    	} foreach OPCOM_instances;
    _result;
    };
  22. Newer ›
 

or Sign Up to reply!