[Support] ESSV2

maybe i really dont get it what you mean with that:

"Also delete this constant anywhere you see it:
UNLCK_PIC"

Do i have to delete this word UNLCK_PIC only , or do i have to delete the whole row which contains UNLCK_PIC,
or the whole thing inside those { } between those UNLCK_PIC (more rows) ?
 
ok, i removed the words, and not commented out, but still the RPT Error
2015/03/09, 21:41:45 Error in expression <iable "spawnChoice") < 1} do {
AT_SPAWN
if (!dialog) then {cutText ["","BLACK OU>
2015/03/09, 21:41:45 Error position: <if (!dialog) then {cutText ["","BLACK OU>
2015/03/09, 21:41:45 Error Missing ;
2015/03/09, 21:41:45 File mpmissions\DayZ_Epoch_11.Chernarus\spawn\spawn.sqf, line 111
2015/03/09, 21:41:45 Error in expression <iable "spawnChoice") < 1} do {
AT_SPAWN
if (!dialog) then {cutText ["","BLACK OU>
2015/03/09, 21:41:45 Error position: <if (!dialog) then {cutText ["","BLACK OU>
2015/03/09, 21:41:45 Error Missing ;
2015/03/09, 21:41:45 File mpmissions\DayZ_Epoch_11.Chernarus\spawn\spawn.sqf, line 111

here´s my new spawn.sqf
CSS:
#define GET_TEXT disableSerialization;_text=lbText[8888,(lbCurSel 8888)];{if(_text==(_x select 0))then{_spawn=_x;};}forEach _spawnPoints+_customBases;
#define GROUP_POS _leader=leader(group player);_grid=getPosATL _leader;if(surfaceIsWater _grid)then{_grid=getPosASL _leader;};
#define PLOT_POS _plot=(uiNamespace getVariable "myPlotPos")select 0;_grid=getPosATL _plot;if(surfaceIsWater _grid)then{_grid=getPosASL _plot;};

moveMap = {
    #include "spawnConfig.sqf"
    private ["_ctrl","_leader","_plot","_grid","_spawn","_text","_zoom"];
    GET_TEXT
    _zoom = .35;
    if (isNil "_spawn") then {_spawn = [[],getMarkerPos "center"];_zoom = 4;};
    _grid = _spawn select 1;
    if (count _spawn > 4) then {_grid = getMarkerPos "center";_zoom = 4;};
    if (_text == "Near MyGroup") then {GROUP_POS};
    if (_text == "Near MyPlot") then {PLOT_POS};
    _ctrl = (findDisplay 88890) displayCtrl 8890;
    _ctrl ctrlMapAnimAdd [1,_zoom,_grid];
    ctrlMapAnimCommit _ctrl;
};

spawnFill = {
    #include "spawnConfig.sqf"
    private ["_block","_bodies","_body","_humanity","_index","_lb","_lock","_text","_puid"];
    disableSerialization;
    _blockGroup = 0;
    _blockPlot = 0;
    _bodies = [];
    _lb = (findDisplay 88890) displayCtrl 8888;
    _humanity = player getVariable ["humanity",0];
    _puid = getPlayerUID player;
    {if ((!isNull _x) && {(_x getVariable["bodyUID","0"]) == _puid}) then {_bodies set [count _bodies,(getPosATL _x)];};} count allDead;
    if (_spawnNearPlot) then {
        _poles = (getMarkerPos "center") nearEntities ["Plastic_Pole_EP1_DZ",_mapRadius];
        {if ((_x getVariable ["ownerPUID","0"]) == _puid) exitWith {uiNamespace setVariable ["myPlotPos",[_x]];};} count _poles;
    };
    _block = [];
    if (count _bodies > 0) then {
        {
            _body = _x;
            {
                if ((count _x < 5) && {(_body distance (_x select 1)) < _bodyCheck}) then {_block set [count _block,(_x select 0)];};
            } forEach _spawnPoints;
            if ((count units group player > 1) && {_spawnNearGroup}) then {GROUP_POS if ((_body distance _grid) < _bodyCheck) then {_blockGroup = 1;};};
            if (count (uiNamespace getVariable "myPlotPos") > 0) then {PLOT_POS if ((_body distance _grid) < _bodyCheck) then {_blockPlot = 1;};};
        } count _bodies;
        if ((count _block > 0) || {_blockGroup > 0} || {_blockPlot > 0}) then {systemChat format ["Note: some spawns are blocked due to a body of yours within %1m",_bodyCheck];};
    };
    lbClear _lb;
    {
        _text = _x select 0;
        if !(_text in _block) then {
            _lock = 0;
            _level = _x select 2;
            _hlevel = _x select 3;
            if (((_hlevel < 0) && {_humanity >= _hlevel}) ||
                {(_level == 1) && {!(_puid in _spawnLevel1)}} ||
                {(_level == 2) && {!(_puid in _spawnLevel2)}} ||
                {(_level == 3) && {!(_puid in _spawnLevel3)}} ||
                {(_hlevel > 0) && {_humanity <= _hlevel}}
                ) then {_lock=1;};
            _index = _lb lbAdd _text;
          
          
            if (count _x > 4) then {_lb lbSetColor [_index,[.97,.87,.35,1]];};
            if (_hlevel > 0) then {_lb lbSetColor [_index,[.38,.7,.9,1]];};
            if (_hlevel < 0) then {_lb lbSetColor [_index,[1,0,0,.8]];};
            if (_level > 0) then {_lb lbSetColor [_index,[0,1,0,.8]];};
        };
    } forEach _spawnPoints;
    if ((count units group player > 1) && {_spawnNearGroup} && {_blockGroup < 1}) then {_index = _lb lbAdd "Near MyGroup";_lb lbSetColor [_index,[1,.7,.4,1]];};
    if ((_blockPlot < 1) && {count (uiNamespace getVariable "myPlotPos") > 0}) then {_index = _lb lbAdd "Near MyPlot";_lb lbSetColor [_index,[1,.7,.4,1]];};
    if (_puid in _customBase) then {
        {if (_puid == _x) then {_index = _forEachIndex;};} forEach _customBase;
        _base = _customBases select _index;
        _index = _lb lbAdd (_base select 0);
        _lb lbSetColor [_index,[0,1,0,.8]];
      
    };
    lbSort _lb;
};

spawnPick = {
    private ["_go","_humanity","_level","_spawn","_text","_puid"];
    #include "spawnConfig.sqf"
    _go = 1;
    GET_TEXT
    if (_text == "Near MyGroup") then {_spawn = [0,[],0,0];};
    if (_text == "Near MyPlot") then {_spawn = [0,[1],0,0];};
    if (isNil "_spawn") exitWith {systemChat "Select a spawn!";_go=0;};
    if (count _spawn > 2) then {
        _level = _spawn select 2;
        _hlevel = _spawn select 3;
        _humanity = player getVariable ["humanity",0];
        _puid = getPlayerUID player;
        if ((_hlevel < 0) && {_humanity >= _hlevel}) exitWith {systemChat format["Your humanity must be less than %1 for this spawn.",_hlevel];_go=0;};
        if ((_hlevel > 0) && {_humanity <= _hlevel}) exitWith {systemChat format["Your humanity must be greater than %1 for this spawn.",_hlevel];_go=0;};
        if ((_level == 1) && {!(_puid in _spawnLevel1)}) exitWith {systemChat "This spawn is for level 1 VIPs only.";_go=0;};
        if ((_level == 2) && {!(_puid in _spawnLevel2)}) exitWith {systemChat "This spawn is for level 2 VIPs only.";_go=0;};
        if ((_level == 3) && {!(_puid in _spawnLevel3)}) exitWith {systemChat "This spawn is for level 3 VIPs only.";_go=0;};
    };
    if (_go > 0) then {uiNamespace setVariable ["spawnChoice",_spawn];};
};

private ["_count","_find","_leader","_ok","_plot","_grid","_spawn","_spot"];
#include "spawnConfig.sqf"
uiNamespace setVariable ["haloChoice",-1];
uiNamespace setVariable ["spawnChoice",[]];
uiNamespace setVariable ["myPlotPos",[]];

while {count (uiNamespace getVariable "spawnChoice") < 1} do {
    AT_SPAWN
    if (!dialog) then {cutText ["","BLACK OUT",0];_i="createDialog";createDialog "SpawnDialog";call spawnFill;call moveMap;};
    uiSleep 1;
};
closeDialog 0;
moveMap=nil;spawnFill=nil;spawnPick=nil;

_spawn = uiNamespace getVariable "spawnChoice";
_grid = _spawn select 1;
if (count _spawn > 3) then {
    if (count _spawn > 4) then {_grid = _grid call BIS_fnc_selectRandom;};
    if (count _grid == 0) then {GROUP_POS};
    if (count _grid == 1) then {PLOT_POS};
    _count = 0;
    _find = true;
    while {_find && {_count < 99}} do {
        _spot = [_grid,0,_spawnRadius,10,0,2000,0] call BIS_fnc_findSafePos;
        _ok = (_spot distance _grid) < _spawnRadius;
        _spot set [2,0];
        if ((((ATLtoASL _spot) select 2) > 2.5) &&
            {({isPlayer _x} count (_spot nearEntities ["Man",100])) < 1} &&
            {count (nearestObjects [_spot,["Plastic_Pole_EP1_DZ"],45]) < 1} && {_ok}) then {_find = false;};
        _count = _count + 1;
    };
    _grid = _spot;
};

here´s the class.sqf http://pastebin.com/qvg8jEzG
did i forget something ?
 
Last edited:
Ive just installed following each step, i've removed halo and spawn selection following each step but it does not work.
I get no errors in report. any ideas?
 
Last edited:
@feiercrack - You removed all the lbSetPicture correctly. Those files look fine. Now it looks like the problem is the preprocesor is not replacing the AT_SPAWN constant in spawn.sqf. It is defined at the top of spawn\start.sqf and spawn\spawn.sqf is part of that file via #include. It is weird that never happened to me all of the time I have tested and used it.

Do you have this line in init.sqf?
Code:
execVM "spawn\start.sqf";
That file needs to be compiled for the preprocessor to replace that constant correctly. Compile happens automatically when you use execVM or preProcessfileLineNumbers, but if you executed spawn\spawn.sqf (like in the old version) directly it would not work.

You can try adding this line to the very top of these files: class.sqf, spawn.sqf and halo.sqf:
Code:
#define AT_SPAWN _nearNow=call _atSpawn;{if!(_x in _nearFinal)then{_nearFinal set [count _nearFinal,_x];};}count _nearNow;

That will define the constant directly in each file. It should not be necessary though, since all those files are a part of spawn\start.sqf via #includes.



finally after adding those 3 lines nomore error appears, great work ebay, thanxxx!!! chapeau :D
 
ok,

but i think there is a little problem remaining.

when we fresh spawn in, we have first the map to choose location, 2nd the class outfit, and after that we got the map again to choose location ?

what is that?
 
Last edited:
really nice scripts and menus ... i like it a lot.

i really like how you used the internal map instead of adding a picture to the mission file that has to change for each map, that just saves so much space.

a few things i was wondering about and changed tho:

can i suggest a switch case in spawnconfig.sqf?
something like:
Code:
switch(_WorldName)do{
    case "napf":
    {
        _spawnPoints = [
        //Napf
        ];
        _customBase = [
        ];
        _customBases = [
        ];
    };
    case "chernarus":
    {
        _spawnPoints = [
        //Chernarus
        ];
        _customBase = [
        ];
        _customBases = [
        ];
    };
};
(dont forget to define before this)

agents cant fly, not to mention follow a destination, i guess thats why you made it aim for an altitude rather than a position before ejecting the player?
personally i changed it a lot, made an ai fly instead and used domove to order him to the destination and removed the waypoint added to the player (idk if that wasnt meant for the ai?)...

halo.sqf line 30, is an error:
Code:
player spawn BIS_fnc_halo;

my guess is you meant?:
Code:
[player] spawn BIS_fnc_halo;

personally i use:
Code:
//halo 10m below plane position
[player,((getpos _plane) select 2)-10] spawn BIS_fnc_halo;

no need to eject the player either, you just risk him ending in normal parachute with halo option ...

another thing is the altimeter stops when you use halo, idk if thats intended?
i used my own code but i thought i would share the titletext line i use, perhaps you can use it too:

Code:
titleText [format[localize "str_halo_altitude_speed",str _myalt+" M",str _speed+" Km/h"], "PLAIN DOWN",.09];

last but not least, thanks a lot for sharing, this saved me tons of time perfecting my own, props to you ebay
 
np, i always like to help with a good project if i can ...

i dont think i been around here for about a year, but i just got servers again and was actually about to make something simmular to your old version, untill i discovered this ofc.

regarding the agents vs units, i guess it could be a long discussion about what will be best in what situation, but i have to say that i feel the agents are just too unpredictable to use for something like this, i always ended up 2-4km from the destination i choose, before i changed it (usually in water if it was a coast spawn).
i like it a lot better when the ai has a set destination and i end up within the radius i defined in spawnconfig, but i can understand the reluctance to use an ai for each spawning player, alltho i dont think it will be that much of a problem for most servers, as long as it is deleted within the timeframe it is (it wont even be on the server for more than 2min, if you remeber to eject him from the parachute).
having said that, i will now try to do some more tests with agents again, even tho i feel its like "pissing in the wind" (lol) ...

what i meant regarding BIS_fnc_halo was if you use like you do, it will sometimes fail and either do undesireble things like eject player with no parachute or just normal eject with normal parachute.
it worked fine for me on my server, but for some reason it just didnt always work for all players, and it would often eject them with no chute and start halo at about auto open hight because of the fix you have in that other file, trust me it doesnt always work.
i know it would probely look more natural if player ejects, but you risk collision with the plane and as i mentioned, it sometimes fails.
in my example the player will start a halo jump at the height you set as secon in the array:
Code:
_myheight = 1500;
[player,_myheight] spawn BIS_fnc_halo;
i just use planes hight minus maybe 10m to avoid player collision with the plane.
(for more realism, you could possibly open the tail gate of the plane, as if the player jumped from there?)
 
I just fresh installed this on Epoch Chernarus and everything seems well until I get to the spawn map and absoultly no spawns show up or can be selected.
 
I just fresh installed this on Epoch Chernarus and everything seems well until I get to the spawn map and absoultly no spawns show up or can be selected.

try in spawnConfig.sqf change this line:

Code:
_spawnPoints = switch (worldName) do {

to this:

Code:
_spawnPoints = switch (toLower worldName) do {
 
Back
Top