Jump to content

dlegion

Member
  • Content Count

    617
  • Joined

  • Last visited

  • Medals

Everything posted by dlegion

  1. hello guys, i've run into a strange problem and really have no idea where start to look for a solution! i've my big function container (its a big read, i post it just for the records...): ...it contains all my functions for this mission, but...when i launch mission, it start say that FUNCTION_NAME is not defined (where "FUNCTION_NAME" is the name of one of my functions, that as you can see are defined. i pre-load the file containing the functions in my initServer.sqf : call compile preprocessFile "DDscripts\DWARfunctions.sqf"; null = [] spawn SPAWNERconvoyB; null = [] spawn SPAWNERconvoyR; null = [] spawn SPAWNERciv; null = [] spawn SPAWNERind; null = [] spawn SPAWNERmine; even more strange, i noticed adding >> uiSleep 10; between a function spawn and another, some start to work!! i even started to think its like the functions are not pre-loaded, and server dont recognize them ! but isnt supposed to do this the >> calling compile preProcessFile ... ?? i'm seriously confused....any light on this? thanks !
  2. dlegion

    function spawn error

    ok done, it keeps saying that its undefined variable, but i've tried to name each function one by one, precompile each function one by one, and for now it seems to work! SconvoyB = compileFinal preprocessFileLineNumbers "DDscripts\SPAWNERconvoyB.sqf"; SconvoyR = compileFinal preprocessFileLineNumbers "DDscripts\SPAWNERconvoyR.sqf"; Sciv = compileFinal preprocessFileLineNumbers "DDscripts\SPAWNERciv.sqf"; Sind = compileFinal preprocessFileLineNumbers "DDscripts\SPAWNERind.sqf"; Smine = compileFinal preprocessFileLineNumbers "DDscripts\SPAWNERmine.sqf"; null = [] spawn SconvoyB; null = [] spawn SconvoyR; null = [] spawn Sciv; null = [] spawn Sind; null = [] spawn Smine; ...pretty no-sense to me....anyway for now it seems to work.
  3. dlegion

    function spawn error

    i tried....i dont know...it still gives the same "undefined variable in expression" error
  4. dlegion

    function spawn error

    no, i start all them from scripts, the nearest thing i have to start from init is a vehicle init calling a script *.sqf that will spawn a function. i tried as you say, with this in initServer.sqf: DWARfunctions = FALSE; waituntil {DWARfunctions}; ...and this at the end of DWARfunctions.sqf : DWARfunctions = TRUE; ...tested, game starts, no error, nothing spawns, waited 7 minutes (game running at 78 fps) and still no sign of passed "waituntil" ...whats wrong here ?? thanks guys!
  5. i think i reached an acceptable point, with this code an AI sniper can reliably hit a man at 2000m even at night during a rainstorm in 30 seconds of shooting, but as suggested it MUST have M302 LRR and LRPS optic (with nightstalker or other rifles performance degrade a lot): // null = [this] execVM "SNIPE.sqf"; // in unit init to run script. for best result, use a sniper with M320 LRR .408 rifle and LRPS optic //(yes, even at night and in a rainstorm...it should hit 1 man in 1 minute of shooting at 2000m, vanilla arma3) /* Author: HallyG Parameter(s): 0: [OBJECT] - Object who is 'looking' 1: [OBJECT] - Object to look for 2: [NUMBER] - Looker's FOV (OPTIONAL) DEFAULT (70) Returns: [BOOLEAN] */ Dlos = { params [["_looker",objNull,[objNull]],["_target",objNull,[objNull]],["_FOV",70,[0]]]; if ([position _looker, getdir _looker, _FOV, position _target] call BIS_fnc_inAngleSector) then { if (count (lineIntersectsSurfaces [(AGLtoASL (_looker modelToWorldVisual (_looker selectionPosition "pilot"))), getPosASL _target, _target, _looker, true, 1,"GEOM","NONE"]) > 0) exitWith {false}; true } else { false }; }; _Tside = west; // manually define ENEMY side to shoot at _S1 = (_this select 0); _S1 disableAI "PATH"; _S1 setUnitPos "DOWN"; _S1 disableAI "AIMINGERROR"; //_S1 disableAI "FSM"; _S1 setSkill 1; while {true} do { _Dtargets = []; {if ((_x distance2D _S1) < 2000 && (side _x == _Tside) && (alive _x)) then {_S1 reveal [_x,4];_Dtargets pushBack _x}} forEach allunits; _Tcount = count _Dtargets; if (_Tcount > 0) then {_Target = (selectRandom _Dtargets);_S1 doTarget _Target;_S1 doSuppressiveFire _Target;uiSleep 0;if ([_S1, _Target] call Dlos) then {_S1 forceWeaponFire [(currentWeapon _S1), "Single"];};}; _S1 setVehicleAmmo 1; uiSleep 5; }; thanks guys for your help, happy shooting!
  6. yeah! doSuppressiveFire works better, but its still very, very, very unrealiable! i came up with this : // null = [this] execVM "SNIPE.sqf"; // in unit init to run script _Tside = west; // manually define ENEMY side to shoot at _S1 = (_this select 0); _S1 disableAI "PATH"; _S1 setUnitPos "DOWN"; _S1 disableAI "AIMINGERROR"; _S1 disableAI "FSM"; _S1 setSkill 1; while {true} do { _Dtargets = []; {if ((_x distance2D _S1) < 2000 && (side _x == _Tside) && (alive _x)) then {_S1 reveal [_x,4];_Dtargets pushBack _x}} forEach allunits; _Tcount = count _Dtargets; if (_Tcount > 0) then {_Target = (selectRandom _Dtargets);_S1 reveal [_Target,4];_S1 dotarget _Target;_S1 doSuppressiveFire _Target;uiSleep 3;_S1 forceWeaponFire [(currentWeapon _S1), "Single"];}; _S1 setVehicleAmmo 1; uiSleep 7; }; with this code it is forced to shoot...while aiming a targer, so it kinda works....but there are 2 problems : its still very inaccurate at long ranges (1000m-1500m range) and the baddest problem...it is forced to try shoot even if there is no line of sight (imagine throught mountains, LOL). any idea how solve this problem once for all ? thanks!
  7. lol it bugged and i cant write after selecting genesis..mah! well i wished to ask if and ahow you make sniper shoot far, because i've huge troubles doing it, even using this script: _sniper2 = (_this select 0); _sniper2 disableAI "PATH"; _sniper2 setUnitPos "DOWN"; _sniper2 setSkill ["spotDistance", 1]; _sniper2 setSkill ["spotTime",1]; //_sniper2 dowatch (this getrelpos [150,0]); while {true} do { _Dtargets = []; {if ((_x distance2D _sniper2) < 2000 && (side _x == west) && (alive _x)) then {_sniper2 reveal [_x,4];_Dtargets pushBack _x}} forEach allunits; _Tcount = count _Dtargets; // hint "sniper choose new target"; if (_Tcount > 0) then {_Target = (selectRandom _Dtargets);_sniper2 reveal [_Target,4];_sniper2 dotarget _Target;_sniper2 doFire _Target;}; _sniper2 setVehicleAmmo 1; uiSleep 20; }; thanks!
  8. hm...doing more tests seems the "unrealiable" part is linked to the weather. at 12:00 of a sunny day it works perfectly, while in a cloudy day or at dawn and dusk it start to be unrealiable.... any idea if this somehow can be "skipped" ? thanks!
  9. thanks GOM! ...but the script i posted in the first post doesnt do much or less the same? // null = [this] execVM "SNIPE.sqf"; // in unit init to run script hint "sniper script started"; _sniper2 = (_this select 0); _sniper2 disableAI "PATH"; _sniper2 setUnitPos "DOWN"; _sniper2 setSkill ["spotDistance", 1]; _sniper2 setSkill ["spotTime",1]; //_sniper2 dowatch (this getrelpos [150,0]); while {true} do { _Dtargets = []; {if ((_x distance2D _sniper2) < 2000 && (side _x == west) && (alive _x)) then {_sniper2 reveal _x;_Dtargets pushBack _x}} forEach allunits; _Tcount = count _Dtargets; hint "sniper choose new target"; if (_Tcount > 0) then {_Target = (selectRandom _Dtargets);_sniper2 dotarget _Target;_sniper2 doFire _Target;}; _sniper2 setVehicleAmmo 1; uiSleep 20; }; thanks man ! i'm getting mad on this one!
  10. ....so i assume there's no way to simply force "reveal 4" on a unit ? because right now the limit is still around 1000m ...and a nightstalker seems to not work in day for AI, so i need to swap it with LRPS optic, and even at this point, its not very reliable...seems that lynx-LRPS equipped sniper now can't shoot at me ... dont know...maybe its some sort of locality issue....sometimes they shoot sometimes they dont....maybe its ACE3 the problem...damned ARMA3
  11. and again you were fast, correct, and with a solution at hand. Grumpy, can i offer a couple of beers to you on paypal ? really , really thanks man!
  12. Well...as you can see in my script i have both, but the idea of put nightstalker optic is simply genious ! Will try asap ! Thankss
  13. dlegion

    BIS respawn bug?

    will test and report back! thanks!
  14. for now i found a satisfactory solution, doing this: mines encounter "frequency" can be set by setting distance. far from perfect, but works (with underwater mines too!).
  15. a specific problem: this code spawns mines....without end. it keep spawning them endlessly! (while it should stop at _MaxMines , set to 3) any idea? ========= E D I T ============ i fear i found why...its a sort of know problem: ...so no variables to mines...BUT i noticed you still can give a name to the mine..hehehe..so its a kind of "variable"... now i have no idea how i can spawn everytime a different name, everytime starting with "DELETE" (for example the script should spawn the first time a mine named "DELETEmine1", the second time a mine named "DELETEmine2" ecc.. what i know is that this code below should work to discriminate (and for example delete) every object with "DELETE" in its name : {_prefix = [_x,0,5] call BIS_fnc_trimString;if(_prefix == "DELETE") then {deleteVehicle _x;};} foreach (allMissionObjects ""); help plz :)
  16. eh... eh....sadly yes, its a persistent mission, its supposed to run endless (but for obvious tecnical limit server machine reboot every night), and in fact previous version was running ok for at least 3 days , so my target is still "at least 24h". hem...sorry but the latest part is very confusin for me.... i just wish to filter civilians "human" or "human driven" units, so civilian infantry and civilian vehicles, and mines too. and i still cant understand how do it thanks for your help! ============= E D I T ================ i still cant understand where to search for a tree-list of this classes ! thats probably the key problem!
  17. dlegion

    BIS respawn bug?

    thanks! no init.sqf at all, initServer.sqf call compile preprocessFileLineNumbers "Dfunctions.sqf"; ["Initialize"] call BIS_fnc_dynamicGroups; // Initializes the Dynamic Groups framework bis_fnc_drawminefields_active = true; // disable mines map markers? initPlayerLocal.sqf uiSleep 2; player setDamage 1; // placed to try workaround respawn bug when it happened to other people on server, and i was admin, i noticed that when they cannot spawn because the respawn menu isnt there, theyr player is in fact spawned and alive, so killing it will make them see the respawn screen....so the idea to put a self-kill on first respawn.....it works (i know becasue sometimes i spawn and NOT die....so it must have already happened without notice!), but not always!
  18. every game object is considered civilian, i've troubles filtering real units (like men, cars, planes ecc..) from buildings! any idea on this ? _allINDEP = "(getNumber (_x >> 'scope') == 2) and {(getNumber (_x >> 'side') == 3) and {(getText (_x >> 'vehicleClass') == 'Car')}}" configClasses (configFile >> "CfgVehicles"); i dont know where find classes like: ['Armored', 'Car', 'Air'] , or even better a classes tree to better understand!
  19. dlegion

    BIS respawn bug?

    eh.. i tried both respawnOnStart 0 and 1 , tried with and without description.ext, the problem still happens, quite often if as soon as i launch the game, i open editor, load a mission, and launch "test in MP". problem happens to other players too.
  20. grumpy... you are really a master scripter! ultra thanks for this clear, well-made and detailed explanation with examples! finally you explained a thing i noticed in the past but have no idea was the reason behind it (or how improve it)! really really thanks ! now i kinda feel guilty to not have explained it before, in my mind it was kinda obvious, anyway i'm sorry about it: in fact time is not a problem at all....because this "ambient AI bubble" is meant to populate the otherwise empty map, so actually there's no hurry to do it, because i usually spawn AI at range from 2000m+ , to not "harm" players or appear under theyr eyes. the idea is to spawn units "just beyond typical players horizon" ...that in my experience is around 2km except for pilots or "extreme range enthusiast snipers". then this units will patrol randomly....so they can randomly go in the direction of players (and maybe spot&fight them) or simply go in another direction until too far from players, and get deleted by the other script. and the cycle will restart forever. so...really thanks for this awesome explanation, i will make treasure of it for the other scripts! what really scares me, is the long-term performance. i mean: on a dedicated server, after 24 hours of running, will it impact somehow ? and how clear it to keep the cycle clean as if was it first hour running? i assign every spawned unit a variable...i have to destroy it manually before delete? huge thanks again man!
  21. i found a simple way to discriminate the types of units spawned: now i have no idea how make infantry spawn in groups of more than 1 unit (lets say 2-4 units). groups of 1 single soldier are not very realistic.... any help is welcome ! thanks !
  22. dlegion

    BIS respawn bug?

    i still have this problem. bug image 1 and bug image 2 still need a solution....often if i open the game, load editor, and launch an MP with custom respawn it happens, while if i launch first a SP mission, then an MP with custom respwn it loads correctly...
  23. finally i made it work! yeah! now i have to find a cheap way to make boats appear and patrol water , vehicles patrol roads , infantry patrol houses ecc.. any help is welcome :)
  24. i'm breaking my head.....i'm sorry but ...where you find 'car', 'armored' ecc? i'm also stuck into a "logic problem": how can i set it so i have ( for example) at least 1 tank, 1 AAA, 10 infantry ecc..? because in theory it can spawn 100 infantry and no vehicles, or the opposite! please, may i have a working example of a "total random" choosing randomly between ALL independent INFANTRY, ARMORED (i think APC and AAA are included?), CARS, HELICOPTERS and PLANES ? huge thanks! PS: i'm keeping reading this page : https://community.bistudio.com/wiki/configClasses ...but cant get it to work...
×