Jump to content

splatsh

Member
  • Content Count

    123
  • Joined

  • Last visited

  • Medals

Posts posted by splatsh


  1. Hi all.

    I wonder if I can make one code like they have in OFP Dragon Rising.

    Its checks if I am a player or a AI in my squad.

    Like this:

    I make a squad with 5 playable players.

    If I play mission alone, then this code removes the other 4 AI players.

    And if I am playing with one other friend of my, then the code is removing the other 3 AI players, and so on...

    So can it be done with one .sqf file?

    How?

    Thanks


  2. I am using ACE and ACEX

    And I have this now:

    ; Get the unit parameter given
    _unit = _this select 0
    
    ; Strip the units current gear
    removeAllWeapons _unit
    
    ; Add the new gear to the unit
    _unit addweapon "ACE_VTAC_RUSH72";
    _unit addWeapon "NVGoggles"; 
    _unit addWeapon "Laserdesignator";  
    _unit addweapon "ACE_HuntIR_monitor";
    
    ; Add weapon to the unit
    _unit addweapon "ACE_M4A1_ACOG";
    
    ; Add ammo to the unit
    _unit addMagazine "30Rnd_556x45_Stanag";
    _unit addMagazine "30Rnd_556x45_Stanag";
    _unit addMagazine "30Rnd_556x45_Stanag";
    _unit addMagazine "30Rnd_556x45_Stanag";
    _unit addMagazine "30Rnd_556x45_Stanag";
    _unit addMagazine "30Rnd_556x45_Stanag";
    _unit addMagazine "ACE_5Rnd_127x99_T_TAC50";
    _unit addMagazine "ACE_5Rnd_127x99_T_TAC50";
    _unit addMagazine "ACE_5Rnd_127x99_T_TAC50";
    
    ; Add select weapon
    _unit selectWeapon "ACE_M4A1_ACOG"
    
    ; Put stuff in the backpack/Rucksack
    [_unit, "ACE_Battery_Rangefinder", 1] call ACE_Sys_Ruck_fnc_AddMagToRuck; 
    [_unit, "30Rnd_556x45_Stanag", 10] call ACE_Sys_Ruck_fnc_AddMagToRuck; 
    [_unit, "ACE_HuntIR_M203", 8] call ACE_Sys_Ruck_fnc_AddMagToRuck; 
    [_unit, "pipebomb", 3] call ACE_Sys_Ruck_fnc_AddMagToRuck;  
    [_unit, "SmokeShell", 5] call ACE_Sys_Ruck_fnc_AddMagToRuck;
    [_unit, "ACE_5Rnd_127x99_T_TAC50", 10] call ACE_Sys_Ruck_fnc_AddMagToRuck;
    [_unit, "Laserbatteries", 2] call ACE_Sys_Ruck_fnc_AddMagToRuck;
    Exit
    

    My first question is:

    How do I get a weapon on back? (NOT Rucksack)

    If u start game, u can have one weapon selected, and one weapon on back, then u can swap weapons. But how do I put a weapon on back from code and from my .sqs file?

    My second question is:

    How do I config so my units dont use the new stamina system?


  3. I have put a SecOps module on map, later on I sync it with player with this:

    SOM synchronizeobjectsadd [p0];
    

    Then I want to get my tactical airstrike automatic, and not trough a trigger radio button.

    [["tactical_airstrike"], player] call BIS_SOM_addSupportRequestFunc;

    How to activate it in my .sqf file?

    I have try this:

    
    SOM synchronizeobjectsadd [p0];
    [["tactical_airstrike"], player] call BIS_SOM_addSupportRequestFunc;
    

    and this

    SOM synchronizeobjectsadd [p0];
    [[""tactical_airstrike""], player] call BIS_SOM_addSupportRequestFunc;
    

    nothing works

    ---------- Post added at 11:56 AM ---------- Previous post was at 10:50 AM ----------

    Question 2, just in case of no one answer my first question

    why is not this working

    _trg = createTrigger["EmptyDetector",getPos player];
    _trg setTriggerArea[0,0,0,false];
    _trg setTriggerActivation["ALPHA","PRESENT",true];
    _trg setTriggerStatements["this", "[""tactical_airstrike""], player] call BIS_SOM_addSupportRequestFunc;", ""]; 
    

    If I create a trigger in editor with the same data it will work, why cant I create a trigger by code and get it to work??????????

    Working: _trg setTriggerStatements["this", "[[""tactical_airstrike""], player] call BIS_SOM_addSupportRequestFunc;", ""];

    I missed a "[" at the beginning.


  4. Thanks, this is the way, but need to check over it.

    When I run this code for testing with a trigger the whole game is freezing and then craching.

    I have copied your code.

    // check_squad.sqf
    
    _array = [P1, P2, P3, P4];
    
    for [{_i=0}, {_i < count _array}, {_i=_i+1}] do {
    
    if (!(alive (_array select _i))) then {
    
    	(_array select _i) execVM squad\create.sqf
    
    };
    
    };
    

    // create.sqf
    
    switch (_this) do {
    case "P1": {_UnitType = "FR_Cooper"};
    case "P2": {_UnitType = "FR_Sykes"};
    case "P3": {_UnitType = "FR_Rodriguez"};
    case "P4": {_UnitType = "FR_OHara"};
    };
    
    _unit = _UnitType createUnit [getMarkerPos "spawn",group player];
    

    I am going too look and try to get it to work, but I cant code this so good, so thanks I am going to need some help.

    ---------- Post added at 11:19 AM ---------- Previous post was at 10:03 AM ----------

    I need more help with that...

    I need to name every unit to its name it have, and get the gear they have.

    for example:

    FR_cooper

    name: p1

    init field: [this] exec "gear\p1.sqs"

    Then I need every unit to join player as soon as possible.

    If I do it manualy for one man it look like this:

    _this = createCenter west;
    _center_0 = _this;
    _group_0 = createGroup _center_0;
    
    _this = _group_0 createUnit ["FR_Cooper", [(getMarkerPos "squad_spawn") select 0,(getMarkerPos "squad_spawn") select 1,10], [], 3, "FORM"];
    _this setVehicleInit "[this] exec ""gear\p1.sqs""";
    _this setVehicleVarName "p1";
    p1 = _this;
    [p1] join player;
    

    So how to get in all that for every squad member (p1, p2, p3, p4) in this "case" thing you have, and if 2 squad members is dead, do I get 2 men then?


  5. Can someone give me a bit of code to check if all in my Razor Team is alive, and if one of them is dead, then a replacement men (Of the same kind of the dead one)

    I have named them p0, p1, p2, p3, p4, p5.

    I could do this???

    // check_squad.sqf
    
    if (!(alive p1)) then
    {
       //Create p1 men;
       server execVM "squad\create_p1.sqf"
    }
    else
    {
       // NOTHING;
    };
    
    if (!(alive p2)) then
    {
       //Create p2 men;
       server execVM "squad\create_p2.sqf"
    }
    else
    {
       // NOTHING;
    };
    
    if (!(alive p3)) then
    {
       //Create p3 men;
       server execVM "squad\create_p3.sqf"
    }
    else
    {
       // NOTHING;
    };
    
    if (!(alive p4)) then
    {
       //Create p4 men;
       server execVM "squad\create_p4.sqf"
    }
    else
    {
       // NOTHING;
    };
    
    if (!(alive p5)) then
    {
       //Create p5 men;
       server execVM "squad\create_p5.sqf"
    }
    else
    {
       // NOTHING;
    };
    

    I dont have any check on p0, that is the player, and when he dies, the game is over...

    Then I run this code above once I have completed a task

    when completed, then run "check_squad.sqf"

    Or how can I do it in a better way?


  6. Place a C-130 on map, name it C1.

    call this code [C1,"<Name on what you whant>"] call BIS_fnc_supplyDrop;

    Example:

    [C1,"HMMWV_Armored"] call BIS_fnc_supplyDrop;

    [C1,"AAV"] call BIS_fnc_supplyDrop;

    [C1,"LAV25"] call BIS_fnc_supplyDrop;

    [C1,"LAV25_HQ"] call BIS_fnc_supplyDrop;

    [C1,"M1A1"] call BIS_fnc_supplyDrop;

    [C1,"M1A2_TUSK_MG"] call BIS_fnc_supplyDrop;

    [C1,"USBasicAmmunitionBox"] call BIS_fnc_supplyDrop;

    And so on...

    When I did this I have a code for call out plane in air, and make pilots, and then a waypoint, then in activation on waypoint I use code for call my drop with what I wanted.

    Oh, here is all my code... I was using marker at this one to... see code.

    _this = createCenter west;
    _center_0 = _this;
    
    
     _this = createVehicle ["C130J", [18337.4, 11268.2,150.6127], [], 0, "FLY"];
     _vehicle_1 = _this;
     _this setVehicleVarName "C1";
     C1 = _this;
    
    
    _group_1 = createGroup _center_0;
     _this = _group_1 createUnit ["USMC_Soldier_Pilot", [18337.4, 11268.2,150.6127], [], 0, "FORM"];
     _unit_1 = _this;
     if (true) then {_group_1 selectLeader _this;};
     _this moveInDriver _vehicle_1;
     _this flyInHeight 250;
    
    
    C1 move (markerPos "M1");
    C1 flyInHeight 250;
    C1 setspeedmode "FULL";
    
    _this = createTrigger ["EmptyDetector", [0,0,0]];
    _this setTriggerArea [0, 0, 0, true];
    _this setTriggerActivation ["NONE", "PRESENT", false];
    _this setTriggerStatements ["C1 distance (markerPos ""M1"")<= 275;", "[C1,""HMMWV_Armored""] call BIS_fnc_supplyDrop;", ""];
    _trigger_0 = _this;
    
    
    // Supply drop # 2
    
    sleep 5;
    
    
     _this = createVehicle ["C130J", [18337.4, 11268.2,150.6127], [], 0, "FLY"];
     _vehicle_2 = _this;
     _this setVehicleVarName "C2";
     C2 = _this;
    
    
    _group_2 = createGroup _center_0;
     _this = _group_2 createUnit ["USMC_Soldier_Pilot", [18337.4, 11268.2,150.6127], [], 0, "FORM"];
     _unit_2 = _this;
     if (true) then {_group_2 selectLeader _this;};
     _this moveInDriver _vehicle_2;
     _this flyInHeight 250;
    
    
    C2 move (markerPos "M1");
    C2 setspeedmode "FULL";
    C2 flyInHeight 250;
    
    _this = createTrigger ["EmptyDetector", [0,0,0]];
    _this setTriggerArea [0, 0, 0, true];
    _this setTriggerActivation ["NONE", "PRESENT", false];
    _this setTriggerStatements ["C2 distance (markerPos ""M1"")<= 275;", "[C2,""USOrdnanceBox""] call BIS_fnc_supplyDrop;", ""];
    _trigger_1 = _this;
    
    
    
    (driver _vehicle_1)  sideChat "This is eagle one, we are inbound with your supply drop, please stand by at the new base";
    
    //// Then make a final waypoint with delet all plane and pilots in activation.
    
    


  7. I have this:

    SOM module, in init field:

    this setVariable ["settings", [[], true, nil, nil, false]];
    

    Then I got triggers, in activationfield Alpha to Delta:

    Tactical Airstrike:

    [["tactical_airstrike"], player] call BIS_SOM_addSupportRequestFunc;

    Supply Drop

    [["supply_drop"], player] call BIS_SOM_addSupportRequestFunc;

    Transport:

    [["transport"], player] call BIS_SOM_addSupportRequestFunc;

    Arillery:

    [["artillery_barrage"], player] call BIS_SOM_addSupportRequestFunc;

    Now, all this is working fine, works perfect.

    Question:

    If you play map with a som module that are default and no code in init and so on, you get missions then and then, right.

    If one of your player get killed, you will get a reinforce to replace that killed man in your squad, right.

    Now, how to put out only that request?

    This is NOT working:

    [["reinforce"], player] call BIS_SOM_addSupportRequestFunc;

    Like the other this is not working, how do I get autoreinforce to work?

    Thanks


  8. Ok, I got this revive to work now.

    And I am using default settings right now.

    So how can I get revive to work with one edited map with one player (me)

    And later I get my squad by script:

    _pos = position player;
    //////////////////////////////////////////////////////////////////////////////////////////////////////
    // Create _group_3
    
    _group_3 = createGroup _center_0;
    _this = _group_3 createUnit ["FR_OHara", _pos, [], 0, "FORM"];
     _unit_5 = _this;
     _this setVehicleVarName "s2";
     s2 = _unit_5;
     _this setUnitAbility 0.60000002;
    
    _this = _group_3 createUnit ["FR_Miles", _pos, [], 0, "FORM"];
     _unit_6 = _this;
     _this setVehicleVarName "s3";
     s3 = _unit_6;
     _this setUnitAbility 0.60000002;
    
    _this = _group_3 createUnit ["FR_Rodriguez", _pos, [], 0, "FORM"];
     _unit_7 = _this;
     _this setVehicleVarName "s4";
     s4 = _unit_7;
     _this setUnitAbility 0.60000002;
    
     [s2,s3,s4] join player;
    

    Now, how to setup "revive_init.sqf" and "description.ext" to get rivive function to work. Now it does not working with default settings.

    I need to get revive to working on singleplayer. And work with my team that is spawning later in game.

    How to?


  9. I am playing and make some small missions for my self.

    Now.... I have search and look for hours now.

    Spent entire night for this to work... But it does not work for me.

    I want:

    1) To respawn.

    2) Able to respawn at a vehicle, lets say a LAV25_HQ car. (That I or someone in my squad are moving around from time to time.)

    So a mobile respawn is what I need.

    3) When I die, or someone in my squad (4-5 AI) I want to autojoin my group, and I, the player ar leader of team, then I want to respawn as a leader of my squad.

    Please give me some right stuff that works. I dont need to spend more hours on Bohemias forum on this spawn thing.

    Thanks :D


  10. Ok finally figured out how to make it only revive and its so simple I could kick myself :o just make the number of available respawn points =0 in the config

    Also there is a Mobile HQ Respawn built into the script, actually reading the PDF in more detail explained how to set it up as a replacement for the mobile mash tent deployed from the squad leader.

    The only thing is does is leave a dead wreck on the map from when its destroyed. Not sure what the best way is to police these, will the garbage module delete these? Previously I used the rather nice simple vehicle respawn script that removed the wreck when the vehicle respawned, not seen that option in the revive script yet unless I missed it :confused:

    By the way what a fantastic bit of scripting :yay:

    Are you talking about this script or do you talk about something built ingame?

    And if you know stuff, please do let us know how and what you are doing.

    ---------- Post added at 10:37 PM ---------- Previous post was at 10:32 PM ----------

    This script only works in multiplayer mode?


  11. How to make chopper stand still and wait for "frank"/_group_2 ???

    And when "frank" is inside chopper, then chopper go to waypoint "_waypoint_1"

    Now the chopper is unload the squad, then chopper fly away.

    frank and car is on there way to the chopper at that time, so I need to get the chopper to wait for him.

    How to?

    Here is my code so far.

    _this = createCenter west;
    _center_0 = _this;
    
    //////////////////////////////////////////////////////////////////////////////////////////////////////
    // Create _vehicle_0
    
     _this = createVehicle ["MH60S", [14649.822, 11875.108], [], 0, "FLY"];
     _vehicle_0 = _this;
     _this setDir -73.528984;
     _this setVehicleVarName "heli";
     heli = _this;
    
    
    
    
    //////////////////////////////////////////////////////////////////////////////////////////////////////
    // Create Group_1
    
    _group_1 = createGroup _center_0; 
    _this = _group_1 createUnit ["USMC_Soldier_Pilot", [14649.822, 11875.108], [], 0, "FLY"];
     _unit_1 = _this;
     _this setDir 182.9581;
     _this setVehicleVarName "pilot";
     pilot = _this;
     _this setUnitAbility 0.60000002;
     if (true) then {_group_0 selectLeader _this;};
     _this moveInDriver heli;
    
    _this = _group_1 createUnit ["USMC_Soldier_Pilot", [14649.822, 11875.108], [], 0, "FLY"];
     _unit_1 = _this;
     _this setDir 182.9581;
     _this setVehicleVarName "pilot2";
     pilot2 = _this;
     _this setUnitAbility 0.60000002;
     _this moveInCargo heli;
    
    _this = _group_1 createUnit ["USMC_Soldier_Pilot", [14649.822, 11875.108], [], 0, "FLY"];
     _unit_2 = _this;
     _this setVehicleVarName "Gunner1";
     Gunner1 = _this;
     _this setUnitAbility 0.60000002;
     _this moveInTurret [heli, [0]];
    
    _this = _group_1 createUnit ["USMC_Soldier_Pilot", [14649.822, 11875.108], [], 0, "FLY"];
     _unit_3 = _this;
     _this setVehicleVarName "Gunner2";
     Gunner2 = _this;
     _this setUnitAbility 0.60000002;
     _this moveInTurret [heli, [1]];
    
    //////////////////////////////////////////////////////////////////////////////////////////////////////
    // Waypoint heli pilot team /_group_1
    //////////////////////////////////////////////////////////////////////////////////////////////////////
    _this = _group_1 addWaypoint [[12078.981, 12720.614], 0];
    _this setWaypointType "TR UNLOAD";
    _this setWaypointStatements ["true", "{unassignvehicle _x} foreach units Ohara;"];
    _waypoint_0 = _this;
    
    _this = _group_1 addWaypoint [[14615.212, 12302.575, 0], 0];
    _this setWaypointStatements ["true", "hint ""deleteVehicle heli"";"];
    _waypoint_1 = _this;
    
    
    
    
    
    
    //////////////////////////////////////////////////////////////////////////////////////////////////////
    // Create _vehicle_1 / M2
    
     _this = createVehicle ["HMMWV_M2", [12737.207, 12256.813], [], 0, "CAN_COLLIDE"];
     _vehicle_1 = _this;
     _this setDir 315.40115;
     _this setVehicleVarName "M2";
     M2 = _this;
    
    
    //////////////////////////////////////////////////////////////////////////////////////////////////////
    // Create _group_2
    
    _group_2 = createGroup _center_0;
    _this = _group_2 createUnit ["FR_Light", [12738.283, 12255.289], [], 0, "CAN_COLLIDE"];
     _unit_4 = _this;
     _this setVehicleVarName "frank";
     frank = _unit_4;
     _this setUnitAbility 0.60000002;
     if (true) then {_group_2 selectLeader _this;};
    
    //////////////////////////////////////////////////////////////////////////////////////////////////////
    // Waypoint M2 team / _group_2
    //////////////////////////////////////////////////////////////////////////////////////////////////////
    _this = _group_2 addWaypoint [[12737.209, 12256.783], 0];
    _this setWaypointType "GETIN NEAREST";
    _waypoint_5 = _this;
    
    _this = _group_2 addWaypoint [[12696.206, 12299.229], 0];
    _this setWaypointStatements ["true", ""];
    _waypoint_6 = _this;
    
    _this = _group_2 addWaypoint [[12587.527, 12503.487, 0], 0];
    _waypoint_7 = _this;
    
    _this = _group_2 addWaypoint [[12120.621, 12651.323, 0], 0];
    _waypoint_8 = _this;
    
    _this = _group_2 addWaypoint [[12024.262, 12668.17, 0], 0];
    _this setWaypointType "GETOUT";
    _this setWaypointStatements ["true", "unassignVehicle frank;"];
    _waypoint_9 = _this;
    
    _this = _group_2 addWaypoint [[12078.981, 12720.614], 0];
    _this setWaypointType "GETIN NEAREST";
    _this setWaypointStatements ["true", "frank assignAsCargo heli; [frank] orderGetIn true;"];
    _waypoint_10 = _this;
    
    
    
    
    //////////////////////////////////////////////////////////////////////////////////////////////////////
    // Create _group_3
    
    _group_3 = createGroup _center_0;
    _this = _group_3 createUnit ["FR_OHara", [14649.822, 11875.108], [], 0, "CARGO"];
     _unit_5 = _this;
     _this setVehicleVarName "Ohara";
     Ohara = _unit_5;
     _this setUnitAbility 0.60000002;
     if (true) then {_group_3 selectLeader _this;};
     _this moveInCargo [heli, 1];
    
    _this = _group_3 createUnit ["FR_Miles", [14649.822, 11875.108], [], 0, "CARGO"];
     _unit_6 = _this;
     _this setVehicleVarName "Miles";
     Miles = _unit_6;
     _this setUnitAbility 0.60000002;
     _this moveInCargo [heli, 3];
    
    _this = _group_3 createUnit ["FR_Rodriguez", [14649.822, 11875.108], [], 0, "CARGO"];
     _unit_7 = _this;
     _this setVehicleVarName "Rodriguez";
     Rodriguez = _unit_7;
     _this setUnitAbility 0.60000002;
     _this moveInCargo [heli, 2];
    
    _this = _group_3 createUnit ["FR_Sykes", [14649.822, 11875.108], [], 0, "CARGO"];
     _unit_8 = _this;
     _this setVehicleVarName "Sykes";
     Sykes = _unit_8;
     _this setUnitAbility 0.60000002;
     _this moveInCargo [heli, 4];
    
    
    //////////////////////////////////////////////////////////////////////////////////////////////////////
    // Waypoint squad team / _group_3
    //////////////////////////////////////////////////////////////////////////////////////////////////////
    _this = _group_3 addWaypoint [[12048.579, 12682.741, 0], 0];
    _this setWaypointStatements ["true", "[Ohara] join player; [Miles] join player; [Rodriguez] join player; [sykes] join player;"];
    _waypoint_2 = _this;
    

×