"Join Assault" script and other scripting

  1. 9 years ago

    Spyder,

    I just opened up the new ALiVE Stratis sample mission and discovered the "assault mission" script that allows you to jump into a combined arms assault that the AI commander is commanding.

    VERY COOL!!!

    I plan on adding this to all of my ALiVE missions. It's a welcome addition to use along with the other auto tasking feature.

    Other than the player unit line script, is anything else needed to use this in other missions?

    Any other add on scripts you could share?

  2. Edited 9 years ago by SpyderBlack723

    That one is actually straight off the wiki

    http://alivemod.com/wiki/index.php/Script_Snippets#Jump_To_The_Action.21

    Just add the third line posted to an object to get the same effect that is featured in the mission

    this addAction ["Select Assault Mission",{[_this select 1,"attacking"] call ALiVE_fnc_OPCOMJoinObjective},[],1,false,true,"","true"];

    Any other add on scripts you could share?

    Too many.. I'll see if I can scrounge through some missions and get some stuff together and maybe update a few things. I enjoy expanding my SQF knowledge which usually leaves me to make a ton of stuff for one mission, get bored and do it all over again with a new mission.

  3. Awesome. I look forward to seeing that.

  4. Edited 9 years ago by SpyderBlack723

    Alright let me take a trip down memory lane
    -------------------------------------------------------------
    I have ..

    - A VAS style save menu used for persistently saving/loading/loading gear on respawn. Basically VAS without being able to pick gear from the interface directly, a lite version I guess. VAS is dying off and BIS Arsenal doesn't provide "load gear on respawn" functionality. It also greys out loadouts with modded gear that is no longer being used.

    - An array system used to "save/load" specific objects for persistent use in between sessions. Using ALiVE_fnc_get/setData

    - A script to create an ALiVE recognized (AI will attack/defend) objective for use in dynamic objective creation (FOB) .. this may or may not still work based on ALiVE API changes.

    - A side mission framework to provide separate custom made side missions and let ALiVE provide the backdrop/populate the map. Tasks were fit to a certain mission style so I decided not to use C2ISTAR and just make a few of my own.

    - Simple halo script, Earplug script

    - Insurgent system that allows you to play as an insurgent. Start on a neutral side and then are switched to a hostile side when you commit a suspicious/violent action. This needs reworked, have learned a ton since writing it.

    - Trigger script that turns civilians inside it's radius to the enemy side to allows "base guards" to attack possible undercover insurgents

    - MHQ script that is attachable to a vehicle and adds a respawn point at it's position when deployed

    - Two "modules" where all you do is drop a folder in your mission file, and add a single line to your init.sqf and your mission will have random Shepherds (one module) and Call to prayer (second module). Call to prayer is the exact same one from Hazey's Insurgency redux but rigged to use a random location around all towns so it doesn't need any configuring for good results.

    Also a lot of little small stuff that's only relevant to the mission it was made for. If one looks interesting to you I can try and slide it your way.

  5. That sounds awesome.

    I'd use all of those.

    If you want, how about just creating a new thread topic titled "Useful Scripts, etc."?

    An example in the thread might be....

    Type: To achieve victory in an ALiVE battle by eliminating Enemy forces in Town A and Town B

    Action: 1. Create a Trigger

    1. In the Init line of the Trigger type "xyz"
    2. In the Activation line type "abc"

    Type: To create a Halo jump for your ALiVE players so they can instantly go into a section of the map

    Action: Choose an item from the empty section of the editor, blah blah blah

    Type: To allow your unit to join an already activated AI assault on a high priority objective

    Action: 1. In your player's init field and all other playable units init field type the following: (blah blah blah)
    2. In your init.sqf type "blah blah blah"

    I guarantee you that type of thread would be a tremendous asset for those of us who are super creative and love to design missions...but who are otherwise "slow" when it comes to deciphering the Bohemia script pages, etc.

    Clear concise "this is what Script A does and this is what you would use it for" followed by "step 1 do this, step 2 do this"

    No rush at all on this of course, but doing something like this similar to the Mission Templates, etc. would be a big help to a lot of folks I'm sure.

  6. We'll see, I'd have to get them in a releasable state since most of them are tied into my missions. I'll give it a shot.

  7. Friznit

    20 Jul 2015 Administrator

    Might be better to do this on a wiki page?

  8. Edited 9 years ago by SpyderBlack723

    Are you talking about tying it into the ALiVE wiki (similiar to the script snippets section) or just making a separate unrelated "repository" to hold all of the information in?

  9. Friznit

    20 Jul 2015 Administrator
    Edited 9 years ago by Friznit

    The former - add them to the script snippets or create a new page. It could use a tidy up and maybe an index page adding though. Just a suggestion!

  10. I'm down for it, if I can get it to a point where it's worth it.

  11. Edited 9 years ago by SpyderBlack723

    This was the easiest one to make into an easily install-able package so I guess I'll drop it here if you want it. Nothing fancy but it gets the job done in a very quick and perf-friendly fashion. I would recommend using it alongside BIS Arsenal for choosing your gear.

    https://www.dropbox.com/s/kp3zmkmly56m49r/SLO_Public_Release.zip?dl=0

    Installation instructions are inside if needed. It installs just like VAS.

  12. Thanks man,

    Here's a question for you...

    If I go into the Virtual Arsenaland make a bunch of different load outs, how can I customize the spawned in AI to use those particular load outs?

    Ie I make a bunch of snow gear for RHS Russians so they spawn in snow suits.

  13. Honestly, never used it so I have no idea. I'm guessing it exports the code to your notepad so that you can copy paste it into a units init line. I'll take a look at it real quick.

  14. Yeah that's how it works. I just didn't know if I could manipulate the spawned in factions via scripting

  15. That export feature on the VAS is a great feature. Copies the entire load out to a clipboard to paste into unit line.

    Could I paste that same info somewhere in the ALiVE script on a mission?

  16. Edited 9 years ago by SpyderBlack723

    You would have to do it using this method http://alivemod.com/wiki/index.php/Script_Snippets#Adding_Custom_Inits_to_Spawned_Units

    I'll do a quick example so you can see how it works.

    You would put this in the description.ext of your mission file

    class Extended_Init_EventHandlers {
     class Man {
      init = "_this call (compile preprocessFileLineNumbers 'customGear.sqf')";
     };
    };

    And then you will need to create a file called customGear.sqf in the root of your mission folder and put this inside

    private["_unit"];
    _unit = _this select 0;
    
    if (side _unit == east) then {
    	RemoveAllWeapons _unit;
    	{_unit removeMagazine _x} foreach (magazines _unit);
    	removeUniform _unit;
    	removeVest _unit;
    	removeBackpack _unit;
    	removeGoggles _unit;
    	removeHeadGear _unit;
    	removeAllAssignedItems _unit;
    
             //-- Place code under here
    
    };

    Basically, you take whatever code the export function from BIS Arsenal gives you and then paste it under the //-- Place code under here line. Then, everywhere you see this, you need to change it to _unit and they should spawn in with the gear.

  17. Very nice. When I get home from work, I'll give this a whirl and tell you how it works.

  18. So I tried it...and I got a bunch of guys spawning in their underwear. lol

    Here is exactly what I put in the sqf......

    private["_unit"];
    _unit = _this select 0;

    if (side _unit == east) then {
    RemoveAllWeapons _unit;
    {_unit removeMagazine _x} foreach (magazines _unit);
    removeUniform _unit;
    removeVest _unit;
    removeBackpack _unit;
    removeGoggles _unit;
    removeHeadGear _unit;
    removeAllAssignedItems _unit;

    comment "Add containers";
    this forceAddUniform "TRYK_U_B_PCUHsW6";
    for "_i" from 1 to 3 do {this addItemToUniform "30Rnd_mas_545x39_mag";};
    this addItemToUniform "15Rnd_mas_9x21_Mag";
    this addVest "TRYK_V_ArmorVest_Winter";
    this addItemToVest "FirstAidKit";
    for "_i" from 1 to 5 do {this addItemToVest "30Rnd_mas_545x39_mag";};
    for "_i" from 1 to 2 do {this addItemToVest "rhs_mag_rgd5";};
    this addItemToVest "SmokeShell";
    for "_i" from 1 to 2 do {this addItemToVest "15Rnd_mas_9x21_Mag";};
    this addHeadgear "H_mas_rus_helmet_ht_w";
    this addGoggles "TRYK_kio_balaclava_WH";

    comment "Add weapons";
    this addWeapon "arifle_mas_aks74";
    this addPrimaryWeaponItem "optic_mas_kobra";
    this addWeapon "hgun_mas_m9_F";

    comment "Add items";
    this linkItem "ItemCompass";
    this linkItem "ItemWatch";
    this linkItem "tf_anprc152_2";

    comment "Set identity";
    this setFace "GreekHead_A3_01";
    this setSpeaker "rhs_Male01RUS";

    };

  19. Edited 9 years ago by SpyderBlack723

    You just have to change every this to _unit

    For example

    private["_unit"];
    _unit = _this select 0;
    
    if (side _unit == east) then {
    //-- Strip unit down
        RemoveAllWeapons _unit;
        {_unit removeMagazine _x} foreach (magazines _unit);
        removeUniform _unit;
        removeVest _unit;
        removeBackpack _unit;
        removeGoggles _unit;
        removeHeadGear _unit;
        removeAllAssignedItems _unit;
    //-- Add Gear
        _unit forceAddUniform "TRYK_U_B_PCUHsW6";
        for "_i" from 1 to 3 do {_unit addItemToUniform "30Rnd_mas_545x39_mag"};
        _unit addItemToUniform "15Rnd_mas_9x21_Mag";
        _unit addVest "TRYK_V_ArmorVest_Winter";
        _unit addItemToVest "FirstAidKit";
        for "_i" from 1 to 5 do {_unit addItemToVest "30Rnd_mas_545x39_mag"};
        for "_i" from 1 to 2 do {_unit addItemToVest "rhs_mag_rgd5";};
        _unit addItemToVest "SmokeShell";
        for "_i" from 1 to 2 do {_unit addItemToVest "15Rnd_mas_9x21_Mag"};
        _unit addHeadgear "H_mas_rus_helmet_ht_w";
        _unit addGoggles "TRYK_kio_balaclava_WH";
    
        _unit addWeapon "arifle_mas_aks74";
        _unit addPrimaryWeaponItem "optic_mas_kobra";
        _unit addWeapon "hgun_mas_m9_F";
        
        _unit linkItem "ItemCompass";
        _unit linkItem "ItemWatch";
        _unit linkItem "tf_anprc152_2";
        
        _unit setFace "GreekHead_A3_01";
        _unit setSpeaker "rhs_Male01RUS";
  20. Gotcha.

    I created about 12 different winter variants...some with hoods, some with skull caps, etc.

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

  21. Newer ›
 

or Sign Up to reply!