Evil_Echo 11 Posted January 27, 2011 Version 2.1 is now available. Posting at http://www.armaholic.com/page.php?id=11755 Changes include. Ability to terminate ECHO FSMs. Ability to create artillery batteries dynamically. Minor bug fixes. Updated documentation. Enjoy. Share this post Link to post Share on other sites
bigpickle 0 Posted January 27, 2011 Congrats on the latest release mate :) Share this post Link to post Share on other sites
das attorney 857 Posted January 27, 2011 Thanks for the updated version EE - much obliged :) I can generate the batteries dynamically and it's working great. It took me a bit of time to work out how to kill the FSM, but it's working perfectly now. For quick reference if anyone else is interested: _ok = [sCRIPTHANDLE_OF_YOUR_FSM] call ECHO_fnc_KillFSM; Share this post Link to post Share on other sites
Evil_Echo 11 Posted January 27, 2011 Glad the changes are working for you. And that is the correct call for terminating a FSM. Sorry for not including that in the intro section, just had put a write-up in the function calls section. Share this post Link to post Share on other sites
das attorney 857 Posted January 27, 2011 No probs mate. :) I had a suggestion for the mod: At the moment, a Functions module is required for Fire Director to run correctly. Could you include the following in the scripts to preclude the need for putting a Functions module in the mission? if (isNil "bis_fnc_init") then { _ECHO_center = createCenter sideLogic; _ECHO_group = createGroup _ECHO_center; _functions_module = _ECHO_group createUnit ["FunctionsManager", position player, [], 0, "NONE"]; }; I've put this into the init of what I'm working on and it seems fine. Just a thought. Share this post Link to post Share on other sites
Evil_Echo 11 Posted January 27, 2011 I've thought about an initialize routine and perhaps a module logic to use for the mission editor. But wanted to get 2.1 out in quick order, this other stuff would take some reorganization. Glad to see we are thinking along similar lines though. :) Share this post Link to post Share on other sites
dmarkwick 261 Posted January 28, 2011 Nice one EE :) Share this post Link to post Share on other sites
Two Dogs 12 Posted January 29, 2011 Does anyone have a good Echo + DAC mission I could use as an example. I was hoping to use Echo spotters and fire direction with DAC camp units. Share this post Link to post Share on other sites
dmarkwick 261 Posted January 29, 2011 ;1845062']Does anyone have a good Echo + DAC mission I could use as an example. I was hoping to use Echo spotters and fire direction with DAC camp units. Yeah sure I can give you my test mission, which I use to test new builds of Fire & Smoke. Let me lose some irrelevent stuff and I'll post it up for you :) Share this post Link to post Share on other sites
das attorney 857 Posted February 1, 2011 Echo, I'm having some issues with including globalChat/sidechat from the artillery batteries in something I'm working on. The batteries are dynamically created and I followed the guide for doing it from the readme and then by looking at your example mission. I'm using this: _shot = { private ["_ob", "_bat", "_pos", "_grid"]; _ob = _this select 0; _bat = _this select 1; _pos = _this select 2; player sideChat format["ECHO FD – Shot. Out. %1 %2 %3", _ob, _bat, _pos]; }; _splash= { _ob = _this select 0; _bat = _this select 1; _pos = _this select 2; player sideChat format["ECHO FD – Splash. Out %1 %2 %3", _ob, _bat, _pos]; }; _complete = { _ob = _this select 0; _bat = _this select 1; _pos = _this select 2; player sideChat format["ECHO FD – Rounds Complete. %1 %2 %3", _ob, _bat, _pos]; }; _nomish = { _ob = _this select 0; _bat = _this select 1; _pos = _this select 2; player sideChat format["ECHO FD – No Mission. %1 %2 %3", _ob, _bat, _pos]; }; _check = { _ob = _this select 0; _bat = _this select 1; _pos = _this select 2; player sideChat format["ECHO FD – Checking fire. Out.. %1 %2 %3", _ob, _bat, _pos]; }; and: _ok = [ARD_Battery, "Zeta", _shot, _splash, _comp, _nomish, _check] call ECHO_fnc_SetBatteryDialog; No sideChat appears though. I've tried different ways of doing it but still no luck (eg declaring variables as private and then not declaring etc). What do you think I'm doing wrong here? I can send you a test mission if that helps. Also, I noticed during testing that the artillery will hit a target, then even if the target is destroyed, another fire mission will be called onto the (now flattened) target before the FSM decides to target something else. Maybe I'm using intervals values that are too low, but I tried the recommended 60 seconds between fire missions and the behaviour remained the same. I'll try higher values to see if they help, but I wanted to mention it just in case. I'm using the first version of the FSM (ie not firedirector2). Share this post Link to post Share on other sites
Evil_Echo 11 Posted February 6, 2011 Back from vacation.... DA, I'll look at your sidechat issue to see what might be the matter, my guess being it's tied to sideChat itself and the battery gamelogic (which is on it's own side). As per continued fire, that can happen due to time of flight of shells and other things. Tuning the interval to longer values can help. Also I would recommend use of firedirector2 for all new missions, keeping the first version around merely for backwards compatibility. Share this post Link to post Share on other sites
das attorney 857 Posted February 6, 2011 Cheers for the heads up mate. :) Hope you had a good time on holiday et all. I'll move over to firedirector2 and check it out. I've been trying longer routines on your suggestion and there seems to be a lot less target duplication. With respect to the sideChat issue: I think it may be because I'm using dynamic batteries and the Fnc that deals with communication doesn't seem to recognise the dynamic battery at this point. Any batteries generated at mission init seem to be okay though. Share this post Link to post Share on other sites
Evil_Echo 11 Posted February 6, 2011 Rgr on the clarification of the sideChat issue. When using dynamic batteries, I create the module as belonging to it's own side. Perhaps using the side of the leader might be more appropriate there. Easy test would be to use global chat vs side chat to see if messages come out. Also the BIKB system might work there. If this is a game-breaker bug, I can make a fix for you ( all ) in short order. Just let me know. Share this post Link to post Share on other sites
das attorney 857 Posted February 6, 2011 It's not a game breaker by any standards, I'll just wait for an update. I couldn't get globalChat to work either though. I did try editing the side of the module in the fnc_createbattery as well but that didn't work for me. Share this post Link to post Share on other sites
Evil_Echo 11 Posted February 8, 2011 This may not be a problem with dynamic batteries. Working 1-on-1 with DA on this. Share this post Link to post Share on other sites
demon cleaner 1 Posted February 27, 2011 (edited) Hi all! I'm having some trouble with the script version of ECHO. I'm using ECHO v2.1 on Utes. I've tried to stay as close as possible to the battery setup from the examples. The problem relates to ArmA OA 1.57 / CBA 0.7.3.148 / ECHO v2.1 Here's some info: Echo init: http://pastebin.com/piSbkp50 Echo setup: http://pastebin.com/4rirWGWM arma2oa.RPT http://pastebin.com/h2uRc7jw The artillery is working (at least _en_battery_01 does) but it's always throwing those location related error messages. Error in expression <t 2; _Overlap = false; if ( (typeName _Location) == "LOCATION" ) then { if ( > Error position: <_Location) == "LOCATION" ) then { if ( > Error Undefined variable in expression: _location File D:\My Documents\ArmA 2 Other Profiles\Demon%20Cleaner\mpmissions\template_test_001.utes\ECHO\FireDirector\Scripts\fnc_IntoLocation.sqf, line 22 Error in expression <= false; { if ( [_new_coords, _radius, _x ] call ECHO_fnc_IntoLocation ) exitWi> Error position: <_x ] call ECHO_fnc_IntoLocation ) exitWi> Error Undefined variable in expression: _x "Fire mission FM-0-CL-0-0, at [2958.76,3862.48,-1.18526], 39.7693 mils, 7 rounds HE" "Waiting 66 seconds" "Waiting 52 seconds" The second battery (_en_battery_02) however does not fire at all. Instead an expression error appears as can be seen in the arma2oa.RPT (pastie above) starting on line 133... "Smoke And Illumination battery firing WP" Error in expression <stics select 0; _minRange = _ballistics select 1; _maxRange = _ballistics select> Error position: <select 1; _maxRange = _ballistics select> Error Zero divisor Any thoughts on this would be appreciated. If you need more information let me know. Edited February 27, 2011 by Demon Cleaner Share this post Link to post Share on other sites
Evil_Echo 11 Posted February 27, 2011 A couple thoughts on the problem. I see you setting up artillery modules by hand and not initialising them. You should do that for at least one instance to ensure the ballistic tables are loaded. Which is likely why your WP fire mission is barking. Not sure why you are doing that at all since you are using dynamic batteries and ECHO will set up the modules for you inside of that routine. The error regarding _Location seems to point to bad data. The syntax of both the function and calls inside the FSM are correct ( not an argument mis-match ) so only way _Location could be undefined is there had to be bad data fed to ECHO_fnc_SetBatteryExclusionList. I note that while you did get the return value for the calls to that function you did not check results for true/false. I suspect that it rejected the entry for "west_hq", but cannot prove that from the reports you provided. Note well - location in this context is a ArmA location value - normally predefined on the map or created via the createLocation command. It cannot be a mere marker, vehicle or unit. Share this post Link to post Share on other sites
demon cleaner 1 Posted February 27, 2011 (edited) A couple thoughts on the problem.I see you setting up artillery modules by hand and not initialising them. You should do that for at least one instance to ensure the ballistic tables are loaded. Which is likely why your WP fire mission is barking. Right! I did forget about that. I've amended now the code to look like this: // Create artillery battery 01 _en_battery_01_gun_01 = "2b14_82mm_INS" createVehicle (getMarkerPos "mkr_en_battery_01_gun_01"); _en_battery_01_gun_02 = "2b14_82mm_INS" createVehicle (getMarkerPos "mkr_en_battery_01_gun_02"); _en_battery_01_gun_03 = "2b14_82mm_INS" createVehicle (getMarkerPos "mkr_en_battery_01_gun_03"); _en_battery_01_gun_04 = "2b14_82mm_INS" createVehicle (getMarkerPos "mkr_en_battery_01_gun_04"); // Set up artillery guns for battery 01 _en_battery_01_guns = [ _en_battery_01_gun_01, _en_battery_01_gun_02, _en_battery_01_gun_03, _en_battery_01_gun_04 ]; // Initialize artillery battery guns // {_x setVehicleInit "[this] call BIS_ARTY_F_initVehicle";} forEach _en_battery_01_guns; {[_x] call BIS_ARTY_F_initVehicle;} forEach _en_battery_01_guns; // Create artillery battery 02 _en_battery_02_gun_01 = "2b14_82mm_INS" createVehicle (getMarkerPos "mkr_en_battery_02_gun_01"); _en_battery_02_gun_02 = "2b14_82mm_INS" createVehicle (getMarkerPos "mkr_en_battery_02_gun_02"); _en_battery_02_gun_03 = "2b14_82mm_INS" createVehicle (getMarkerPos "mkr_en_battery_02_gun_03"); _en_battery_02_gun_04 = "2b14_82mm_INS" createVehicle (getMarkerPos "mkr_en_battery_02_gun_04"); // Set up artillery guns for battery 02 _en_battery_02_guns = [ _en_battery_02_gun_01, _en_battery_02_gun_02, _en_battery_02_gun_03, _en_battery_02_gun_04 ]; // Initialize artillery battery guns // {_x setVehicleInit "[this] call BIS_ARTY_F_initVehicle";} forEach _en_battery_02_guns; {[_x] call BIS_ARTY_F_initVehicle;} forEach _en_battery_02_guns; Unfortunately the WP fire mission is still acting up... More ideas ? Not sure why you are doing that at all since you are using dynamic batteries and ECHO will set up the modules for you inside of that routine. Can you be more specific please ? I'm not sure I'm following. The error regarding _Location seems to point to bad data. The syntax of both the function and calls inside the FSM are correct ( not an argument mis-match ) so only way _Location could be undefined is there had to be bad data fed to ECHO_fnc_SetBatteryExclusionList. I note that while you did get the return value for the calls to that function you did not check results for true/false. I suspect that it rejected the entry for "west_hq", but cannot prove that from the reports you provided. Note well - location in this context is a ArmA location value - normally predefined on the map or created via the createLocation command. It cannot be a mere marker, vehicle or unit. All additional locations (including west_hq) have been created using the following vehicle init line: enObjectTarget0 = createLocation ["Strategic",getPosASL this,50,50]; en_bunker_0 = createLocation ["Strategic",getPosASL this,50,50]; en_bunker_1 = createLocation ["Strategic",getPosASL this,50,50]; en_bunker_2 = createLocation ["Strategic",getPosASL this,50,50]; en_bunker_3 = createLocation ["Strategic",getPosASL this,50,50]; en_bunker_4 = createLocation ["Strategic",getPosASL this,50,50]; west_hq = createLocation ["Strategic",getPosASL this,75,75]; I've implemented a check for _dc_ok to be true/false but I always receive true so I believe the data fed to ECHO_fnc_SetBatteryExclusionList to be correct. // HE rounds _dc_ok = [_en_battery_01,6.9] call ECHO_fnc_SetBatteryMaxSpeed; _dc_ok = [_en_battery_01,12.5] call ECHO_fnc_SetBatteryMinDispersion; _dc_ok = [ _en_battery_01,[ enObjectTarget0, en_bunker_0, en_bunker_1, en_bunker_2, en_bunker_3, en_bunker_4, west_hq ] ] call ECHO_fnc_SetBatteryExclusionList; hint format ["%1",str _dc_ok]; sleep 1; // Smoke and illum rounds _dc_ok = [_en_battery_02,6.9] call ECHO_fnc_SetBatteryMaxSpeed; _dc_ok = [_en_battery_02,12.5] call ECHO_fnc_SetBatteryMinDispersion; _dc_ok = [_en_battery_02,"SAI",_shot,_splash,_comp,_nomish,_check] call ECHO_fnc_SetBatteryDialog; _dc_ok = [ _en_battery_02,[ west_hq ] ] call ECHO_fnc_SetBatteryExclusionList; hint format ["%1",str _dc_ok]; sleep 1; Still the location error remains. I must be missing something but I'm to tired now to spot it I guess. Thanks for looking into this ! Edited February 28, 2011 by Demon Cleaner Share this post Link to post Share on other sites
CaptainBravo 0 Posted March 5, 2011 Excellent script Evil_Echo! Gives a realisim to AI artillery in game. I have tried to incorporate the script version into a mission (copying all files into mission folder) but having a bit of an issue. Independent artillery (replaced russians) worked fine but west artillery would not fire even though all four observers were near enemy targets. Maybe because the east/ind enemy is spawned? Also not sure after readig docs how does the east artillery work since I could not see any observers like the west has? Share this post Link to post Share on other sites
Evil_Echo 11 Posted March 5, 2011 East certainly does work, my QA tests include batteries from both sides. You can designate any type of unit as an observer. I tend to prefer sniper/scouts for that role, but you are free to choose whatever suits the mission. Even a UAV should work. Two things that could prevent targeting. The batteries were too close/far/out-of-arc for that target. The other is if their were friendly units too close to the danger-zone ( danger-close ). The debug log would indicate those situations, raise the debug level if needed temporarily to see what the FSM was thinking about. Share this post Link to post Share on other sites