Jump to content

dreadpirate

Member
  • Content Count

    537
  • Joined

  • Last visited

  • Medals

Posts posted by dreadpirate


  1. My mistake, try this:

    [] spawn {
        for "_i" from 0 to 1000 do {
                _spawnpos = getMarkerPos "respawn_east";
                _spawnpos = [_spawnpos, 1, 20, 3, 0, 20, 0] call BIS_fnc_findSafePos;
                _grp = [_spawnpos, EAST, (configfile >> "CfgGroups" >> "East" >> "OPF_F" >> "Infantry" >> "OIA_InfTeam"),[],[],[0.25,0.4]] call BIS_fnc_spawnGroup; 
                {
                    removeAllAssignedItems _x;
                    removeAllWeapons _x;
                    removeAllContainers _x;
    		_x addUniform "U_O_CombatUniform_ocamo";
                    _x addVest "V_BandollierB_khk";
                    _x addMagazines ["30Rnd_65x39_caseless_green", 3];
                    _x addWeapon "arifle_Katiba_F";
                } forEach (	units _grp);
                _wp = _grp addWaypoint [getMarkerPos "moveMarker_east", 0];
                _wp setWaypointType "SEARCHANDDESTROY";
                _wp setWaypointSpeed "FULL";
                sleep 60;
        };
    };

     


  2. [] spawn {
        for "_i" from 0 to 1000 do {
                _spawnpos = getMarkerPos "respawn_east";
                _spawnpos = [_spawnpos, 1, 20, 3, 0, 20, 0] call BIS_fnc_findSafePos;
                _grp = [_spawnpos, EAST, (configfile >> ""CfgGroups"" >> ""East"" >> ""OPF_F"" >> ""infantry"" >> ""OIA_InfTeam""),[],[],[0.25,0.4]] call BIS_fnc_spawnGroup; 
                {
                    removeAllAssignedItems _x;
                    removeAllWeapons _x;
                    removeAllContainers _x;
                    _x addVest "V_BandollierB_khk";
                    _x addMagazines ["30Rnd_65x39_caseless_green", 3];
                    _x addWeapon "arifle_Khaybar_F";
                } forEach (	units _grp);
                _wp = _grp addWaypoint [getMarkerPos "moveMarker_east", 0];
                _wp setWaypointType "SEARCHANDDESTROY";
                _wp setWaypointSpeed "FULL";
                sleep 60;
        };
    };

    _x is a "magic" variable that is used inside a forEach loop. So the first time the loop runs, it edits the first unit of the group, the second time the loop runs, it edits the second unit of the group and so on.....

     


  3. A quick update:

     

    I have "reduce to leader" working for infantry only groups, just need to work on vehicles.

    At present, it just hides and disables simulation on units, rather than completely despawning them. Not sure if that's the best way or not.

    When they are activated, the other group members just teleport to the leader, which complicates things for vehicles.

     

    I've made it so vehicles in groups respawn in their editor positions to avoid collisions (um, reduce collisions, it's still Arma).

    However, that conflicts with "RESPAWNMARKERS=", so I'm still looking for a solution I'm happy with.

     

    • Like 1

  4. Just now, HeroesandvillainsOS said:

    Thanks I'll take a look. I appreciate it but I think I must be confusing you guys with my question. I don't need anything fancy, or need the player unit to be something specific. I just want to the player unit to spawn the same way the AI units do. They don't need any special codes so I don't understand why being the player makes the process different.

    AFAIK, the profile identity always overwrites the editor identity, so you'll probably need to do it this way.....


  5. Here's a demo mission that makes a BLUFOR unit look and sound like a CSAT unit.

     

    Check out the description.ext and the init line of the unit.

     

    It turns out you do need to setIdentity again on respawn, which is what the onPlayerRespawn.sqf does

     

    https://drive.google.com/open?id=0B-gOD7yyJ9VJYmhhU2lCNWNmcTg

     

    Look at all the identity options here:

     

    https://community.bistudio.com/wiki/setIdentity

     

    If you're using mods with different faces and voices, you'll have to find the classnames.....


  6. 26 minutes ago, HeroesandvillainsOS said:

    Ugh. I think I'm misunderstanding you. Faces have classnames? I just want to look like the unit classname. I'm sorry man but the wiki confuses me and an example of written functioning code would help me a lot.

     

    You need to set an identity in your description.ext

     

    https://community.bistudio.com/wiki/Description.ext#CfgIdentities

     

    and then, in the player's init:

     

    this setIdentity "myIdentity";

     

    You might need to set the identity again if you respawn, not sure.....


  7. 54 minutes ago, Mr. Birdman said:

    @ dreadpirate Working great with UPS  however can't get UPMONS to work now. Do you see any errors and does your script work with UPMONS ?

     

    0 = [this,"DELAY=",300,"LIVES=",3,"INIT=","[_proxyThis,'UPSwater1'] execVM 'scripts\upsmon.sqf'"] execVM "Jebus.sqf";

     

    Remember that for UPSMON, you have to add some lines to your init.sqf

    Quote

    //Init UPSMON script
    call compile preprocessFileLineNumbers "scripts\Init_UPSMON.sqf";

    I got it working on land, but I assume from your marker name you're using it on water?

    When I used it with a boat, it spawned but just sat there.

    When I used debug it said "MON_disembark started".

     

     

    11 hours ago, Imperator[TFD] said:

    Caching all but the leader would be amazing as it would still allow random patrol scripts and functions to execute.

     

    Yeah, I'll work on this for the next version.

    • Like 2

  8. 38 minutes ago, Mr. Birdman said:

    attempted to use   0 = [this,  "INIT=", "[_proxyThis, 'upswater1] execVM 'UPS.sqf'"] execVM "Jebus.sqf";

     

     

    the boat will not move to upswater1. I put the code in the leader init and have the boat trigger. The boat spawns in but only sits a the spawn in site not movement towards the zone. help.

    You are missing a single quote after upswater1

     

     


  9. 4 hours ago, Imperator[TFD] said:

    Hey dreadpirate, sorry if this has been asked before but does the caching component of this script cache all units in a group?

    Or does it leave the leader active so that the group can continue on a patrol or other activity?

     

    Current version just caches everyone, but I've had requests to implement "reduce to leader" instead and I can definitely see the merits of it.

     

    Just gotta get my coding mojo back.....

    • Like 1

  10. 2 hours ago, WurschtBanane said:

    Now i am using the SU-35 mod, and i asked the developer of it. He said the only way to remove a respawing SU-35s CAS capabilities is by putting

    T = [this] spawn {  
      sleep 1; 
      params ["_plane"]; 
      _plane removeWeapon "js_w_su35_kh29Launcher"; _plane removeWeapon "js_w_su35_s8Laucher";
     };

    Into its init.

    I tried putting it into your INIT= param, but it did not seem to work... should it? The classnames are correct btw.

     

    EDIT: Also, planes with the FLYING attribute are only flying at 200m. Can that be changed?

     

    Try:

     

    0 = [this, "FLYING", "INIT=", "T = [_proxyThis] spawn {    sleep 1;   params ['_plane'];   _plane removeWeapon 'js_w_su35_kh29Launcher'; _plane removeWeapon 'js_w_su35_s8Laucher'; }; "] execVM "Jebus.sqf";

     

    The flyInHeight script command doesn't seem to work properly, I'll see what I can come up with.....

     


  11. 3 hours ago, WurschtBanane said:

    I want to sync a F-18 loadout module with a respawning F-18 so it never has AGMS. I also want to hide friendly ground vehicles from it, as it would attack them with the gun otherwise.

     

    What code are you using to hide vehicles from the F-18?

     

    Which F-18 mod are you using?

     

    It seems that the easiest way to do this would be:

     

    0 = [this, "FLYING", "INIT=", "[_proxyThis] execVM 'initF18.sqf' "] execVM "Jebus.sqf";

     

    and then having a "initF18.sqf" file that would remove the default loadout, add your preferred loadout and run your hide vehicles code.....

    • Like 1

  12. 18 hours ago, WurschtBanane said:

    For example: I want to remove all anti-ground missiles from a jet and maybe use some kind of command in its init to hide objects from it so it does not attack ground targets.

     

    To remove bombs and air-to-ground missiles from CAS Buzzard:

    0 = [this, "FLYING", "INIT=", "{(vehicle _proxyThis) removeWeapon _x} forEach ['missiles_SCALPEL', 'GBU12BombLauncher_Plane_Fighter_03_F'];"] execVM "Jebus.sqf";

     

    (Note how I use single quotes around the weapon classnames. It won't work otherwise)

     

    18 hours ago, WurschtBanane said:

    Could you please try to work on this? I would be fine if atleast the synchings with objects/modules dont get deleted when the unit spawns/respawns.

    Which modules did you have in mind? I will see what is possible.....


  13. 3 hours ago, Catchdog64 said:

    Figured it out. Units in the composition have to be survivors instead of a standard unit in order to retain custom loadout.

    Glad you got it working, but I have custom loadouts working on all unit types, so something is still not quite right.

     

    I'll add some more detailed debugging info in the next version, so I can hopefully pick up any lingering bugs.....

×