Jump to content

Meowzors

Member
  • Posts

    157
  • Joined

  • Last visited

Posts posted by Meowzors

  1. Completely untested code and from my phone here...

    Add one more field to the heli spawn script which is the time in seconds before a respawn (my example is 300 which is 5 minutes)

    At top of heliSpawn script somewhere...

    _respawn=_this select 6;

    At bottom of heliSpawn script...

    _helicopter addEventHandler ["Killed",{ Call spawnOnDeath; }];

    spawnOnDeath =

    {

    Sleep _respawn;

    [[[16207,13753.5,0],[17319,7482.74,0.001],[10022.2,18632.4,0.001],[13857,19278.1,0.001],[15394.2,16309.1,0.001]], //Martin,Byeluv,Kameni,Khotanavisk,Sevastopl

    [22203.9,19823,212], // Position to spawn chopper at (Sector

    200, //Radius of patrol

    5, //Number of waypoints to give

    "UH1H_DZ", //Classname of vehicle (make sure it has driver and two gunners)

    1, //Skill level of units

    300

    ] spawn heli_patrol_multi;

    };

    [\spoiler]

  2. @RedBaron  I actually made a alternate helipatrol script that you can send multiple waypoints to and it will follow those waypoints and begin the cycle again.  Here is an example spawn of a heli that patrols the main Island of Tavi...

     

    [[[16207,13753.5,0],[17319,7482.74,0.001],[10022.2,18632.4,0.001],[13857,19278.1,0.001],[15394.2,16309.1,0.001]],    //Martin,Byeluv,Kameni,Khotanavisk,Sevastopl
    [22203.9,19823,212],                 // Position to spawn chopper at (Sector B)
    200,                    //Radius of patrol
    5,                     //Number of waypoints to give
    "UH1H_DZ",                //Classname of vehicle (make sure it has driver and two gunners)
    1                        //Skill level of units
    ] spawn heli_patrol_multi;

     

    Added inside of WAI\init.sqf

    spawn_groupMulti = compile preprocessFileLineNumbers "\z\addons\dayz_server\WAI\compile\SpawnGroupMulti.sqf";

    And here is the code that it calls...

    /*
    This script will spawn a heli patrol using multiple way points passed to it repeating the route when complete

    Proper use: [[way points..[x,y,z],[x,y,z]...],[x,y,z..starting position],N/A,N/A,heli type,skill 0-1
    */

    if (!isServer)exitWith{};
    private ["_wpnum","_radius","_gunner2","_gunner","_skillarray","_startingpos","_heli_class","_startPos","_helicopter","_unitGroup","_pilot","_skill","_position","_wp"];
    _position = _this select 0;
    _startingpos = _this select 1;
    _radius = _this select 2;
    _wpnum = _this select 3;
    _heli_class = _this select 4;
    _skill = _this select 5;

    _skillarray = ["aimingAccuracy","aimingShake","aimingSpeed","endurance","spotDistance","spotTime","courage","reloadSpeed","commanding","general"];

    _unitGroup = createGroup east;
    _pilot = _unitGroup createUnit ["Bandit1_DZ", [0,0,0], [], 1, "NONE"];
    [_pilot] joinSilent _unitGroup;
    ai_air_units = (ai_air_units +1);

    _helicopter = createVehicle [_heli_class, [(_startingpos select 0),(_startingpos select 1), 200], [], 0, "FLY"];
    _helicopter setFuel 1;
    _helicopter engineOn true;
    _helicopter setVehicleAmmo 1;
    _helicopter flyInHeight 150;
    _helicopter lock true;
    _helicopter addEventHandler ["GetOut",{(_this select 0) setFuel 0;(_this select 0) setDamage 1;}];

    _pilot assignAsDriver _helicopter;
    _pilot moveInDriver _helicopter;

    _gunner = _unitGroup createUnit ["Bandit1_DZ", [0,0,0], [], 1, "NONE"];
    _gunner assignAsGunner _helicopter;
    _gunner moveInTurret [_helicopter,[0]];
    [_gunner] joinSilent _unitGroup;
    ai_air_units = (ai_air_units +1);

    _gunner2 = _unitGroup createUnit ["Bandit1_DZ", [0,0,0], [], 1, "NONE"];
    _gunner2 assignAsGunner _helicopter;
    _gunner2 moveInTurret [_helicopter,[1]];
    [_gunner2] joinSilent _unitGroup;
    ai_air_units = (ai_air_units +1);

    {_pilot setSkill [_x,1]} forEach _skillarray;
    {_gunner setSkill [_x,_skill]} forEach _skillarray;
    {_gunner2 setSkill [_x,_skill]} forEach _skillarray;
    {_x addweapon "Makarov";_x addmagazine "8Rnd_9x18_Makarov";_x addmagazine "8Rnd_9x18_Makarov";} forEach (units _unitgroup);
    {_x addEventHandler ["Killed",{[_this select 0, _this select 1, "air"] call on_kill;}];} forEach (units _unitgroup);
    PVDZE_serverObjectMonitor set [count PVDZE_serverObjectMonitor,_helicopter];
    [_helicopter] spawn veh_monitor;

    _unitGroup allowFleeing 0;
    _unitGroup setBehaviour "AWARE";
    _unitGroup setSpeedMode "FULL";
    _unitGroup setCombatMode "RED";

    _position2 = [];
    {_position2 = _x;
    _wp = _unitGroup addWaypoint [[(_position2 select 0),(_position2 select 1),0],200];
    _wp setWaypointType "MOVE";
    _wp setWaypointCompletionRadius 200;
    } forEach _position;

    _position1=_position select 0;
    _wp = _unitGroup addWaypoint [[(_position1 select 0),(_position1 select 1),0],100];
    _wp setWaypointType "CYCLE";
    _wp setWaypointCompletionRadius 200;
     

     

    I THINK this is what you want? Heli that goes in a circle of points of your choosing.

  3. I am also working on instead of markers on the map a mission list and description window that pops up whenever u press a certain key. Only if u have a radio on u r u even notified there is a mission available at all. Map markers are too easy. I prefer a simple description with a nearby town named to give a rough idea of where it is. Map markers allow people to snipe missions without having range finders easily by marking the map and adjusting for that range

  4. i dunno if you are still having this issue... but you did define Sector_B_Weapons inside of server_functions right?  Otherwise it will create the standard box but then will fail to spawn the weapons in as your sector_B_Weapons call is undefined. Not sure if you did this and didn't say you did or not but hope it helps.

     

    inside of server_functions with all of the defines you will need

     

    Sector_B_Weapons   =                    compile preprocessFileLineNumbers "\z\addons\dayz_server\INSERT FOLDER NAME HERE\Sector_B_Weapons.sqf";

  5. Need a little help here... I am trying to create something like what origins has in that instead of having large circles on the map displaying mission locations, you instead (if you have a radio) you have a pop stating that a new mission is available and to press 7 for details.  I am doing this by using a public variable passed to the client each time a mission pops... Here is what I have MAYBE someone will see what I am doing wrong... Current test only allows for one mission running at a time.

     

    in my init.sqf I have:

     

    ...

        //Lights
        //[false,12] execVM "\z\addons\dayz_code\compile\local_lights_init.sqf";

        "WAIMissionMarker" addPublicVariableEventHandler { WAIMissionMarker execVM 'Custom\MissionInfo.sqf'; };

    ...

     

    Inside Custom\MissionInfo.sqf :

    //WAI Mission Notification
    MissionPos = _this select 0;
    ActiveMissionName = _this select 1;
    ActiveMissionText = _this select 2;

    systemChat "A mission is available press 7 to view details...";

     

    uiSleep 120; //Change time here again - makes sure that the information gets reset every 2 minutes, if you put the Weapon/Item down, the Information will be removed after max. x seconds
    if if(!("ItemRadio" in weapons player)
    {
        ActiveMissionText="";
        ActiveMissionName="No Missions Available";
    };

    New code in dayz_spaceInterrupt.sqf

    ...

    //Pressing 7 brings up Mission List
    if (_dikCode == 0x08) then {
            if("ItemRadio" in weapons player) then {
                hintC format["Current Mission: %1 \n Description: %2",MissionName,MissionText];
                //_hndl = createdialog "help_dialog";
            };
        };

    ...

    Inside WAI's Marker.sqf:

    //WAI Mission Notification
    if(!isServer) exitWith {};
    private ["_position","_name","_units","_text"];
    _position = _this select 0;
    _name = _this select 1;
    _text = _this select 2;
    _units = [];
    WAIMissionMarker = [_position, _name, _text];
    while{missionrunning} do {
    {
    _units = [];
       if ((side _x) == West) then {  
            if("ItemRadio" in weapons _x) then { //Change Item/Weapon here use 'in magazines' if the item is no tool or weapon
                _units set [count _units, _x];
            };
       };
    } forEach allUnits;
    {
     (owner _x) publicVariableClient "WAIMissionMarker"
    } foreach _units;
    markerready = true;
    uiSleep 120; //Change time here (in seconds) but dont make it too big or the script wont check for new players with the Item in inventory
    };

    Example Mission marker.sqf call:

    ...

     //Get Nearby City
        _nearestCity = nearestLocations [_position, ["NameCityCapital","NameCity","NameVillage","NameLocal"],750];
        _textCity = "Wilderness";
        if (count _nearestCity > 0) then {_textCity = text (_nearestCity select 0)};
    _text = format["Bandit Base:  A jungle task force have set up a temporary encampment near %1! Go and ambush it to make it yours!!",_textCity];
    [_position,"Bandit Base",_text] execVM "\z\addons\dayz_server\WAI\missions\compile\markers.sqf";

    ...

     

    Currently when I press 7 when it alerts me that there is a mission it posts a hint that says 'mission name: __cur_map   description: any'

     

    Any help would be great! Thanks.

  6. Need a little help here... I am trying to create something like what origins has in that instead of having large circles on the map displaying mission locations, you instead (if you have a radio) you have a pop stating that a new mission is available and to press 7 for details.  I am doing this by using a public variable passed to the client each time a mission pops... Here is what I have MAYBE someone will see what I am doing wrong... Current test only allows for one mission running at a time.

     

    in my init.sqf I have:

     

    ...

        //Lights
        //[false,12] execVM "\z\addons\dayz_code\compile\local_lights_init.sqf";

        "WAIMissionMarker" addPublicVariableEventHandler { WAIMissionMarker execVM 'Custom\MissionInfo.sqf'; };

    ...

     

    Inside Custom\MissionInfo.sqf :

    //WAI Mission Notification
    MissionPos = _this select 0;
    ActiveMissionName = _this select 1;
    ActiveMissionText = _this select 2;

    systemChat "A mission is available press 7 to view details...";

     

    uiSleep 120; //Change time here again - makes sure that the information gets reset every 2 minutes, if you put the Weapon/Item down, the Information will be removed after max. x seconds
    if if(!("ItemRadio" in weapons player)
    {
        ActiveMissionText="";
        ActiveMissionName="No Missions Available";
    };

    New code in dayz_spaceInterrupt.sqf

    ...

    //Pressing 7 brings up Mission List
    if (_dikCode == 0x08) then {
            if("ItemRadio" in weapons player) then {
                hintC format["Current Mission: %1 \n Description: %2",MissionName,MissionText];
                //_hndl = createdialog "help_dialog";
            };
        };

    ...

    Inside WAI's Marker.sqf:

    //WAI Mission Notification
    if(!isServer) exitWith {};
    private ["_position","_name","_units","_text"];
    _position = _this select 0;
    _name = _this select 1;
    _text = _this select 2;
    _units = [];
    WAIMissionMarker = [_position, _name, _text];
    while{missionrunning} do {
    {
    _units = [];
       if ((side _x) == West) then {  
            if("ItemRadio" in weapons _x) then { //Change Item/Weapon here use 'in magazines' if the item is no tool or weapon
                _units set [count _units, _x];
            };
       };
    } forEach allUnits;
    {
     (owner _x) publicVariableClient "WAIMissionMarker"
    } foreach _units;
    markerready = true;
    uiSleep 120; //Change time here (in seconds) but dont make it too big or the script wont check for new players with the Item in inventory
    };

    Example Mission marker.sqf call:

    ...

     //Get Nearby City
        _nearestCity = nearestLocations [_position, ["NameCityCapital","NameCity","NameVillage","NameLocal"],750];
        _textCity = "Wilderness";
        if (count _nearestCity > 0) then {_textCity = text (_nearestCity select 0)};
    _text = format["Bandit Base:  A jungle task force have set up a temporary encampment near %1! Go and ambush it to make it yours!!",_textCity];
    [_position,"Bandit Base",_text] execVM "\z\addons\dayz_server\WAI\missions\compile\markers.sqf";

    ...

     

    Currently when I press 7 when it alerts me that there is a mission it posts a hint that says 'mission name: __cur_map   description: any'

     

    Any help would be great! Thanks.

  7. Loot pos is the distance from the center of that classnames model which makes it map independent. The central point of the building is [0,0,0] [x,y,z] the lootPos gives the distance of x,y,z from the center of that building to spawn the loot.  So long as the new map has the same kind of buildings, the same loot will spawn in the same spots inside that building.  If there are new buildings that do not have defined locations in your loot file they will not spawn loot.  However, epoch maps should all have the same buildings so you should be good.

  8. Type=local

    Offset= -5

    Change ur time settings in hiveext.ini to that will set server game time to actual time east coast I believe. That really sucks for our foreign friends that wanna play ur server tho because when it's Nguyen east coast it's their daytime prime time to play so ur server will be always night time when they play. I suggest static time with start time set to 18 (6pm) and four hour restart. U will get dark 3rd hour I think that way. I personally use fast time so I have a whole day in 4 hour restart. Last hour is night rest day with sunrise right before restart so all players are happy

  9. Solution to above loot issue.... I had some problems with this for a bit in several different loot spawning scripts

    loottable structure has changed ... you need to replace some lines in crashspawner module

    _config = configFile >> "CfgBuildingLoot" >> _lootTable;
    _itemTypes = [] + getArray (_config >> "itemType");
    _index = dayz_CBLBase find toLower(_lootTable);
    _weights = dayz_CBLChances select _index;
    _cntWeights = count _weights;
    

    with this

        if (DZE_MissionLootTable) then {
            _itemTypes = [] + getArray (missionConfigFile >> "CfgBuildingLoot" >> _lootTable >> "lootType");
        } else {
            _itemTypes = [] + getArray (configFile >> "CfgBuildingLoot" >> _lootTable >> "lootType");
        };
        _CBLBase = dayz_CBLBase find (toLower(_lootTable));
        _weights = dayz_CBLChances select _CBLBase;
        _cntWeights = count _weights;
    

    and replace this

    _index = floor(random _cntWeights);
    _index = _weights select _index;
    _itemType = _itemTypes select _index;
    [_itemType select 0, _itemType select 1, _lootPos, 5] call spawn_loot;
    

    with this

            _index1 = floor(random _cntWeights);
            _index2 = _weights select _index1;
            _itemType = _itemTypes select _index2;
            [_itemType select 0, _itemType select 1, _lootPos, 5] call spawn_loot;
    

    last step, make sure that following vars are registered as private:

    _index1, _index2 and _itemTypes
    

    - look ontop of file and add them or replace the line with this one ...

    private["_index1","_index2","_itemTypes","_timeAdjust","_timeToSpawn","_spawnRoll","_crash","_hasAdjustment","_newHeight","_adjustedPos","_useStatic","_crashDamage","_lootRadius","_preWaypoints","_preWaypointPos","_endTime","_startTime","_safetyPoint","_heliStart","_deadBody","_exploRange","_heliModel","_lootPos","_list","_craters","_dummy","_wp2","_wp3","_landingzone","_aigroup","_wp","_helipilot","_crash","_crashwreck","_smokerand","_staticcoords","_pos","_dir","_position","_num","_config","_itemType","_itemChance","_weights","_index","_iArray","_crashModel","_lootTable","_guaranteedLoot","_randomizedLoot","_frequency","_variance","_spawnChance","_spawnMarker","_spawnRadius","_spawnFire","_permanentFire","_crashName"];
    

    hope that helps... cheers

  10. if you want 6 hours of ONLY night... set your static server time to 23 in your hiveEXT.ini... the ; mark a commented line.... then set your server to restart every 6 hours.  11pm will be dark and will restart at 5am (still darkish)

     

    Excerpt from my HiveEXT.ini...

     

    [Time]
    ;Possible values: Local, Custom, Static
    ;You cannot use Static on OFFICIAL Hive, it will just revert to Local
    Type = Static
    ;If using Custom type, offset from UTC in hours (can be negative as well)
    ;Offset = -8
    ;If using Static type (Hour value always the same on every server start), the value (0-24) to set the Hour to
    Hour = 23

  11. Ok, so I dunno what is wrong but I get the drop down of items to choose what to build and all just fine but the buttons for spawn and cancel are not clickable at all... any ideas?

     

    I renamed a couple of the classes adding a 1 to the end of the classname because those classes are used in my admin spawn vehicle tool

     

    I do not use infistar

     

    http://pastebin.com/B03wCHsB   ==>Dialogs.hpp

     

    http://pastebin.com/QuynjYCC   ==> Defines.hpp

  12.  

    this is what i did on my server, anyone else feel free to chime in with a better method.  By deleting the below code there shouldn't been any time sync. 

     

    for my server I use core_time.fsm to sync time for all players.  also use it to speed up time.  using setDate vs skipTime results in a smooth transition of weather and clouds.

     

    delete this block of code from server_functions.sql

    server_timeSync = {
    	//Send request
    	private ["_hour","_minute","_date","_key","_result","_outcome"];
        _key = "CHILD:307:";
    	_result = _key call server_hiveReadWrite;
    	_outcome = _result select 0;
    	if(_outcome == "PASS") then {
    		_date = _result select 1; 
    		
    		if(dayz_fullMoonNights) then {
    			_hour = _date select 3;
    			_minute = _date select 4;
    			//Force full moon nights
    			_date = [2013,8,3,_hour,_minute];
    		};
    
    		setDate _date;
    		PVDZE_plr_SetDate = _date;
    		publicVariable "PVDZE_plr_SetDate";
    		diag_log ("TIME SYNC: Local Time set to " + str(_date));	
    	};
    };
    

    delete this line from server_cleanup.fsm. then fix items20-22 so they are items19-21

    item19[] = {"sync_time",2,250,450.000000,-25.000000,550.000000,25.000000,0.000000,"sync time"};
    

    then delete this block of code and fix the priority values in the above classes from 5 and 6 to 4 and 5

    /*%FSM</LINK>*/
            /*%FSM<LINK "___min_loop">*/
            class ___min_loop
            {
              priority = 4.000000;
              to="sync_time";
              precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
              condition=/*%FSM<CONDITION""">*/"((diag_tickTime - _lastUpdate) > 300)"/*%FSM</CONDITION""">*/;
              action=/*%FSM<ACTION""">*/"_lastUpdate = diag_tickTime;"/*%FSM</ACTION""">*/;
            };
    

    and delete this block of code

    /*%FSM</STATE>*/
        /*%FSM<STATE "sync_time">*/
        class sync_time
        {
          name = "sync_time";
          init = /*%FSM<STATEINIT""">*/"if (DZE_DiagFpsSlow) then {" \n
           "	call dze_diag_fps;" \n
           "};" \n
           "call server_timeSync;"/*%FSM</STATEINIT""">*/;
          precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
          class Links
          {
            /*%FSM<LINK "true">*/
            class true
            {
              priority = 0.000000;
              to="general_cleanup";
              precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
              condition=/*%FSM<CONDITION""">*/"true"/*%FSM</CONDITION""">*/;
              action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
            };
            /*%FSM</LINK>*/
          };
        };
    

    open server_playersetup.sqf and comment out this code around line 244

    //call server_timeSync;
    

    This is perfect. Great job with this. Thanks

  13. If you are running a epoch origins server, the flying fortress is a super easy way to build skybases with. one person hovering while the other is building a base from the deck.  More than likely this is how your skybases went up so fast

  14. Doesn't the skill level only go 0,1, or 2 though? So case 3 and 4 would never happen. Was trying to leave some randomness to the gear also by leaving each skill level with a couple gear sets to choose from. I can't figure out y my code didn't work can u not create an array inside a switch statement? Or is it that the bis_selectRandom requires more than just the two options I was supplying it with?

×
×
  • Create New...