GithubHelp home page GithubHelp logo

vemf's People

Contributors

nerdalertdk avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

vemf's Issues

Position finder

Hi,

I was going to rewrite WAI for A3 but seeing your work coming along so nicely I'm not gonna bother with it.

So here is my updated position finder, its find 4 type of locations, road, town, forrest and water
use it if you want :)

nearbyPlayers = {
    private ["_pos", "_isNearList", "_isNear"];
    _pos = _this select 0;

    _isNearList = _pos nearEntities [["Epoch_Male_F","Epoch_Female_F"], 300];
    _isNear = false;

    // Check for Players
    if ((count(_isNearList)) > 0) then {
        {
            if (isPlayer _x) then {
                _isNear = true;
            };
        } forEach _isNearList;
    };

    if !(_isNear) then {
        _isNearList = _pos nearEntities [["LandVehicle", "Air"], 300];
        {
            {
                if (isPlayer _x) then {
                    _isNear = true;
                };
            } forEach (crew _x);
        } forEach _isNearList;
    };
    _isNear
};

nearbyBlackspot = {
    private ["_position", "_isNear", "_nearby"];
    _position = _this select 0;
    _isNear = false;

    _nearby = nearestObjects [_position, ["PlotPole_EPOCH"], 300];

    if ((count _nearby) > 0) then {
        _isNear = true;
    };
    _isNear
};
private ["_cityrange","_cityPos","_selectedCity","_allCitys","_RoadList","_worldSize","_worldCenter","_position", "_isNear", "_nearby","_spawnRadius","_result"];
    /*
    1    Position
    2    Minimum distance
    3    Maximum distance
    4    Maximum distance from nearest object
    5    0 - cant be in water, 1 - ?
    6    Terrain gradient (how steep terrain)
    7    0 - shore mode; does not have to be in shore
    */
    markerready = false;
    _position = [];
    _chance = floor(random 3);
    //_chance = 1;

    // Try 10 Times to Find a Mission Spot
    for "_x" from 1 to 10 do {
        switch (_chance) do
        {
            // ROAD
            case 0:
                {
                    _RoadList = epoch_centerMarkerPosition nearRoads EPOCH_dynamicVehicleArea;
                    waitUntil{!isNil "BIS_fnc_selectRandom"};
                    _position = _RoadList call BIS_fnc_selectRandom;
                    _position = _position modelToWorld [0,0,0];
                    waitUntil{!isNil "BIS_fnc_findSafePos"};
                    _position = [_position,0,50,5,0,3000,0] call BIS_fnc_findSafePos;
                    diag_log format["position ROAD"];
                };
            // Buldings
            case 1:
                {
                    _allCitys=(configfile >> "CfgWorlds" >> worldName >> "Names")call BIS_fnc_returnChildren;
                    _selectedCity=_allCitys select(floor random(count _allCitys));
                    _cityPos=getArray(_selectedCity >> "position");
                    _cityrange=getNumber(_selectedCity >> "radiusA");
                    waitUntil{!isNil "BIS_fnc_findSafePos"};
                    _position = [_cityPos,0,_cityrange,5,0,3000,0] call BIS_fnc_findSafePos;
                    diag_log format["position Buldings"];
                };
            // Wildness
            case 2:
                {   
                    waitUntil{!isNil "BIS_fnc_findSafePos"};
                    _position = [epoch_centerMarkerPosition,0,EPOCH_dynamicVehicleArea,100,0,3000,0] call BIS_fnc_findSafePos;
                    diag_log format["position Wildness"];
                };
            // Water
            case 3:
                {   
                    waitUntil{!isNil "BIS_fnc_findSafePos"};
                    _position = [epoch_centerMarkerPosition,0,EPOCH_dynamicVehicleArea,100,1,1000,1] call BIS_fnc_findSafePos;
                    diag_log format["position water/shore"];
                };
        };

        _isNearPlayer = [_position] call nearbyPlayers;
        _isNearBlackspot = [_position] call nearbyBlackspot;

        if ((!_isNearPlayer) && (!_isNearBlackspot)) then {
            _x = 20;
            diag_log format["Good position At %1",_position];
        } else {
            _position = [];
            diag_log format["Bad position %1",_position];
        };
    };

    _position

