Jump to content

-ami- mofo

Member
  • Content Count

    201
  • Joined

  • Last visited

  • Medals

Posts posted by -ami- mofo


  1. Hi mate for example in the init of the playable unit (team leader) in the editor I have this....

    null0 = this execVM "Scripts\1_team_leader.sqf";

    which calls it from a .sqf file in my mission's/script folder.

    I have 6 players in the mission and each one has a different loadout.sqf file named after them.

    So you're saying that I should be calling all of these from my mission's init.sqf file?

    And does this

    !(local _this) exitWith {}; 

    go in the mission init.sqf? or in each player's loadout.sqf?

    This is my mission init.sqf as it is at the moment..

    //Mission parameters
    skiptime (paramsArray select 0);
    sleep 2;
    
    
    
    // Wait for player object to initialise before processing init.sqf for JIP)
    if (!isServer && (player != player)) then
    {
    waitUntil {player == player};
    waitUntil {time > 10};
    };
    
    
    
    enableSaving [false,false];
    call compile preprocessFile "=BTC=_revive\=BTC=_revive_init.sqf";
    
    
    
    
    enableRadio false;
    enableSentences false;
    
    
    
    setViewDistance 2000;
    
    
    
    
    {
    if ( side _x == EAST ) then {
    	_x removeAllEventHandlers "HandleDamage";
    	_x addEventHandler ["HandleDamage",{
    		_damage = (_this select 2)*2; // <-- the *2 multiples the damage by 2
    		_damage
    	}];
    };
    }forEach allUnits;
    
    
    {
       if ((side _x) == EAST) then 
       {
           _x setUnitAbility 0.1;
           _x setskill ["aimingAccuracy",0.15];
           _x setskill ["aimingShake",0.45];
           _x setskill ["aimingSpeed",0.6];
           _x setskill ["spotDistance",0.3];
           _x setskill ["spotTime",0.4];
           _x setskill ["courage",1];
           _x setskill ["reloadSpeed",1];
       };
    } forEach allUnits;
    
    
    
    
    []execVM "eos\OpenMe.sqf";
    
    
    
    [] execVM "scripts\cleanup.sqf";
    
    
    
    
    


  2. Hi community,

    I'm hosting a MP mission on my own gaming rig that myself and several friends join in on and I'm having a little trouble with the custom loadouts not working consistently. Basically someone can start

    with all the stuff they should have but somebody else won't. It's a bit all over the shop.

    I have this for example....

    removeAllWeapons _this; 
    removeAllItems _this;
    _this unassignItem "NVGoggles"; 
    _this removeItem "NVGoggles";
    _this removeWeapon "itemGPS";
    _this removeWeapon "itemradio";
    _this addBackpack "B_AssaultPack_blk_DiverExp";
    _this removeItem "ToolKit";
    _this removeItem "MineDetector";
    
    
    
    
    //ADD WEAPON & AMMO
    _this addmagazines ["30Rnd_65x39_caseless_mag",6]; 
    _this addMagazines ["1Rnd_HE_Grenade_shell",3];
    _this addweapon "arifle_MX_GL_F";
    
    //_this addMagazines ["30Rnd_556x45_Stanag",6];
    //_this addMagazines ["1Rnd_HE_Grenade_shell",3];
    //_this addWeapon "arifle_TRG21_GL_F";
    
    //_this addMagazines ["20Rnd_762x51_Mag",6];
    //_this addWeapon "srifle_EBR_F";
    
    //_this addMagazines ["30Rnd_45ACP_Mag_SMG_01",6];
    //_this addWeapon "SMG_01_F";
    
    
    
    //ADD WEAPON ATTACHMENTS
    _this addPrimaryWeaponItem "optic_Arco";
    //_this addPrimaryWeaponItem "optic_Hamr";
    //_this addPrimaryWeaponItem "optic_tws";
    _this addPrimaryWeaponItem "muzzle_snds_H";
    //_this addPrimaryWeaponItem "acc_pointer_IR";
    _this addPrimaryWeaponItem "acc_flashlight"; 
    
    
    
    //ADD EQUIPMENT
    _this addWeapon "ACRE_PRC152";
    _this addWeapon "ItemGPS";
    //_this addWeapon "Binocular";
    _this addWeapon "Rangefinder";
    //_this addWeapon "LaserDesignator";
    _this additem "NVGoggles";
    _this assignitem "NVGoggles";
    _this action ["NVGoggles",this];
    
    
    
    
    //ADD ORDNANCE - SMOKE - FLARES
    //_this addMagazines ["DemoCharge_Remote_Mag",1];
    //_this addMagazines ["SatchelCharge_Remote_Mag",1];
    //_this addmagazines ["ATMine_Range_Mag",1];
    //_this addmagazines ["APERSBoundingMine_Range_Mag",2];
    _this addMagazines ["UGL_FlareWhite_F",1];
    //_this addmagazines ["SmokeShellRed",1];
    

    At the very top of all that I've tried

    if (!isServer) exitWith {};

    and also

    waituntil {time>0};

    These work in the editor but give varying success and failure when we MP.

    I'm really hoping somebody can give me the correct line or lines to add to my loadout scripts which is MP compatible and works everytime?

    Thanks.


  3. Thanks guys the I tried the "Global" again and it worked. I must've done something stupid before like spelling it wrong in the 1st place and copying it >.<

    The only problem I had after that was the number of items was acting strange like doubling for me but not for the other client but I fixed that by replacing

    waituntil {time>0};
    
    

    with

    if (!isServer) exitWith {};

    Now everyone see's the same number of items to start with and when something is removed from the box everyone else see's it removed as well so it all adds up perfectly ;)

    Looks like this now....

    //AMMO CRATE WEST
    
    //place in init line of object to contain ammo:- null0 = this execVM "Scripts\ammo_west.sqf";
    
    if (!isServer) exitWith {};
    
    ClearWeaponCargoGlobal _this; 
    ClearMagazineCargoGlobal _this; 
    ClearItemCargoGlobal _this;
    ClearBackpackCargoGlobal _this;
    
    
    
    // EQUIPMENT
    //_this addItemCargoGlobal ["NVGoggles",6];
    _this addItemCargoGlobal ["ItemGPS",6];
    _this addItemcargoGlobal ["ToolKit",1];
    _this addItemcargoGlobal ["MediKit",1];
    _this addItemcargoGlobal ["B_UAVTerminal",1];
    _this addItemcargoGlobal ["MineDetector",2];
    _this addItemcargoGlobal ["FirstAidKit",18];
    
    
    
    
    
    // ASSAULT RIFLES
    _this addWeaponCargoGlobal ["arifle_TRG20_F",3];
    _this addWeaponCargoGlobal ["arifle_TRG21_F",3];
    _this addWeaponCargoGlobal ["arifle_TRG21_GL_F",3];
    _this addWeaponCargoGlobal ["arifle_MX_F",3];
    _this addWeaponCargoGlobal ["arifle_MX_GL_F",3];
    _this addWeaponCargoGlobal ["arifle_MXC_F",3];
    _this addWeaponCargoGlobal ["arifle_MXM_F",3];
    _this addWeaponCargoGlobal ["srifle_EBR_F",3];
    
    
    
    
    // SUBMACHINE GUNS
    _this addWeaponCargoGlobal ["SMG_01_F",2];
    
    
    
    
    
    // LIGHT MACHINE GUNS
    _this addWeaponCargoGlobal ["arifle_MX_SW_F",1];
    _this addWeaponCargoGlobal ["LMG_Mk200_F",1];
    
    
    
    // SNIPER RIFLES
    _this addWeaponCargoGlobal ["srifle_LRR_f",2];
    
    
    
    // LAUNCHERS
    _this addWeaponCargoGlobal ["launch_Titan_F",2];
    _this addWeaponCargoGlobal ["launch_Titan_short_F",2];
    
    
    
    
    
    // OPTICS - WEAPON ATTACHMENTS
    _this addWeaponCargoGlobal ["Binocular",6];
    _this addWeaponCargoGlobal ["Rangefinder",2];
    _this addWeaponCargoGlobal ["LaserDesignator",2];
    _this addItemCargoGlobal ["optic_LRPS",2];
    _this addItemCargoGlobal ["optic_Nightstalker",2];
    _this addItemCargoGlobal ["optic_tws",2];
    _this addItemCargoGlobal ["optic_tws_mg",2];
    _this addItemCargoGlobal ["optic_Arco",6];
    _this addItemCargoGlobal ["optic_Hamr",6];
    _this addItemCargoGlobal ["muzzle_snds_H",6];
    _this addItemCargoGlobal ["muzzle_snds_H_MG",1];
    _this addItemCargoGlobal ["muzzle_snds_M",6];
    _this addItemCargoGlobal ["muzzle_snds_B",6];
    _this addItemCargoGlobal ["muzzle_snds_ACP",6];
    _this additemcargoGlobal ["acc_pointer_IR",6];
    _this addItemCargoGlobal ["acc_flashlight",6];
    
    
    
    
    // AMMO
    _this addMagazineCargoGlobal ["7Rnd_408_Mag",20];
    _this addMagazineCargoGlobal ["30Rnd_556x45_Stanag",50];
    _this addMagazineCargoGlobal ["30Rnd_65x39_caseless_mag",50];
    _this addMagazineCargoGlobal ["100Rnd_65x39_caseless_mag_Tracer",5];
    _this addMagazineCargoGlobal ["200Rnd_65x39_cased_Box_Tracer",3];
    _this addMagazineCargoGlobal ["30Rnd_45ACP_Mag_SMG_01",20];
    _this addMagazineCargoGlobal ["20Rnd_762x51_Mag",20];
    _this addMagazineCargoGlobal ["Titan_AT",6];
    _this addMagazineCargoGlobal ["Titan_AA",6];
    
    
    
    
    
    // ORDNANCE - SMOKE - FLARES
    _this addMagazineCargoGlobal ["DemoCharge_Remote_Mag",6];
    _this addMagazineCargoGlobal ["SatchelCharge_Remote_Mag",6];
    _this addmagazineCargoGlobal ["ATMine_Range_Mag",6];
    _this addmagazineCargoGlobal ["APERSBoundingMine_Range_Mag",6];
    _this addMagazineCargoGlobal ["HandGrenade",12];
    _this addMagazineCargoGlobal ["1Rnd_HE_Grenade_shell",6];
    _this addmagazinecargoGlobal ["SmokeShellRed",6];
    _this addMagazineCargoGlobal ["UGL_FlareWhite_F",6];
    
    
    
    _this addBackpackCargoGlobal ["B_UAV_01_backpack_F",1];
    _this addBackpackCargoGlobal ["B_Parachute",6];
    

    Only thing I have a little problem with is that the ammo box is 1/3 buried under ground for other players but not for me the host. Why is that? Not that important but while I'm here does anyone know a fix for that?


  4. Hi guys I had this which worked fine for everyone a couple of months ago...

    /AMMO CRATE WEST
    
    //place in init line of object to contain ammo:- null0 = this execVM "Scripts\ammo_west.sqf";
    
    waituntil {time>0};
    
    ClearWeaponCargo _this; 
    ClearMagazineCargo _this; 
    ClearItemCargo _this;
    ClearBackpackCargo _this;
    
    
    
    // EQUIPMENT
    //_this addItemCargo ["NVGoggles",6];
    _this addItemCargo ["ItemGPS",6];
    _this addItemcargo ["ToolKit",1];
    _this addItemcargo ["MediKit",1];
    _this addItemcargo ["B_UAVTerminal",1];
    _this addItemcargo ["MineDetector",2];
    _this addItemcargo ["FirstAidKit",18];
    
    
    
    
    
    // ASSAULT RIFLES
    _this addWeaponCargo ["arifle_TRG20_F",3];
    _this addWeaponCargo ["arifle_TRG21_F",3];
    _this addWeaponCargo ["arifle_TRG21_GL_F",3];
    _this addWeaponCargo ["arifle_MX_F",3];
    _this addWeaponCargo ["arifle_MX_GL_F",3];
    _this addWeaponCargo ["arifle_MXC_F",3];
    _this addWeaponCargo ["arifle_MXM_F",3];
    _this addWeaponCargo ["srifle_EBR_F",3];
    
    
    
    
    // SUBMACHINE GUNS
    _this addWeaponCargo ["SMG_01_F",2];
    
    
    
    
    
    // LIGHT MACHINE GUNS
    _this addWeaponCargo ["arifle_MX_SW_F",1];
    _this addWeaponCargo ["LMG_Mk200_F",1];
    
    
    
    // SNIPER RIFLES
    _this addWeaponCargo ["srifle_LRR_f",2];
    
    
    
    // LAUNCHERS
    _this addWeaponCargo ["launch_Titan_F",2];
    _this addWeaponCargo ["launch_Titan_short_F",2];
    
    
    
    
    
    // OPTICS - WEAPON ATTACHMENTS
    _this addWeaponCargo ["Binocular",6];
    _this addWeaponCargo ["Rangefinder",2];
    _this addWeaponCargo ["LaserDesignator",2];
    _this addItemCargo ["optic_LRPS",2];
    _this addItemCargo ["optic_Nightstalker",2];
    _this addItemCargo ["optic_tws",2];
    _this addItemCargo ["optic_tws_mg",2];
    _this addItemCargo ["optic_Arco",6];
    _this addItemCargo ["optic_Hamr",6];
    _this addItemCargo ["muzzle_snds_H",6];
    _this addItemCargo ["muzzle_snds_H_MG",1];
    _this addItemCargo ["muzzle_snds_M",6];
    _this addItemCargo ["muzzle_snds_B",6];
    _this addItemCargo ["muzzle_snds_ACP",6];
    _this additemcargo ["acc_pointer_IR",6];
    _this addItemCargo ["acc_flashlight",6];
    
    
    
    
    // AMMO
    _this addMagazineCargo ["7Rnd_408_Mag",20];
    _this addMagazineCargo ["30Rnd_556x45_Stanag",50];
    _this addMagazineCargo ["30Rnd_65x39_caseless_mag",50];
    _this addMagazineCargo ["100Rnd_65x39_caseless_mag_Tracer",5];
    _this addMagazineCargo ["200Rnd_65x39_cased_Box_Tracer",3];
    _this addMagazineCargo ["30Rnd_45ACP_Mag_SMG_01",20];
    _this addMagazineCargo ["20Rnd_762x51_Mag",20];
    _this addMagazineCargo ["Titan_AT",6];
    _this addMagazineCargo ["Titan_AA",6];
    
    
    
    
    
    // ORDNANCE - SMOKE - FLARES
    _this addMagazineCargo ["DemoCharge_Remote_Mag",6];
    _this addMagazineCargo ["SatchelCharge_Remote_Mag",6];
    _this addmagazineCargo ["ATMine_Range_Mag",6];
    _this addmagazineCargo ["APERSBoundingMine_Range_Mag",6];
    _this addMagazineCargo ["HandGrenade",12];
    _this addMagazineCargo ["1Rnd_HE_Grenade_shell",6];
    _this addmagazinecargo ["SmokeShellRed",6];
    _this addMagazineCargo ["UGL_FlareWhite_F",6];
    
    
    
    _this addBackpackCargo ["B_UAV_01_backpack_F",1];
    _this addBackpackCargo ["B_Parachute",6];
    

    It sort of still works for me who's hosting the co-op mission on my PC but doesn't work at all for other players. They just see the standard stuff that comes in the supply crate. I can see all the items but I had my GPS disappear the other night from a friend who JIP'd. So a bit of weirdness going on even for me as well.

    I understand that BIS may have sneak'd in a change regarding the add-blah-cargo description? I tried adding 'global' to the descriptions as somebody suggested on some other site but that made no difference.

    So does anyone know how I get this to work again please? It's bork'd my missions big time :(

    Thanks.


  5. Hey mate for the delayed new task assignment just have it synced to it's own separate trigger covering the same area as your last task succeeded trigger but put a countdown time delay on it.

    I don't use onscreen waypoints as for me I like a clear screen so I just add a link in the task description on the map screen that you can show as a grid reference or name so you can click on it and it moves to that area of the map. I think you can do what you want with the onscreen WP but last I heard it doesn't work all the time.

    As for the location and time showing at start of a mission you can just use a trigger and the text option under the effects tab. You can have it show up center bottom or just center of screen.


  6. I'm calling this from a spawning script though, not placed editor waypoints.

    _waypoint0 = _ag1 addwaypoint [getmarkerpos "ag1move1",0];
    _waypoint0 setwaypointtype"Move"; 
    

    Is there a way to alter this?

    I tried increasing the 0 (tbh I don't know what the 0 does lol) but anyway that didn't work.

    Is there a way through the script? or can it only be done if it's editor placed?


  7. Tested it some more and what I found is that it only affects aircraft and what I also just noticed is that if you have their speed limited it works fine.

    So maybe it's to do with a speed issue? Faster aircraft maybe miss the markers more and therefore do weird things like double back and loops etc?

    Is there maybe a way to make it so that the marker area to pass through is larger and therefore more easy for them to achieve?

    If so I'd like to test it.


  8. Thats why i suggested setFormDir. If the formation is pointing the direction you want him to face then the unit is not going to rotate back to the form direction.???

    sg2 = [getPos player, west, ["B_Soldier_F"]] call BIS_fnc_spawnGroup;  { group _x setFormDir 180; _x allowFleeing 0; _x setdir 180} forEach units sg2;

    Worls fine here. soldier spawns in and stays facing 180 (South). Without the setFormDir he rotates to face North

    Cheers man works a treat! :)


  9. I'd say the fact that it works all the time every time only for the original aircraft I had in there when I pieced this script together is pretty odd. Why should that matter at all?

    And the fact that not only it doesn't work for the other two types of aircraft but it doesn't even not work the same way is even more baffling.

    Does.....not.....make.....sense :annoy:


  10. I have a script which worked great, spawned an Indi aircraft and had it fly at a set height through waypoints and keep cycling through those waypoints all day.

    ag1spawn = [getMarkerPos "ag1spawn", 0, "I_Plane_Fighter_03_CAS_F", INDEPENDENT] call bis_fnc_spawnvehicle;
    _ag1air = ag1spawn select 0;	//the aircraft
    _ag1crew = ag1spawn select 1;	//the units that make up the crew
    _ag1 = ag1spawn select 2;	//the group
    {_x allowFleeing 0} forEach units _ag1;
    
    _ag1height = 700;
    _ag1air flyinheight 200;
    _ag1air setpos [getposATL _ag1air select 0, getposATL _ag1air select 1, _ag1height];
    
    reldir = [getmarkerpos "ag1spawn", getmarkerpos "ag1move1"] call BIS_fnc_dirTo;
    _ag1air setdir reldir;
    
    _waypoint0 = _ag1 addwaypoint [getmarkerpos "ag1move1",0];
    _waypoint0 setwaypointtype"Move"; 
    
    _waypoint1 = _ag1 addwaypoint [getmarkerpos "ag1move2",0];
    _waypoint1 setwaypointtype"Move";
    
    _waypoint2 = _ag1 addwaypoint [getmarkerpos "ag1move3",0];
    _waypoint2 setwaypointtype"Move";
    
    _waypoint0 = _ag1 addwaypoint [getmarkerpos "ag1move1",0];
    _waypoint0 setwaypointtype"Move";
    
    _waypoint0 setwaypointtype "CYCLE"; 

    "Cool" I thought, I can use this again whenever I need it on some other type of aircraft. All I have to do is change the aircraft classname and side.

    So today I changed the I_Plane_Fighter_03_CAS_F and INDEPENDENT to O_Heli_Attack_02_F and EAST. That's all I changed.

    What I got was a heli that spawned at 700 and stayed at 700 and went to the first marker and then just did loops around it. :confused:

    I thought OK this is Arma and you expect everything to be difficult, maybe the script just doesn't like helicopters for some weird reason? So I put back in a fixed wing

    but a different type. I put in O_Plane_CAS_02_F and what I got was a plane that spawned at 700, went down to 200 and followed all the waypoints

    as it should... But then it stopped around waypoint3 and just did loops around it, no cycle at all. :confused:

    So 3 different aircraft and 3 different results with the only difference being the aircraft classname and side being changed.

    Oh btw when I put the original aircraft classname and side back in it worked perfectly again :confused::confused::confused:

    I'm hoping that somebody can tell me what I did wrong or is this truly just another example on how dodgy and irritating arma editing is?


  11. This confirms my theory. He's rotating back to the formation direction.

    This is just a single unit though, not part of a group.

    Try doStop in there:

    _sg2 = [getMarkerPos "sg2spawn", EAST, ["O_Soldier_F"]] call BIS_fnc_spawnGroup;
    {_x allowFleeing 0; doStop _x; _x setdir 180} forEach units _sg2;

    Didn't work either mate. Still rotates to the north after spawning.

    I basically cheated by adding a move marker a couple of feet away from the spawn marker, south of the spawn marker. That way he takes a couple of steps to the south and stays facing that direction when he stops. A bit dodgy but it works.

    _sg2 = [getMarkerPos "sg2spawn", EAST, ["O_Soldier_F"]] call BIS_fnc_spawnGroup; 
    {_x allowFleeing 0} forEach units _sg2;
    
    _waypoint0 = _sg2 addwaypoint[getmarkerpos"sg2move1",0];
    _waypoint0 setwaypointtype"Move";


  12. I've actually changed things a little since my post and I now just have a single soldier spawn and am trying to make it face south so I did this based on Grumpy's code...

    _sg2 = [getMarkerPos "sg2spawn", EAST, ["O_Soldier_F"]] call BIS_fnc_spawnGroup;
    {_x allowFleeing 0; _x setdir 180} forEach units _sg2;
    

    Which spawns a dude facing south ;).... but a second after spawning he rotates on the spot and faces north :confused_o:


  13. Hi gents,

    I have two units spawned on a marker via a trigger with this in the .sqf....

    sg1 = [getMarkerPos "sg1spawn", EAST, ["O_Soldier_TL_F", "O_Soldier_F"]] call BIS_fnc_spawnGroup; 
    {_x allowFleeing 0} forEach units sg1;

    Trouble is I want them to face a different direction. I've tried messing with setDir by adding sg2 setDir 180 to the bottom of what I already

    have but that just made the units snot spawn at all.

    I'm guessing that sg2 setDir 180; must have to be incorporated somewhere amongst the 1st line? But I don't know how exactly to do that. :confused:

    Thanks


  14. ;2662758']
    {
    if ((side _x) == EAST) then 
    {
    	_x setUnitAbility 0.1;
    	_x setskill ["aimingAccuracy",0.25];
    	_x setskill ["aimingShake",0.8];
    	_x setskill ["aimingSpeed",0.1];
    	_x setskill ["Endurance",0.1];
    	_x setskill ["spotDistance",0.5];
    	_x setskill ["spotTime",0.5];
    	_x setskill ["courage",0.5];
    	_x setskill ["reloadSpeed",0.1];
    };
    } forEach allUnits;
    

    Executed from init.sqf. You can change up the side and values of course' date=' but this is what you're looking for I believe.[/quote']

    ^ This is the best way IMO. Just adjust the figures to your liking, don't forget to save the file after altering the numbers before you try it out.

    Also if you would want OPFOR easier to kill damage wise then also add this to your init.sqf...

    {
    if ( side _x == EAST ) then {
    	_x removeAllEventHandlers "HandleDamage";
    	_x addEventHandler ["HandleDamage",{
    		_damage = (_this select 2)*2; // <-- the *2 multiples the damage by 2
    		_damage
    	}];
    };
    }forEach allUnits;

    1 or 2 well placed shots and they drop.


  15. Thanks Grumpy the spawn height and direction work a treat. Only problem was the plane spawned with no forward momentum and unless the spawn height was at least 300m above ground it would crash.

    I altered it to

    ag1height = 700;
    ag1air flyinheight 250;

    So now it has time to gain speed as it falls and then continue at 250m so all good :)

    I get what you said about the variable too so thanks for that as well. I'm going to start reading up about scripting over the Easter break so I don't have to ask as many questions and maybe start to know what I'm doing rather than just tinkering and testing with stuff I know very little about :o

×