SP teamswitching and AI CAS/Arty usage

  1. 8 years ago

    G'day,

    I've browsed the threads in here but yet haven't found an answer to the 2 issues I have:

    1. TEAMSWITCH ON ALL UNITS

    As I use ALIVE mostly for SP purposes, I am obviously heavily relying on respawn/team switch. I have tried the join group feature of the C2 tablet, but that makes you not part of the specific group but kinda "adds you on top", while you remain member of your old group ? Multispawn was said only to work in MP environment...
    Now I was wondering whether it would be possible to easily switch into any given group of one's faction (for example by adding a custom init line for all units using addswitchableunit or setplayable etc....) If that is not possible: how do you other guys get around in SP?

    2. AI COMMANDERS USING CAS
    (How) can one define how often (own and enemy) AI commanders use CAS or Arty? I have at least experienced one time that my own AI commander ordered an airstrike, but since then - never again...

    Thanks!

  2. For teamswitching, add this line to your description.ext

    description.ext

    class Extended_Init_EventHandlers {
    	class Man {
    		class ALiVETeamswitch {
    			init = "_this execVM 'addTeamswitchAction.sqf'";
    		};
    	};
    };

    Then create a file in the root of your mission folder named: addTeamswitchAction.sqf

    addTeamswitchAction.sqf

    params ["_unit"];
    
    if (side _unit == side player) then {
    	addSwitchableUnit _unit;
    };

    Note this will only work in SP since it uses the player's side to check if the unit is of the same. It can be easily adapted for use in MP if needed though.

  3. Works like a charm! Thank you for the quick help!

    Well, would you recommend me to play as singleplayer rather in multiplayer environment? The main benefit in doing so would be that I could properly save and continue the mission later on - correct? For this case, could you show me the "MP"-way of making teamswitch real?

    Another one in that context: I am using your recruitment script as well. I noted that the units I recruited were commandable, but not switchable/to be respawned into after death. I guess this functionality could be easily added in your next update.

    Do you have any idea on the 2nd issue (CAS)?

  4. Edited 8 years ago by SpyderBlack723

    CAS really just depends on how many air units are available. Most planes won't be of use as the AI suck at taking off. Helicopters should be called in every once in awhile but if they are taken out, they'll be gone until/if they get replaced by military logistics. You can try manually placing air units around the map and syncing them to the Virtual AI System module and seeing if that helps a bit.

    --

    The MP way of doing team switch is really simple. Replace the text in addTeamswitchAction.sqf with this

    params ["_unit"];
    _sidePlayer = WEST;
    
    if (side _unit == _sidePlayer) then {
    	addSwitchableUnit _unit;
    };

    You will just have to remember to change _sidePlayer to the side that you will be playing on. For example, if you are on the blufor side, change it to _sidePlayer = WEST;, opfor = EAST, and independant = GUER

    In theory, that unit spawn script should work fine. Are you using the mod or the script version. If the script version, can you pass it to me, because I deleted it :)

  5. Oh, that was really easy :-)

    Well, the AI needs to have proper airfields, otherwise they go anywhere (seen that quite often)..

    I use the addon version, so I will be of no help..sorry

  6. Here is a new version of the mod that will add recruited units to the team switch list

    https://www.dropbox.com/s/jimi8r2e51o6mhn/SpyderAddons_v0.4.1.zip?dl=0

    In the future there will be a module option to select whether or not they will be switchable, but for now it's automatic.

  7. Edited 8 years ago by ZeroG

    Uh, both solutions do work for me in SP, but not in MP - neither the addon, nor the changed script. Does it work on your side? Maybe you have a different multispawn setup/description.ext?

  8. Edited 8 years ago by SpyderBlack723

    Just realized, that's because in MP, teamswitch does not work unfortunately, you can try changing addTeamswitchAction.sqf to

    params ["_unit"];
    _sidePlayer = WEST;
    
    if (side _unit == _sidePlayer) then {
    	setPlayable _unit;
    };

    I can't guarantee that will work though.

  9. No, that also doesn't seem to work. BIKI says the command setplayable was broken anyway.
    Never mind for now, I got it working very well in SP - which was my initial wish.

 

or Sign Up to reply!