Jump to content

Psyfer

Member
  • Posts

    20
  • Joined

  • Last visited

Posts posted by Psyfer

  1. Hi,

    I have no true idea if this has anything to do with the above, but it does relate so may be connected in some way.

    I noticed in the DB the hitpoints field of the ori_ZAZ968M that it was truncated once I had installed the origins upgrade script ( I cannot say it was this script and I do not personally think it is, but as I did not check what the data looked like before, I assume the hitpoint field data is the same). There are some missing comma, close brackets at the end of the field entry.

    I thought at the time this might be due to the long strings for the names used and it was making the field of this particular vehicle too long for the DB entry in some way.

    A check revealed this is the case somehow, the truncated length is 512 chars, which is the field length as the epoch.sql list it as:

    `Hitpoints` varchar(512) NOT NULL DEFAULT '[]',

    It did seem to be just the classname ori_ZAZ968M, but it is possible there could be others as I did not make a thorough check of all the class names.

    I also wondered what the origins dev folk had done about this and if they had the problem at all, though I havn't checked any origins forums to see if anyone is reporting errors.

    I tried editing it correctly in phpMyAdmin and received an error message I forget the exact line but it also suggested the field text was too long.

    This might be the reason that on restart when the hitpoint field is read, being incorrect the classname is being skipped.

    I did check a few of the other origins vehicles and found them all to be correctly listing the hitpoints field, so just mentally noted that this vehicle might show problems down the line as well as possibly others.

    Is it possible a simple fix is just to change the line above to something like:

    `Hitpoints` varchar(1024) NOT NULL DEFAULT '[]',

    in the sql file and then create a new DB?

    My sql is sadly low level so I just don't know, but if I was trying something this is where I would start looking.

    Of course, this is all breadcrumbs and theory to me at this stage until someone with the knowledge can verify.

  2. Hi,

     

    Make sure

        DZMSSaveVehicles = true;

    in DZMSConfig.sqf.

     

    Comment out the line:

        [_vehicle] ExecVM DZMSSaveVeh;
        
    in the DZMS missions files (SM1.sqf etc).

     

    In DZMSFunctions.sqf there is a function called DZMSSetupVehicle.

    change this line:

    	if (!(DZMSSaveVehicles)) then {
    		_object addEventHandler ["GetIn",{
    			_nil = [nil,(_this select 2),"loc",rTITLETEXT,"Warning: This vehicle will disappear on server restart!","PLAIN DOWN",5] call RE;
    		}];
    	};
    

    to this:

    	if (!(DZMSSaveVehicles)) then {
    		_object addEventHandler ["GetIn",{
    			_nil = [nil,(_this select 2),"loc",rTITLETEXT,"Warning: This vehicle will disappear on server restart!","PLAIN DOWN",5] call RE;
    		}];
    	} else {
    		_object addEventHandler ["GetIn",{
    			_nil = [_this select 0] ExecVM DZMSSaveVeh;
    		}];
    	};
    

    This should work, although there is probably a better way to do it.

  3. Hi,

     

    The error in Line 85 is because the code is expecting an array, with the select command, but it is reporting _primarymagazine as a string (classname).

     

    I have not really used Fmission and this code is not tested but might be worth a try. It is where I would start if I was doing the edit I think you are trying to do.

     

    /*
    	File Name: FMission_M1_Assassination.sqf
    	File Created: 2/26/2014
    	File Version: 1.2
    	File Author: Foamy 
    	File Last Edit Date: 3/26/2014
    	File Description: Assassination Mission (M1)
    */
    
    // CHECK FOR ANOTHER MISSION 1 RUNNING START ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    
    	if (isNil "EPOCH_MISSION1_RUNNING") then 
    	{
    	EPOCH_MISSION1_RUNNING = false;
    	};
    
    	if (EPOCH_MISSION1_RUNNING) exitWith 
    	{
    	diag_log("MISSION 1 already running");
    	};
    
    // CHECK FOR ANOTHER MISSION 1 RUNNING END ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    
    private ["_missionSpawnChance","_spawnMarker","_spawnRadius","_markerRadius","_markerColor","_loot","_loot_lists","_loot_box","_wait_time","_spawnRoll","_position","_loot_pos","_base","_aiunit_spawn_pos","_aivehicle_spawn_pos","_aiheli_spawn_pos","_targetunitsAlive","_targetgroup","_target1","_attackgroup","_attacker1","_attacker2","_aiunit1","_aiunit2","_aiunit3","_aiunit4","_aiunit5","_timeout"];
    
    diag_log("MISSION 1: Assassination - Script Started");
    
    _missionSpawnChance =  .40;
    _spawnRoll = random 1;
    
    diag_log("MISSION 1: Assassination - Checking MissionSpawnChance");
    if (_spawnRoll > _missionSpawnChance) exitWith 
    {
    diag_log format ["MISSION 1: Assassination - Failed with %1 it needed to be lower than %2",_spawnRoll,_missionSpawnChance];
    };
    
    sleep .5;
    diag_log("MISSION 1: Assassination - Mission SpawnChance Success");
    
    sleep .5;
    diag_log("MISSION 1: Assassination - Mission Script Started");
    
    EPOCH_MISSION1_RUNNING = true;
    /*
    //_loot_box = "GuerillaCacheBox";
    //_loot_lists = [
    [
    ["M9SD","ItemMachete","Binocular"],
    ["15Rnd_9x19_M9SD","15Rnd_9x19_M9SD","15Rnd_9x19_M9SD","ItemGoldBar","ItemGoldBar","ItemGoldBar","ItemGoldBar","ItemTrashToiletpaper"],
    ["DZ_CivilBackpack_EP1"]
    ],
    [
    ["DMR","NVGoggles","Binocular_Vector"],
    ["20Rnd_762x51_DMR","20Rnd_762x51_DMR","20Rnd_762x51_DMR","ItemSodaMdew","PipeBomb","ItemAntibiotic","ItemGoldBar10oz"],
    ["DZ_GunBag_EP1"]
    ],
    [
    ["MP5SD","ItemFlashlightRed","ItemCompass"],
    ["30Rnd_9x19_MP5SD","30Rnd_9x19_MP5SD","30Rnd_9x19_MP5SD","ItemSodaMdew","ItemWire","ItemSilverBar10oz","ItemSilverBar10oz","ItemSilverBar10oz"],
    ["DZ_TerminalPack_EP1"]
    ],
    [
    ["SVD_CAMO","ItemWatch","Binocular"],
    ["10Rnd_762x54_SVD","10Rnd_762x54_SVD","10Rnd_762x54_SVD","ItemSodaMdew","ItemBurlap","ItemGoldBar","ItemGoldBar","ItemGoldBar"],
    ["DZ_Backpack_EP1"]
    ],
    [
    ["M4A1_AIM_SD_CAMO","ItemGPS","Binocular"],
    ["30Rnd_556x45_StanagSD","30Rnd_556x45_StanagSD","30Rnd_556x45_StanagSD","ItemSodaRbull","ItemGoldBar10oz","ItemGoldBar10oz"],
    ["DZ_ALICE_Pack_EP1"]
    ]
    ];
    _loot = _loot_lists call BIS_fnc_selectRandom;
    */
    
    _sniperriflearray = ["SVD_CAMO","M40A3","M14_EP1","SVD_des_EP1"];
    _sniperrifle = _sniperriflearray select (floor (random (count _sniperriflearray)));  //select a rifle from the array
    _snipermagazine = getArray (configFile >> "CfgWeapons" >> _sniperrifle >> "magazines") select 0;  //select the mag for rifle
    
    mission_despawn_timer = 1200;
    _wait_time = 900;
    _spawnRadius = 5000;
    _spawnMarker = 'center';
    _markerRadius = 350; // Radius the loot can spawn and used for the marker
    _markerColor = "ColorBlue";
    _textMarker_IconType = "mil_objective";
    _markerText = "Mission: Assassination";
    _markerBrush = "SOLID";
    
    // Random location
    _position = [getMarkerPos _spawnMarker,0,_spawnRadius,10,0,20,0] call BIS_fnc_findSafePos;
    _loot_pos = [_position,0,(_markerRadius - 100),10,0,20,0] call BIS_fnc_findSafePos;
    
    // FMarker Launch
    [_position,_loot_pos,_markerRadius,_markerColor,false,_textMarker_IconType,_markerText,_markerBrush] execVM "\z\addons\dayz_server\addons\FMission\FMarker\FMarker1.sqf";
    
    diag_log(format["MISSION 1: Assassination - Spawning loot event at %1", _position]);
     
    _aiunit_spawn_pos = [_loot_pos, 30, 50, 30, 0, 20, 0] call BIS_fnc_findSafePos;
    _aivehicle_spawn_pos = [_loot_pos, 30, 50, 30, 0, 20, 0] call BIS_fnc_findSafePos;
    _aiheli_spawn_pos = [_loot_pos, 30, 50, 30, 0, 20, 0] call BIS_fnc_findSafePos;
    	
    _base = createVehicle ["Land_fortified_nest_big",_loot_pos,[], 0, "CAN_COLLIDE"];
    _base setPos _loot_pos;
    
    sleep 1;
    
    diag_log("MISSION 1: Assassination - Loading -=FAI Units=- Started");
    
    _aiunit1 = [_aiunit_spawn_pos,50,4,"Bandit",_loot_pos,"M1"] execVM "\z\addons\dayz_server\addons\FMission\FAI\FAI_Create_Unit.sqf";
    
    _aiunit2 = [_aiunit_spawn_pos,50,4,"Sniper",_loot_pos,"M1"] execVM "\z\addons\dayz_server\addons\FMission\FAI\FAI_Create_Unit.sqf";
    
    _aiunit3 = [_aiunit_spawn_pos,50,4,"Medic",_loot_pos,"M1"] execVM "\z\addons\dayz_server\addons\FMission\FAI\FAI_Create_Unit.sqf";
    
    _aiunit4 = [_aiunit_spawn_pos,50,4,"Bandit",_loot_pos,"M1"] execVM "\z\addons\dayz_server\addons\FMission\FAI\FAI_Create_Unit.sqf";
    
    _aiunit5 = [_aiunit_spawn_pos,50,4,"Bandit",_loot_pos,"M1"] execVM "\z\addons\dayz_server\addons\FMission\FAI\FAI_Create_Unit.sqf";
    
    sleep 10;
    diag_log("MISSION 1: Assassination - Loading -=FAI=- Completed");
    
    sleep .5;
    diag_log("MISSION 1: Assassination - Loading -=FAI Vehicle=- Started");
    _aiVehicle = [_aivehicle_spawn_pos,_loot_pos,150,"M1"] execVM "\z\addons\dayz_server\addons\FMission\FAI\FAI_Create_Vehicle.sqf";
    sleep 1;
    diag_log("MISSION 1: Assassination - Loading -=FAI Vehicle=- Completed");
    
    sleep .5;
    diag_log("MISSION 1: Assassination - Loading -=FAI Heli=- Started");
    _aiHeli = [_aiheli_spawn_pos,_loot_pos,250,"M1"] execVM "\z\addons\dayz_server\addons\FMission\FAI\FAI_Create_Heli.sqf";
    sleep 1;
    diag_log("MISSION 1: Assassination - Loading -=FAI Heli=- Completed");
    
    sleep 1;
    
    diag_log("MISSION 1: Assassination - Creating Assassination Target");
    // Add Assassination Target
    _targetgroup = createGroup civilian;
    		_target1 = _targetgroup createUnit ["Hooker4", _base, [], 0, "Form"];
    			_target1 setUnitPos "DOWN";
    			_target1 disableAI "MOVE";
    			_target1 setCaptive true;
    			removeAllItems _target1;
    			
    // Add Interior Guards
    diag_log("MISSION 1: Assassination - Spawning Interior Attackers");
    	_attackgroup = createGroup east;
    	
    		_attacker1 = _attackgroup createUnit ["TK_INS_Soldier_3_EP1", _base, [], 0, "Form"];
    			_attacker1 setUnitPos "AUTO";
    			_null = [_attacker1] execVM "\z\addons\dayz_server\addons\FMission\FLoot\FLoot_Bandit.sqf";
    			_attacker1 setUnitPos "Middle";
    		
    		_attacker2 = _attackgroup createUnit ["TK_Soldier_Medic_EP1", _base, [], 0, "Form"];
    			_attacker2 setUnitPos "AUTO";
    			_null = [_attacker2] execVM "\z\addons\dayz_server\addons\FMission\FLoot\FLoot_Medic.sqf";
    			_attacker2 setUnitPos "Middle";
    			
    			_attackgroup setCombatMode "RED";
    			_attackgroup setBehaviour "STEALTH";
    
    // Add a chance to spawn a Mine Field
    [_loot_pos,east,.50] execVM "\z\addons\dayz_server\addons\FMission\FMinefield\FMinefield.sqf";
    
    [nil,nil,rTitleText,"MISSION: Assassination - A high profile target has been located at a temporary camp. Assassinate the target before they leave the area!", "PLAIN",10] call RE;			
    			
    diag_log("MISSION 1: Assassination - Waiting...");
    _timeout = time + mission_despawn_timer;
    waitUntil 
    {
    _targetunitsAlive = {alive _x} count (units _targetgroup);
    ((time > _timeout) || (_targetunitsAlive < 1))
    };
    
    _targetunitsAlive = {alive _x} count (units _targetgroup);
    if (_targetunitsAlive < 1) then
    {
    [nil,nil,rTitleText,"MISSION: Target Eliminated, Good Job.", "PLAIN",10] call RE;
    
    		// Create loot box
    		diag_log("MISSION 1: Assassination - Target eliminated creating loot box");
    		_loot_box = createVehicle [_loot_box,_loot_pos,[], 0, "NONE"];
    		_loot_box setPos _loot_pos;
    		clearMagazineCargoGlobal _loot_box;
    		clearWeaponCargoGlobal _loot_box;
    		clearBackpackCargoGlobal _loot_box;
    				 
    		// Add loot
    		diag_log("MISSION 1: Assassination - Loot box created, adding loot to loot box");
    		/*
    		{
    		_loot_box addWeaponCargoGlobal [_x,1];
    		} forEach (_loot select 0);
    		{
    		_loot_box addMagazineCargoGlobal [_x,1];
    		} forEach (_loot select 1);
    		{
    		_loot_box addBackpackCargoGlobal [_x,1];
    		} forEach (_loot select 2);
    		*/
    		_loot_box addWeaponCargoGlobal [_sniperrifle,1];
    		_loot_box addMagazineCargoGlobal [_snipermagazine,(floor(random 5) + 3)];	
    		// Wait
    		sleep _wait_time;
     
    		// Clean up
    		EPOCH_MISSION1_RUNNING = false;
    		deleteVehicle _base;
    		deleteVehicle _loot_box;
    		{ deleteVehicle _x } forEach units _targetgroup;
    		deleteGroup _targetgroup;
    		{ deleteVehicle _x } forEach units _attackgroup;
    		deleteGroup _attackgroup;
    		diag_log("MISSION 1: Assassination - Script Finished");
    }			
    else
    {
    [nil,nil,rTitleText,"MISSION: Assassination Failed - The target escaped.", "PLAIN",10] call RE;
    		// Clean up
    		EPOCH_MISSION1_RUNNING = false;
    		deleteVehicle _base;
    		{ deleteVehicle _x } forEach units _targetgroup;
    		deleteGroup _targetgroup;
    		{ deleteVehicle _x } forEach units _attackgroup;
    		deleteGroup _attackgroup;
    		diag_log("MISSION 1: Assassination - Script Finished");
    };
    

  4. Hi,

    You do not mention which AI Missions system you are using.

    If you are using DZMS then you could add this to DZMSBox.sqf:

    if (_type == "sniper_crate") then {
            _sniperriflearray = ["SVD_CAMO","M40A3","M14_EP1","SVD_des_EP1"];
            _sniperrifle = _sniperriflearray select (floor (random (count _sniperriflearray)));  //select a rifle from the array
            _snipermagazine = getArray (configFile >> "CfgWeapons" >> _sniperrifle >> "magazines") select 0;  //select the mag for rifle
            _magcount = floor(random 5) + 3;  //range min 3 max 7
            _crate addWeaponCargoGlobal [_sniperrifle,1];  //add the rifle
            _crate addMagazineCargoGlobal [_snipermagazine,_magcount];  //adds the rnd num mags
        };
    
    



    and call it from a mission with:

    [_crate,"sniper_crate"] ExecVM DZMSBoxSetup;

    I hope this helps.

  5. Hi,

     

    When I first started to figure this bit of code out, I started in the editor. I loaded up epoch and origins and then ctrl E for editor , and dropped into a mission.sqf file all the sign classes I could find in the editor vehicles list.

    Then I started to fiddle with the code to make the jpg show up. I found by putting this:

     

    this setObjectTexture [0, "test.jpg"]

     

    into the object init field for the "WarfareBunkerSign" and putting the jpg file in the editor mission folder I managed to get an image onto the sign.

     

    Looking at the code inside the editor mission.sqf Arma translates the above to:

     

    _this setVehicleInit "this setObjectTexture [0, ""test.jpg""]";

     

    The jpg is 512x512 and that was the format I found that worked.

     

    So when I came to add it to my testserver, the mission.sqf section went into the mission.sqf and I just dropped the jpg's into the mission root folder.

     

    I do seem to remember fiddling around with the jpg format and which type of sign it was before I got it to work.

     

    As soon as I got it working on the "WarfareBunkerSign" I didn't test out any more sign types. If you saw the product of my skills with images (think non-existent, the images I have are placeholders for what my minds eye can see), you would immediately know why.

  6. Hi,

     

    Sorry for wait, I had to clean it up a bit, and then I had to test it to make sure it still worked.

     

    This is my mission.sqf in \z\addons\dayz_server\missions\DayZ_Epoch_13.Tavi

     

    if (isServer) then {
    
      call compile preProcessFileLineNumbers "\z\addons\dayz_server\missions\DayZ_Epoch_13.Tavi\miscvendors.sqf";
      call compile preProcessFileLineNumbers "\z\addons\dayz_server\missions\DayZ_Epoch_13.Tavi\origins.sqf";
    
    _unit_124 = objNull;
    if (true) then
    {
      _this = createAgent ["GUE_Woodlander1", [23386,5298, 0], [], 0, "CAN_COLLIDE"];
      _unit_124 = _this;
      _this setDir 90;
      _this setVehicleInit "this allowDammage false; this disableAI 'FSM'; this disableAI 'MOVE'; this disableAI 'AUTOTARGET'; this disableAI 'TARGET'; this setBehaviour 'CARELESS'; this forceSpeed 0;";
      _this setUnitAbility 0.60000002;
      _this allowDammage false; _this disableAI 'FSM'; _this disableAI 'MOVE'; _this disableAI 'AUTOTARGET'; _this disableAI 'TARGET'; _this setBehaviour 'CARELESS'; _this forceSpeed 0;_this enableSimulation false;
    };
    
    _unit_134 = objNull;
    if (true) then
    {
      _this = createAgent ["Profiteer2_EP1", [23390, 5324, 0], [], 0, "CAN_COLLIDE"];
      _unit_134 = _this;
      _this setDir 270;
      _this setVehicleInit "this allowDammage false; this disableAI 'FSM'; this disableAI 'MOVE'; this disableAI 'AUTOTARGET'; this disableAI 'TARGET'; this setBehaviour 'CARELESS'; this forceSpeed 0;";
      _this setUnitAbility 0.60000002;
      _this allowDammage false; _this disableAI 'FSM'; _this disableAI 'MOVE'; _this disableAI 'AUTOTARGET'; _this disableAI 'TARGET'; _this setBehaviour 'CARELESS'; _this forceSpeed 0;_this enableSimulation false;
    };
    
    _unit_135 = objNull;
    if (true) then
    {
      _this = createAgent ["Worker4", [3117.05,2450.71,21.8015], [], 0, "CAN_COLLIDE"];
      _unit_135 = _this;
      _this setDir 40;
      _this setVehicleInit "this allowDammage false; this disableAI 'FSM'; this disableAI 'MOVE'; this disableAI 'AUTOTARGET'; this disableAI 'TARGET'; this setBehaviour 'CARELESS'; this forceSpeed 0;";
      _this setUnitAbility 0.60000002;
      _this allowDammage false; _this disableAI 'FSM'; _this disableAI 'MOVE'; _this disableAI 'AUTOTARGET'; _this disableAI 'TARGET'; _this setBehaviour 'CARELESS'; _this forceSpeed 0;_this enableSimulation false;
    };
    
    
    _unit_138 = objNull;
    if (true) then
    {
      _this = createAgent ["GUE_Commander", [14804.3,9939.08,0.675935], [], 0, "CAN_COLLIDE"];
      _unit_138 = _this;
      _this setDir 0;
      _this setVehicleInit "this allowDammage false; this disableAI 'FSM'; this disableAI 'MOVE'; this disableAI 'AUTOTARGET'; this disableAI 'TARGET'; this setBehaviour 'CARELESS'; this forceSpeed 0;";
      _this setUnitAbility 0.60000002;
      _this allowDammage false; _this disableAI 'FSM'; _this disableAI 'MOVE'; _this disableAI 'AUTOTARGET'; _this disableAI 'TARGET'; _this setBehaviour 'CARELESS'; _this forceSpeed 0;_this enableSimulation false;
    };
    
    _unit_13811 = objNull;
    if (true) then
    {
      _this = createAgent ["UN_CDF_Soldier_Pilot_EP1", [1157.27,19219.2,0.00149918], [], 0, "CAN_COLLIDE"];
      _unit_13811 = _this;
      _this setDir 180;
      _this setVehicleInit "this allowDammage false; this disableAI 'FSM'; this disableAI 'MOVE'; this disableAI 'AUTOTARGET'; this disableAI 'TARGET'; this setBehaviour 'CARELESS'; this forceSpeed 0;";
      _this setUnitAbility 0.60000002;
      _this allowDammage false; _this disableAI 'FSM'; _this disableAI 'MOVE'; _this disableAI 'AUTOTARGET'; _this disableAI 'TARGET'; _this setBehaviour 'CARELESS'; _this forceSpeed 0;_this enableSimulation false;
    };
    
    _unit_13812 = objNull;
    if (true) then
    {
      _this = createAgent ["Soldier_Sniper_PMC", [22271.9,19853.2,0.00143862], [], 0, "CAN_COLLIDE"];
      _unit_13812 = _this;
      _this setDir 90;
      _this setVehicleInit "this allowDammage false; this disableAI 'FSM'; this disableAI 'MOVE'; this disableAI 'AUTOTARGET'; this disableAI 'TARGET'; this setBehaviour 'CARELESS'; this forceSpeed 0;";
      _this setUnitAbility 0.60000002;
      _this allowDammage false; _this disableAI 'FSM'; _this disableAI 'MOVE'; _this disableAI 'AUTOTARGET'; _this disableAI 'TARGET'; _this setBehaviour 'CARELESS'; _this forceSpeed 0;_this enableSimulation false;
    };
    
    _unit_13813 = objNull;
    if (true) then
    {
      _this = createAgent ["GUE_Soldier_Pilot", [22746,20069.6,0.00143862], [], 0, "CAN_COLLIDE"];
      _unit_13813 = _this;
      _this setDir 270;
      _this setVehicleInit "this allowDammage false; this disableAI 'FSM'; this disableAI 'MOVE'; this disableAI 'AUTOTARGET'; this disableAI 'TARGET'; this setBehaviour 'CARELESS'; this forceSpeed 0;";
      _this setUnitAbility 0.60000002;
      _this allowDammage false; _this disableAI 'FSM'; _this disableAI 'MOVE'; _this disableAI 'AUTOTARGET'; _this disableAI 'TARGET'; _this setBehaviour 'CARELESS'; _this forceSpeed 0;_this enableSimulation false;
    };
    
    _vehicle_46 = objNull;
    if (true) then
    {
      _this = createVehicle ["Land_bags_stack_EP1", [16093.4,16271.3,0.00168443], [], 0, "CAN_COLLIDE"];
      _vehicle_46 = _this;
      _this setDir 119.87155;
      _this setPos [16093.4,16271.3,0.00168443];
    };
    
    _vehicle_47 = objNull;
    if (true) then
    {
      _this = createVehicle ["Paleta2", [16098.4,16271.3,0.00168443], [], 0, "CAN_COLLIDE"];
      _vehicle_47 = _this;
      _this setDir 130.87155;
      _this setPos [16098.4,16271.3,0.00168443];
    };
    
    _vehicle_48 = objNull;
    if (true) then
    {
      _this = createVehicle ["Paleta2", [16095.7,16265.1,0.00174451], [], 0, "CAN_COLLIDE"];
      _vehicle_48 = _this;
      _this setDir 100.87155;
      _this setPos [16095.7,16265.1,0.00174451];
    };
    _vehicle_49 = objNull;
    if (true) then
    {
      _this = createVehicle ["WarfareBunkerSign", [16050,16225,0], [], 0, "CAN_COLLIDE"];
      _vehicle_49 = _this;
      _this setDir 260;
      _this setVehicleInit "this setObjectTexture [0, ""map1a.jpg""]";
      _this setPos [16050,16225,0];
    }; 
    
    _vehicle_50 = objNull;
    if (true) then
    {
      _this = createVehicle ["Land_bags_stack_EP1", [18521,5061.61,0.00195622], [], 0, "CAN_COLLIDE"];
      _vehicle_50 = _this;
      _this setDir 119.87155;
      _this setPos [18521,5061.61,0.00195622];
    };
    
    _vehicle_50 = objNull;
    if (true) then
    {
      _this = createVehicle ["Paleta2", [18515.5,5055.02,0.00099802], [], 0, "CAN_COLLIDE"];
      _vehicle_51 = _this;
      _this setDir 130.87155;
      _this setPos [18515.5,5055.02,0.00099802];
    };
    
    _vehicle_52 = objNull;
    if (true) then
    {
      _this = createVehicle ["Paleta2", [18519.1,5048.55,0.00206304], [], 0, "CAN_COLLIDE"];
      _vehicle_52 = _this;
      _this setDir 100.87155;
      _this setPos [18519.1,5048.55,0.00206304];
    };
    _vehicle_53 = objNull;
    if (true) then
    {
      _this = createVehicle ["WarfareBunkerSign", [18420.1,5062.36,0.00113297], [], 0, "CAN_COLLIDE"];
      _vehicle_53 = _this;
      _this setDir 180;
      _this setVehicleInit "this setObjectTexture [0, ""map1b.jpg""]";
      _this setPos [18420.1,5062.36,0.00113297];
    
    };
    
    _vehicle_530 = objNull;
    if (true) then
    {
      _this = createVehicle ["WarfareBunkerSign", [23378.1,5296.04,0.00143909], [], 0, "CAN_COLLIDE"];
      _vehicle_530 = _this;
      _this setDir 180;
      _this setVehicleInit "this setObjectTexture [0, ""map1c.jpg""]";
      _this setPos [23378.1,5296.04,0.00143909];
    
    };
    _vehicle_521 = objNull;
    if (true) then
    {
      _this = createVehicle ["Paleta2", [23385.6,5295.4,0.00143862], [], 0, "CAN_COLLIDE"];
      _vehicle_521 = _this;
      _this setDir 190;
      _this setPos [23385.6,5295.4,0.00143862];
    };
    _vehicle_522 = objNull;
    if (true) then
    {
      _this = createVehicle ["Misc_palletsfoiled_heap", [23388.5,5292.2,0.00143909], [], 0, "CAN_COLLIDE"];
      _vehicle_522 = _this;
      _this setDir 270;
      _this setPos [23388.5,5292.2,0.00143909];
    };
    _vehicle_523 = objNull;
    if (true) then
    {
      _this = createVehicle ["MAP_GuerillaCache", [23394.4,5298.64,0.00143909], [], 0, "CAN_COLLIDE"];
      _vehicle_523 = _this;
      _this setDir 90;
      _this setPos [23394.4,5298.64,0.00143909];
    };
    _vehicle_524 = objNull;
    if (true) then
    {
      _this = createVehicle ["Land_stand_small_EP1", [23380.4,5298.32,0.00143862], [], 0, "CAN_COLLIDE"];
      _vehicle_524 = _this;
      _this setDir 270;
      _this setPos [23380.4,5298.32,0.00143862];
    };
    _vehicle_525 = objNull;
    if (true) then
    {
      _this = createVehicle ["Land_bags_stack_EP1", [23383.2,5292.25,0.00143909], [], 0, "CAN_COLLIDE"];
      _vehicle_525 = _this;
      _this setDir 90;
      _this setPos [23383.2,5292.25,0.00143909];
    };
    
    processInitCommands;
    };
    

  7. Hi,

     

    Just checking,

     

    You have this:

     

    processInitCommands;

     

    after your setVehicleInit command, I have this sign code in my mission.sqf with my traders stuff and that file has processInitCommands; at the bottom.

     

    I am not sure if you will need it or not, but its there in my file.

  8. Hi,

    I too have the line:

    BIS_Effects_Burn = compile preprocessFileLineNumbers "\ca\Data\ParticleEffects\SCRIPTS\destruction\burn.sqf";
    

    in my compiles.sqf.
     

    Originally, I have used a combination of the above as I could not seem to easily get the function BIS_Effects_Burn to work when creating the object in my AI mission files.

    I use a modified version of DZMS on my testserver. To spawn a burning object nearby a mission location inside the DZMS mission file (e.g. SM1.sqf) I used the code below:

    _coords = [_x,_y,_z]; 
    _wrecktype = "MQ9PredatorWreck";
    _spawnFire = true; 
    _fadeFire = false; 
    _crashdir = floor(random 360); 
    _crashpos = [_coords, 50, 100, 0, 0, 0, 0] call BIS_fnc_findSafePos; 
    _crash = createVehicle [_wrecktype, _crashpos, [], 0, "CAN_COLLIDE"]; 
    _crash setDir _crashdir; 
    _crash setVehicleLock "LOCKED"; 
    PVDZE_serverObjectMonitor set [count PVDZE_serverObjectMonitor,_crash]; 
    if (_spawnFire) then {
        PVDZE_obj_Fire = [_crash, 4, time, false, _fadeFire]; 
        publicVariable "PVDZE_obj_Fire"; 
        _crash setVariable ["fadeFire",_fadeFire,true]; 
        }; 
    

    The problem I found was I think with this section of code:
     

    PVDZE_obj_Fire = [_crash, 4, time, false, false];
    publicVariable "PVDZE_obj_Fire";
    _crash setVariable ["fadeFire",false,true];
    

    So far, I have not been able to make this JIP compatible, if I logged out and in again there was no fire or smoke any more on the wreck.

    To get around this for the moment I use the below code in my init.sqf.

    if (!isDedicated) then {
    	_crasharray = ["MQ9PredatorWreck"];
    	_crashtype = allmissionobjects "MQ9PredatorWreck";
    	{
    	if (typeOf _x in _crasharray) then {
    		dayzFire = [_x,4,0,false,false];  
    		nul=dayzFire spawn BIS_Effects_Burn;		
    		};
    	} forEach _crashtype;
    };
    

    Thank you Tech_Support as I figured out how to use BIS_Effects_Burn with the setVehicleInit command in the DZMS files like so:

    _crash setVehicleInit "[this,4,time,false,false] spawn BIS_Effects_Burn;";
    processInitCommands;
    

    This though seems to have the same problem with logging, as when I log out and in again the object is no longer burning and I am still having to use the above section in the init.sqf.

    I am probably missing something here, but this seems the only way I can get it to work at the moment.

  9. Hi,

    Just checking, have you created a custom ui_selectSlot.sqf and put this section?

    	// Add extra context menus
    	_erc_cfgActions = (missionConfigFile >> "ExtraRc" >> _item);
    	_erc_numActions = (count _erc_cfgActions);
    	if (isClass _erc_cfgActions) then {
    		for "_j" from 0 to (_erc_numActions - 1) do 
    		{
    			_menu = 	_parent displayCtrl (1600 + _j + _numActions);
    			_menu ctrlShow true;
    			_config = 	(_erc_cfgActions select _j);
    			_text = 	getText	(_config >> "text");
    			_script = 	getText	(_config >> "script");
    			_height = _height + (0.025 * safezoneH);
    			uiNamespace setVariable ['uiControl', _control];
    			_menu ctrlSetText _text;
    			_menu ctrlSetEventHandler ["ButtonClick",_script];
    		};
    	};
    	_pos set [3,_height];
    

        near the bottom, just above:

    	_group ctrlShow true;
    	ctrlSetFocus _group;
    	_group ctrlSetPosition _pos;
    	_group ctrlCommit 0;
    
  10. Hi,

    I tried this script and got it working, its very nice, thank you for writing it.

    I placed the fn_selfactions.sqf part and added the An2_ammo.sqf.

    Then I added your part Calamity and found it did add the guns but no ammo.

    If you change:

    _object addMagazine "100Rnd_762x51_M240";
    _object addMagazine "100Rnd_762x51_M240";
    _object addMagazine "100Rnd_762x51_M240";
    

    to this:

    _object addMagazineCargoGlobal ["100Rnd_762x51_M240",3];
    

    then the aircraft has 3 magazines in the cargo when you spawn it in.

    You can then add them to your inventory and use the load ammo option.

  11. Hi,

    I'm wondering if you managed to find a solution for this?

    I have one, it sort of works.

    Firstly, I used the scroll menu from Bexs post here:

     

     

    It is in German, but at the time I just wanted the actions to mess around with on my testserver.

    I have also had a play with this Pwnoz0r finding building loot position, I used this in the 3D editor on my tavi test map and it seems to work:

     

    http://opendayz.net/threads/find-building-loot-positions.11031/

     

    Then, I thought of combining them as it was a bit of a pain to keep going to the editor and tabbing out of game to paste the clipboard, so I thought is it possible to add the findlootpos.sqf to the actions script? And it appears to work.

    So, all credit for this goes to Bexs and Pwnoz0r as they have done the leg work.

    Change line 7 in Bexs conig.sqf code to this:

    ["BldgLootPos", [3], "", -5, [["expression", format[_EXECscript1,"lootpos.sqf"]]], "1", "1"],
    

    Create a file lootpos.sqf and copy Pwnoz0r's code into it:

    /*
    	title: Loot Position Finder
    	author: Pwnoz0r
    	description: Find the loot positions within buildings and structures on any map.
    	usage: Load this mission file up in the 2D editor.
    		Once executed the output will simply copy the string to your clipboard. You may then paste that string anywhere.
    		If you would like to change the map simply edit the mission.sqm file to included the addons of another map.
    	version: 1.0
    	
    	Example output: Land_a_stationhouse :: {3.08496,1.78516,-9.47058};
    	modified to output to RPT by adding line 28
    */
    
    
    hint "Show Loot Position";
    
    _building = nearestObject [player, "Building"];
    _relPos = _building worldToModel (getPosATL player);
    _getBuildingName = typeOf nearestBuilding position player;
    
    _timeFactor = time;
    player sideChat format ["Copied to clipboard! :: %1", _timeFactor];
    x = _relPos select 0;
    y = _relPos select 1;
    z = _relPos select 2;
    
    hint format ["%4 :: {%1,%2,%3};", x, y, z, _getBuildingName];
    diag_log text format ["[DEVTOOL] Copied BldgPos to RPT %4 :: {%1,%2,%3};",x, y, z, _getBuildingName];
    
    copyToClipboard format ["%4 :: {%1,%2,%3};", x, y, z, _getBuildingName];
    

    Place this file into the Bexs action menu folder.

    The code when executed places a line into your client RPT file like this:

    [DEVTOOL] Copied BldgPos to RPT Land_SS_hangar :: {0.458984,-14.1797,-5.87254};

    I added the diag_log text format line because I am lazy and did not want to keep tabbing out of the game to paste the clipboard.

    This seems to work in most instances, but not all, there are occasions when the z position seems off, and the loot appears in the air. I have only had a brief look into the code, but my current theory is it seems to sometimes save the z position incorrectly in some cases, could be by a factor of 10?

    But, the bottom line is that it enables you to log into the server and click the mouse wheel a few times in a building writing the spots to the RPT file.

    I tested it on an empty building in the Tavi map "Land_helfenburk", checking first that the building classname did not exist inside the CfgBuildingPos.sqf.

    I then copied the created loot positions in the format:

    class Land_helfenburk: Residential {
            zombieChance = 0.4;
    		minRoaming = 0;
    		maxRoaming = 1;
    		zombieClass[] = {"z_doctor"};
            lootPos[] = {
    		{-1.41846,-2.70215,-3.0079},
    		{0.660645,-0.168945,-3.01373},
    		{2.09277,-0.574707,0.261817},
    		{-0.0195313,0.545898,0.272049},
    		{1.51123,0.129883,4.35992},
    		{-2.8291,-4.90918,4.35992},
    		{-2.40967,-3.98926,8.70453},
    		{1.58105,-4.65332,12.1881},
    		{1.2085,0.155273,12.1881},
    		{-3.12939,-5.21094,12.1881},
    		{-0.44043,-2.75488,12.1881}
    		};
    		lootPosZombie[] = {{-2.81689,0.12207,-3.00396}};
    		};
    

    into my CfgBuildingPos.hpp file.

    Now, the zombie pos is from inside the building, but the zombie appears to spawn outside it about 10 metres away.

    Loot seems to spawn in the building at the positions I clicked the mouse wheel at, as I say every now and then I seem to have a position that seems to have an incorrect z value.

    I hope this helps.

  12. Hi,

     

    I played around with this to create a random bombing script. The below code has a position array BombLocations, currently set for Taviana. You'll have to edit this array for your map if it is not Taviana.

    /*
    Modified epoch event to a random city bombing script. All credit Epoch Devs. filename: RandomCityBombing.sqf
    */	
    private["_place","_name","_coords","_sendwarning","_warning"];
    	
    sleep 60;
    diag_log format["[RANDOM BOMBING]: Running."];
    
    BombLocations = [
    ["Solibor","NameCity",[13999.6,12240.2,0]],
    ["ChrveniGradok","NameCity",[12713.8,14482.6,0]],
    ["Molotovsk","NameCity",[16957.7,12694.3,0]],
    ["Martin","NameCity",[16136.3,13632.5,0]],
    ["Lyepestok","NameCity",[11608.1,15476.1,0]],
    ["Lyubol'","NameCity",[10405.1,16832,0]],
    ["Sevastopol'","NameCity",[15464.8,16269.3,0]],
    ["Sabina","NameCity",[15022.2,9693.54,0]],
    ["Byelov","NameCity",[17319.5,7487.96,0]],
    ["Yaroslav","NameCity",[10164,19080.4,0]],
    ["Ekaterinburg","NameCity",[11020.4,18790.6,0]],
    ["Etanovsk","NameCity",[12664.7,11921,0]],
    ["Kryvoe","NameCity",[9114.96,5402.52,0]],
    ["Komarovo","NameCity",[10591.6,6565.65,0]],
    ["Krasnoznamen'sk","NameCity",[9176.12,8060.1,0]],
    ["NoviDvor","NameCity",[7925.88,6725.89,0]],
    ["Vedich","NameCity",[6705.53,9868.36,0]],
    ["Chernovar","NameCity",[5827.36,9879.22,0]],
    ["BilgradNaMoru","NameCity",[5452.96,8827.01,0]],
    ["Shtangrad","NameCity",[3323.68,7552.9,0]],
    ["Mitrovice","NameCity",[3795.29,7222.12,0]],
    ["Kryvozhopol","NameCity",[3885.24,17724,0]],
    ["Topolka","NameCity",[8881.93,2308.74,0]],
    ["Seven","NameCity",[10985.4,759.202,0]],
    ["Blato","NameCity",[11787.8,747.01,0]],
    ["Alexander","NameCityCapital",[4973.97,17701.7,0]],
    ["Grushnoye","NameCityCapital",[5451.26,14741.8,0]],
    ["Romanov","NameCityCapital",[11626.9,9063.69,0]],
    ["Apshironsk","NameCityCapital",[9179.1,14136.6,0]],
    ["Branibor","NameCityCapital",[7682.46,4312.29,0]],
    ["Vladimir","NameCityCapital",[1942.44,17177,0]]
    ];
    
    DropBombs = {
    
    private ["_bombminrange","_bombmaxrange","_msgbomb1","_targetPos","_bombselect","_bombarray","_bombtype","_bombcount","_newpos"];
    
    _targetPos = _this select 0;
    _msgbomb1 = _this select 1;
    
    _bombminrange = floor (random 50) + 50;
    _bombmaxrange = floor (random 300) + 100;
    
    _bombselect = [];
    _bombarray = [["Bo_GBU12_LGB",[1,2,3,4,5]],["Bo_GBU12_LGB",[1,2,3,4,5,6,7]],["Bo_GBU12_LGB",[1,2,3,4,5,6,7,8,9,10]]];
    _bombselect = _bombarray select (floor (random (count _bombarray)));
    _bombtype = _bombselect select 0;
    _bombcount = _bombselect select 1;
    [nil,nil,rTitleText,_msgbomb1,"PLAIN",10] call RE;
    sleep 15;
    {
    	_newpos = [_targetPos, _bombminrange, _bombmaxrange, 0, 0, 0, 0] call BIS_fnc_findSafePos;
    	bomb = createVehicle [_bombtype, [(_newpos select 0),(_newpos select 1), 100], [], 0, "CAN_COLLIDE"];
    	uisleep 2;
    } forEach _bombcount;
    //sleep 30;
    };
    
    while {true} do {	
    _place = BombLocations select (floor (random (count BombLocations)));
    _name = _place select 0;
    _coords = _place select 2;
    _warning = "Bomb Strike on "+_name+". ETA 2 Minutes!";
    _sendwarning = "Bomb Strike on "+_name+". Take Cover!";
    [nil,nil,rTitleText,_warning, "PLAIN",10] call RE;
    sleep 120;
    0=[_coords,_sendwarning] call DropBombs;
    diag_log format["[RANDOM BOMBING]:RANDOM BOMBING at %1.",_name];
    sleep 150;
    sleep 1; //set this for timer?
    };
    
    

    Default, it cycles every 5 minutes or so.

     

    I just added this line:

    [] spawn RandomCityBombing;
    

    to the bottom of my init.sqf of my mission system, and this line:

    RandomCityBombing = compile preprocessFileLineNumbers "\z\addons\dayz_server\<mission folder>\RandomCityBombing.sqf";
    
    

    to the mission functions.sqf.

     

    Now, I am a baby when it comes to Arma scripting (it's beginning to feel like my teeth are coming through) only been at it seriously for several months, lol. It's taking ages to figure even a little bit of it out, but this seems to work. If there are any glaring 'egg on face' lines then feel free to berate etc, but please set me straight afterwards ;)

     

    https://www.youtube.com/watch?v=MKEUujz12S4

  13. @Munkeskov

    'What file/files are connected to static_missions = true function?'

    If this flag is set to true then it seems the file \z\addons\dayz_server\WAI\static\init.sqf is loaded. The check line is in the main init.sqf.



    'What file/files are connected to custom_per_world = true function?'

    If this flag is set to true then it seems you can create a custom file eg. tavi.sqf and add it too \z\addons\dayz_server\WAI\static\..

    Add the custom file name to the \z\addons\dayz_server\WAI\static\init.sqf in the 'if(condition)then{ --here-- }' part of the loop.

    Then you have set up a custom install file. 

     

    You can copy your code from your old file to this new file making any necessary changes to the arrays that are used to call the compiles ( new edits have been made to spawn_group.sqf , etc,  eg. skill name changes), and it should load ok.



    'if i set custom_per_world to true, and have a file for each map i play on, would that do it?'

    That is how it appears to work, you can create a file for each map and store your custom ai spawns there, and call it from the \static\init.sqf.



    On another side note, for those who are running DZMS with WAI new version, some may see that in the rpt log the DZMS check for Relations no longer functions correctly.

    This appears to be because the name of the variable in WAI used by DZMS to check if WAI is running has been changed from "WAIconfigloaded" to "configloaded".

    To reset this, change the variable name to "configloaded" for the WAI check in DZMSInit.sqf, about line 53. This should re-enable the check.
     

  14. I think we are having the same problem since the 332 update from Infistar.

    The line below appears in the publicvariable.log, (restriction #11 I think),

    "04.07.2014 02:59:41: PlayerName (IP) UID - #11 "PVAHR_0_hharrcqnfwtb" =

    ["PlayerName","ID",

    [73,110,118,97,108,105,100,32,73,68,58,32,79,108,100,95,98,105,107,101,95,84,75,95,73,78,83,95,69,80,49,32,64,49,57,49,49

    ,52,56],[66,65,78,78,69,68]]"

    I have tried the above fix (_VTC =  true;) and a few tweaks to BE publicvariable.txt but nothing seems to solve this yet.

    Battleye is not my first language so I know little of it. Still fiddling while server burns.

×
×
  • Create New...