vampurica / vemf Goto Github PK
View Code? Open in Web Editor NEWVampire's Epoch Mission Framework
Vampire's Epoch Mission Framework
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
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.
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.
AI Fastroping from a support chopper when reinforcements are called.
Record Player Mission Stats and allow the display of them via a custom dialog.
http://epochmod.com/forum/index.php?/topic/31678-redis-custom-columns/?p=198210
Planned for a future version.
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.
VAISpawn has some logic errors in it. A workaround was added, but it needs reWrote before full release.
Some errors I had to fix:
ATM "Strict" Distribution probably has related errors still.
just use publicVariableEventHandler
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.
The weapons need weighted in the future. AI with large calibers are too strong.
Crate Searching Results go here.
setFriend just work server side, we do this in epoch code already on the server so you don't need to do this and on the client does it make client restrictions.
systemChat is unnoticeable grey. Needs to be more noticeable.
VFunctions.sqf isn't being loaded from init.sqf causing an undefined variable error at init.sqf line 83.
https://github.com/SMVampire/VEMF/blob/master/VEMF/init.sqf#L83
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.
Currently the missions message the player who gets the final kill.
Should be configurable between this and all players in a certain distance.
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
Need to be able to create vehicles temporarily.
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;
};
};
};
};
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.