Custom AI Brain

I plan to write a custom AI Brain. This will be superior to the default Arma AI.

This will wait till after the primary VEMF is released.

never use execVM

Its recommend to storage the function on a variable with
MyFunction = compileFinal "pathtofunction.sqf";

Then can you execute the function with:
[] spawn MyFunction or [] call MyFunction (deeps in which environment you want it)

With call is it also possible to have a return value from the function.

Adding a return value to AISpawn functions / passing option for timer to delete dead bodies.

A while ago I moved the logic in DZMS to delete dead AI bodies from a timer for each body to a timer for the entire mission. On a busy server with serveral missions running that reduced the number of timers running from perhaps 60 or more to 2 or 3. For this to work one needs a system to collect information about the AI spawned. That change seemed to reduce lag on busy days significantly.

I suggest that the AI spawn function return the _grp, which can then be processed however one likes in any addons.

The other half of this would be to add a fifth, optional call parameter to the AI Spawn function that would be used to toggle a variable for each unit indicating whether or not a timer should be run for body cleanup. That variable would be check in the AIKilled module if/when the AI is killed.

ReWrite VAISpawn

VAISpawn has some logic errors in it. A workaround was added, but it needs reWrote before full release.

Some errors I had to fix:

  • What I thought was town center was actually a unit position. Made Waypoints way off.
  • Last Group in Loop wasn't added to array, no leader was selected

ATM "Strict" Distribution probably has related errors still.

isClass Item, Weapon, or Magazine

Not sure how to check if a classname is an item and not a weapon, as they are both in CfgWeapons.

Until this is sorted crates will only have items, not weapons.

hint str(isClass (configFile >> "cfgWeapons" >> "FirstAidKit"));

Returns True.

Detecting Steep Slopes at potential mission positions

I have one suggestion for VEMFRandomPos, whenever you have time to think about it, which is to add a check for the difference in elevation between the different feelers and to use that as a check for steeply sloped mountainsides. I first saw this in Wicked AI and since added an implementation to your DZMS after finding many missions spawning on the sides of mountains on NAPF. This led to some very amusing glitches but made missions difficult to complete. I used the following to get the elevation of a feeler which in my code I call _obj1:

((getPosASL _obj1) select 2)

Thank you so much for sharing your work on this project. It will be a true game changer for those of use who run PVE no PVP servers.

Supply Convoy error

got this to day while testing in-dev

2015/02/01, 15:05:53 [VEMF]: Running Supply Convoy Mission.
2015/02/01, 15:05:54 Error in expression <Soldier_EPOCH"];


_driver = [_safePos] call VEMFSpawnSingleAI;
_driver moveInDr>
2015/02/01, 15:05:54   Error position: <call VEMFSpawnSingleAI;
_driver moveInDr>
2015/02/01, 15:05:54   Error call: Type String, expected code
2015/02/01, 15:05:54 File VEMF\VFunctions.sqf, line 321

initServer.sqf

add this to the config.cpp and you don't need the initServer.sqf in mission file
you might need to rename vinit.sqf to fn_init.sqf

class CfgPatches 
{
    class VEMF
    {
        units[] = {"C_man_1"};
        weapons[] = {};
        requiredAddons[] = {"A3_Data_F","A3_Soft_F","A3_Soft_F_Offroad_01","A3_Characters_F"};
        fileName = "VEMF.pbo";
        author[]= {"Vampire"}; 
    };
};
class CfgFunctions {
    class Mission1 {
        class main {
            file = "\VEMF";
            class init {
                postInit = 1;
            };
        };
    };
};

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.