Jump to content

Andrew_S90

Member
  • Posts

    29
  • Joined

  • Last visited

Posts posted by Andrew_S90

  1. Looks nice but you really should use BIS_fnc_findSafePos instead of selecting from a huge list of coordinates that you want the heli to spawn at.

     

    So instead of having to add about a hundred different coordinates by hand, it randomly selects a good area thats customizable..

     

    How it would work for your script..

    //Variables you can change
    
    _spawnCenter = [10088,9045,0]; //Center of your map (usually in mission.sqm)
    
    _min = 0; // minimum distance from the center position (Number) in meters
    
    _max = 12000; // maximum distance from the center position (Number) in meters
    
    _mindist = 5; // minimum distance from the nearest object (Number) in meters, ie. spawn at least this distance away from anything within x meters..
    //Low _mindist means helicrashes could spawn near towns or in forests.. higher the number it would be spawning in an open field etc
    _water = 0; // water mode 0: cannot be in water , 1: can either be in water or not , 2: must be in water
    _shoremode = 0; // 0: does not have to be at a shore , 1: must be at a shore
    
    
    //then in your script instead of...
    
    _posOfCrash = _coords call BIS_fnc_SelectRandom;
    
    
    
    //it would be
    
    _posOfCrash = [_spawnCenter,_min,_max,_mindist,_water,20,_shoremode] call BIS_fnc_findSafePos; // find a random loc
    
    _vehHeli setposATL [(_posOfCrash) select 0,(_posOfCrash) select 1,0];
    
    //the "20" inside _posOfCrash would be the max height of a slope in meters it can spawn.. so lower = flatter land but I would keep it at 20 or so :D

    Then all you have to do to modify it to your map would be change the center _spawnCenter and the distance

     

     

    Hope this helps a bit

  2. Maybe someone can help here, I have tried everything with this script and as simple as it sounds and seems its not working. I am not new to scripting either, I have worked with A2 Epoch and DayZ but both Arma 3 Scripting and A3 Epoch are new to me.

     

    Question before I state my problem, does everything in your mission execute at once? 

     

    My problem is no matter what kind of checks I put for this spawn loadout it always seems to execute the loadout and give you a new set of gear every time you relog no matter where you are on the map.

     

    If anyone can help me or point me in the right direction that would be great.

     

    Here is what I have so far...

     

    *Map - Bornholm

     

    (excuse the pulling of different scripts from here and there in this thread, using it to test and get working)

     

    *As of now the script executes after every login not just if I am inside the clone room (which has correct coordinates)

     

    *Also it states that I have left the clone room as a hint at the beginning of every time I login to the server

     

    *The crypto I give with this script also seems to disappear after I relog with it

    Mission.sqm (correctly placed sensor)

    		class Item4 {
    			position[] = {15630.2, 3.0141, 210.321};
    			name = "Respawn_1";
    			type = "hd_dot";
    		};
    	};
    	class Sensors
    	{
    		items=1;
    		class Item0
    		{
    			position[]={13813.836,3.1900001,6882.484};
    			a=50;
    			b=50;
    			activationBy="ANY";
    			repeating=1;
    			interruptable=1;
    			age="UNKNOWN";
    			name="cloneroomsafezone";
    			expCond = "(player distance cloneroomsafezone) < 50;";
    			expActiv="hint ""You are in the clone room"";  inSafeZone = true; execVM ""random.sqf"";";
    			expDesactiv="hint ""You left the clone room"";  inSafeZone = false;";
    			class Effects
    			{
    			};
    		};
    	};
    };
    
    class Intro {
    	addOns[] = {"bornholm"};
    	addOnsAuto[] = {"bornholm"};
    	randomSeed = 25982387;
    

     

    init.sqf

    
    
    if (!isDedicated) then {
    	[] execVM "esc.sqf";
    };
    
    [] execVM "effect.sqf";
     

     

    random.sqf

    waitUntil {alive vehicle player}; 
    waitUntil {typeOF player != "VirtualMan_EPOCH"};
    
    sleep 5;
    if (isNil "inSafezone") then {
        inSafezone = false;
    };
    hint format [" Alive %1 | EPOCH_playerCrypto %2 ",EPOCH_playerAliveTime,EPOCH_playerCrypto];
    if (newPlayer && (EPOCH_playerCrypto == 0) && (EPOCH_playerAliveTime == 0)) then
    {
    	waitUntil {
            inSafeZone
        };
    	clearWeaponCargo player;
    	clearMagazineCargo player;
    	_PistolANDmag = [["hgun_Pistol_heavy_02_Yorris_F","6Rnd_45ACP_Cylinder"],["hgun_Pistol_heavy_02_F","6Rnd_45ACP_Cylinder"],["hgun_Pistol_heavy_01_MRD_F","11Rnd_45ACP_Mag"],["hgun_Pistol_heavy_01_snds_F","11Rnd_45ACP_Mag"],["hgun_Pistol_heavy_01_F","11Rnd_45ACP_Mag"],["hgun_ACPC2_snds_F","9Rnd_45ACP_Mag"],["hgun_ACPC2_F","9Rnd_45ACP_Mag"],["hgun_Rook40_snds_F","16Rnd_9x21_Mag"],["hgun_Rook40_F","16Rnd_9x21_Mag"],["hgun_P07_snds_F","16Rnd_9x21_Mag"],["hgun_P07_F","16Rnd_9x21_Mag"]] call BIS_fnc_selectRandom;
    	_pistol = _PistolANDmag select 0;
    	_mag = _PistolANDmag select 1;
    	_item = "FAK";
    	_food = ["CookedSheep_EPOCH","CookedGoat_EPOCH","CookedChicken_EPOCH","CookedRabbit_EPOCH","ItemTunaCooked","ItemSeaBassCooked","ItemTroutCooked","FoodSnooter","FoodMeeps"] call BIS_fnc_selectRandom;
    	_drink = ["ItemSodaRbull","ItemSodaOrangeSherbet","ItemSodaPurple","ItemSodaMocha","ItemSodaBurst","FoodWalkNSons","WhiskeyNoodle"] call BIS_fnc_selectRandom;
    	_uniform = ["U_C_Scientist","U_C_Journalist","U_C_WorkerCoveralls","U_C_Poor_1","U_C_Poloshirt_redwhite","U_C_Poloshirt_salmon","U_C_Poloshirt_tricolour","U_C_Poloshirt_burgundy","U_C_Poloshirt_blue","U_C_Poloshirt_stripped"] call BIS_fnc_selectRandom;
    	_vest = ["V_1_EPOCH","V_2_EPOCH","V_3_EPOCH","V_4_EPOCH","V_5_EPOCH","V_16_EPOCH","V_1_EPOCH","V_2_EPOCH","V_3_EPOCH","V_4_EPOCH","V_5_EPOCH"] call BIS_fnc_selectRandom;
    	_hat = ["H_39_EPOCH","H_40_EPOCH","H_41_EPOCH","H_42_EPOCH","H_43_EPOCH","H_44_EPOCH","H_45_EPOCH","H_46_EPOCH","H_47_EPOCH","H_48_EPOCH","H_49_EPOCH","H_50_EPOCH","H_51_EPOCH","H_52_EPOCH","H_53_EPOCH","H_54_EPOCH","H_55_EPOCH","H_56_EPOCH","H_57_EPOCH","H_58_EPOCH","H_59_EPOCH","H_60_EPOCH","H_61_EPOCH","H_62_EPOCH","H_63_EPOCH","H_64_EPOCH","H_65_EPOCH","H_66_EPOCH","H_67_EPOCH","H_68_EPOCH","H_69_EPOCH","H_70_EPOCH","H_71_EPOCH","H_72_EPOCH","H_73_EPOCH","H_74_EPOCH","H_75_EPOCH","H_76_EPOCH","H_77_EPOCH","H_78_EPOCH","H_79_EPOCH","H_80_EPOCH","H_81_EPOCH","H_82_EPOCH","H_83_EPOCH","H_84_EPOCH","H_85_EPOCH"] call BIS_fnc_selectRandom;
    	sleep 4;
    	_player = player;
    			
    	_player addVest _vest;
    	_player addHeadgear _hat;
    	_player addWeapon _pistol;
    	_player addMagazine _mag;
    	_player addMagazine _item;
    	_player addMagazine _food;
    	_player addMagazine _drink;
    	_player addWeapon "EpochRadio0";
    	EPOCH_playerCrypto = 5;
    	
    	cutText [format[" %1 \n %2 \n %3 \n %4 \n %5 \n %6 \n %7",_pistol,_mag,_item,_food,_drink,_uniform,_vest] , "PLAIN DOWN"];
    	//hint format [" %1 \n %2 \n %3 \n %4 \n %5 \n %6 \n %7",_pistol,_mag,_item,_food,_drink,_uniform,_vest];
    	//hint format [" Alive %1 ",EPOCH_playerAliveTime];
    			
    			
    	_modelMale = (typeOF player == "Epoch_Male_F");
        _modelFemale = (typeOF player == "Epoch_Female_F");	
            
        if (_modelFemale) then {
            player forceAddUniform "U_BasicBodyFemale";
            };
        if (_modelMale) then {
        player forceAddUniform _uniform;
            };        	
    	newPlayer = false;
    } else {
    hint "Standard Loadout Already Supplied";
    };  	
    		 

     

    and my OnPlayerRespawn.sqf just contains

    newPlayer = true;

     

     

     

     

    EDIT:

    It now works as the time alive check (EPOCH_playerAliveTime == 0) stops it from executing again after every login

    But it still executes the script and the sensor everytime I login no matter where I am at.

    I get the you have left the clone room hint and the standard loadout already supplied hint everytime I login so the script still executes everywhere.

    The money also doesn't save that is given in the script either.

     

    If anyone has any ideas please share! thanks

     

     

     

    Got it to work! If anyone wants to see what I did, this is what I changed in my mission.sqm file..

    activationBy="CIV";
    			repeating=1;
    			interruptable=1;
    			age="UNKNOWN";
    			name="cloneroomsafezone";
    			expCond = "(player distance cloneroomsafezone) < 50;";
    			expActiv="dome = execVM ""random.sqf""; inSafeZone = true;";
    			expDesactiv="terminate dome; inSafeZone = false;";
    			class Effects
    			{
    			}; 
  3. Maybe someone can help here, I have tried everything with this script and as simple as it sounds and seems its not working. I am not new to scripting either, I have worked with A2 Epoch and DayZ but both Arma 3 Scripting and A3 Epoch are new to me.
     
    Question before I state my problem, does everything in your mission execute at once? 
     
    My problem is no matter what kind of checks I put for this spawn loadout it always seems to execute the loadout and give you a new set of gear every time you relog no matter where you are on the map.
     
    If anyone can help me or point me in the right direction that would be great.
     
    Here is what I have so far...
     
    *Map - Bornholm
     

    (excuse the pulling of different scripts from here and there in this thread, using it to test and get working)

     

    *As of now the script executes after every login not just if I am inside the clone room (which has correct coordinates)

     

    *Also it states that I have left the clone room as a hint at the beginning of every time I login to the server

     

    *The crypto I give with this script also seems to disappear after I relog with it

    Mission.sqm (correctly placed sensor)

    		class Item4 {
    			position[] = {15630.2, 3.0141, 210.321};
    			name = "Respawn_1";
    			type = "hd_dot";
    		};
    	};
    	class Sensors
    	{
    		items=1;
    		class Item0
    		{
    			position[]={13813.836,3.1900001,6882.484};
    			a=50;
    			b=50;
    			activationBy="ANY";
    			repeating=1;
    			interruptable=1;
    			age="UNKNOWN";
    			name="cloneroomsafezone";
    			expCond = "(player distance cloneroomsafezone) < 50;";
    			expActiv="hint ""You are in the clone room"";  inSafeZone = true; execVM ""random.sqf"";";
    			expDesactiv="hint ""You left the clone room"";  inSafeZone = false;";
    			class Effects
    			{
    			};
    		};
    	};
    };
    
    class Intro {
    	addOns[] = {"bornholm"};
    	addOnsAuto[] = {"bornholm"};
    	randomSeed = 25982387;
    

     

    init.sqf

    
    
    if (!isDedicated) then {
    	[] execVM "esc.sqf";
    };
    
    [] execVM "effect.sqf";
     

     

    random.sqf

    waitUntil {alive vehicle player}; 
    waitUntil {typeOF player != "VirtualMan_EPOCH"};
    
    sleep 5;
    if (isNil "inSafezone") then {
        inSafezone = false;
    };
    hint format [" Alive %1 | EPOCH_playerCrypto %2 ",EPOCH_playerAliveTime,EPOCH_playerCrypto];
    if (newPlayer && (EPOCH_playerCrypto == 0) && (EPOCH_playerAliveTime == 0)) then
    {
    	waitUntil {
            inSafeZone
        };
    	clearWeaponCargo player;
    	clearMagazineCargo player;
    	_PistolANDmag = [["hgun_Pistol_heavy_02_Yorris_F","6Rnd_45ACP_Cylinder"],["hgun_Pistol_heavy_02_F","6Rnd_45ACP_Cylinder"],["hgun_Pistol_heavy_01_MRD_F","11Rnd_45ACP_Mag"],["hgun_Pistol_heavy_01_snds_F","11Rnd_45ACP_Mag"],["hgun_Pistol_heavy_01_F","11Rnd_45ACP_Mag"],["hgun_ACPC2_snds_F","9Rnd_45ACP_Mag"],["hgun_ACPC2_F","9Rnd_45ACP_Mag"],["hgun_Rook40_snds_F","16Rnd_9x21_Mag"],["hgun_Rook40_F","16Rnd_9x21_Mag"],["hgun_P07_snds_F","16Rnd_9x21_Mag"],["hgun_P07_F","16Rnd_9x21_Mag"]] call BIS_fnc_selectRandom;
    	_pistol = _PistolANDmag select 0;
    	_mag = _PistolANDmag select 1;
    	_item = "FAK";
    	_food = ["CookedSheep_EPOCH","CookedGoat_EPOCH","CookedChicken_EPOCH","CookedRabbit_EPOCH","ItemTunaCooked","ItemSeaBassCooked","ItemTroutCooked","FoodSnooter","FoodMeeps"] call BIS_fnc_selectRandom;
    	_drink = ["ItemSodaRbull","ItemSodaOrangeSherbet","ItemSodaPurple","ItemSodaMocha","ItemSodaBurst","FoodWalkNSons","WhiskeyNoodle"] call BIS_fnc_selectRandom;
    	_uniform = ["U_C_Scientist","U_C_Journalist","U_C_WorkerCoveralls","U_C_Poor_1","U_C_Poloshirt_redwhite","U_C_Poloshirt_salmon","U_C_Poloshirt_tricolour","U_C_Poloshirt_burgundy","U_C_Poloshirt_blue","U_C_Poloshirt_stripped"] call BIS_fnc_selectRandom;
    	_vest = ["V_1_EPOCH","V_2_EPOCH","V_3_EPOCH","V_4_EPOCH","V_5_EPOCH","V_16_EPOCH","V_1_EPOCH","V_2_EPOCH","V_3_EPOCH","V_4_EPOCH","V_5_EPOCH"] call BIS_fnc_selectRandom;
    	_hat = ["H_39_EPOCH","H_40_EPOCH","H_41_EPOCH","H_42_EPOCH","H_43_EPOCH","H_44_EPOCH","H_45_EPOCH","H_46_EPOCH","H_47_EPOCH","H_48_EPOCH","H_49_EPOCH","H_50_EPOCH","H_51_EPOCH","H_52_EPOCH","H_53_EPOCH","H_54_EPOCH","H_55_EPOCH","H_56_EPOCH","H_57_EPOCH","H_58_EPOCH","H_59_EPOCH","H_60_EPOCH","H_61_EPOCH","H_62_EPOCH","H_63_EPOCH","H_64_EPOCH","H_65_EPOCH","H_66_EPOCH","H_67_EPOCH","H_68_EPOCH","H_69_EPOCH","H_70_EPOCH","H_71_EPOCH","H_72_EPOCH","H_73_EPOCH","H_74_EPOCH","H_75_EPOCH","H_76_EPOCH","H_77_EPOCH","H_78_EPOCH","H_79_EPOCH","H_80_EPOCH","H_81_EPOCH","H_82_EPOCH","H_83_EPOCH","H_84_EPOCH","H_85_EPOCH"] call BIS_fnc_selectRandom;
    	sleep 4;
    	_player = player;
    			
    	_player addVest _vest;
    	_player addHeadgear _hat;
    	_player addWeapon _pistol;
    	_player addMagazine _mag;
    	_player addMagazine _item;
    	_player addMagazine _food;
    	_player addMagazine _drink;
    	_player addWeapon "EpochRadio0";
    	EPOCH_playerCrypto = 5;
    	
    	cutText [format[" %1 \n %2 \n %3 \n %4 \n %5 \n %6 \n %7",_pistol,_mag,_item,_food,_drink,_uniform,_vest] , "PLAIN DOWN"];
    	//hint format [" %1 \n %2 \n %3 \n %4 \n %5 \n %6 \n %7",_pistol,_mag,_item,_food,_drink,_uniform,_vest];
    	//hint format [" Alive %1 ",EPOCH_playerAliveTime];
    			
    			
    	_modelMale = (typeOF player == "Epoch_Male_F");
        _modelFemale = (typeOF player == "Epoch_Female_F");	
            
        if (_modelFemale) then {
            player forceAddUniform "U_BasicBodyFemale";
            };
        if (_modelMale) then {
        player forceAddUniform _uniform;
            };        	
    	newPlayer = false;
    } else {
    hint "Standard Loadout Already Supplied";
    };  	
    		 

     

    and my OnPlayerRespawn.sqf just contains

    newPlayer = true;

     

     

     

     

    EDIT:

    It now works as the time alive check (EPOCH_playerAliveTime == 0) stops it from executing again after every login

    But it still executes the script and the sensor everytime I login no matter where I am at.

    I get the you have left the clone room hint and the standard loadout already supplied hint everytime I login so the script still executes everywhere.

    The money also doesn't save that is given in the script either.

     

    If anyone has any ideas please share! thanks

  4. Omg just looked at those files in my post above and it seems I used different names for them in the different sqf files and that MIGHT be the only issue with my logic there other than prettifying it and changing the variables to arrays so multiple mission Info can be displayed etc

    Ha yea thats what I was looking at mainly :P

     

    Edit- let me know if that change works out for you

  5. Now it might be what you just posted, but in your spaceinterupt, I don't see anywhere where you define MissionName,MissionText so how would it know what to call? but better yet you could have it activate on a keypress.. like you have but instead of going through and creating the hintC there (which isn't the best solution) have it exec a .sqf file..

     

    SO, your code would look like this (or something like it)

    //Pressing 7 brings up Mission List
    if (_dikCode == 0x08) then {
            if("ItemRadio" in weapons player) then {
                _nill = execvm "custom\hint.sqf";
            };
        };
    
    
    //Inside hint.sqf
    
    _MName = definehere;
    _MText = definehere;
    hintSilent parseText format ["Current Mission %1 \n Description: %2",_MName,_MText];
    
    
    

    That would allow you to make more edits and keep it cleaner etc

  6. xbow is close(wrong format for the if statement, its a bit off), I don't think it will work correctly, this should work for you.. 

    _humanity = player getVariable["humanity",0];
    
    if ((_humanity < 5000)) && (_humanity > -5000)) then {
    //exec code
    };
    
×
×
  • Create New...