sickboy 13 Posted June 14, 2008 That's awesome news Rommel! Eagerly awaiting your new version :-) (BTW, I was wondering why the gamelogic is used at all?) Share this post Link to post Share on other sites
johnnyboy 3797 Posted June 14, 2008 Rommel: Good news. Instead of suppressor targeting foe or a gamelogic at foe's position, a simple "suppressor dowatch getpos foe", points the suppressor in the right direction. In this test I did not use commandTarget or doTarget at all. Still using MandoAngles to prevent shooting too far off mark as well. No crashing, more suppressing fire, and no wild shooting. Looks promising. Will clean it up and post it over at ofpec for your review later tonight hopefully. Share this post Link to post Share on other sites
Rommel 2 Posted June 14, 2008 Funny enough, this was my original code, but as noted it was way too random in every direction. However using a simple atan2 as like in mando_angles I was able to fix this. VERSION 112 RELEASED. Check first post for updated download link. Share this post Link to post Share on other sites
xeno 234 Posted June 14, 2008 Nice work Rommel, thank you. Xeno Share this post Link to post Share on other sites
Guest Posted June 14, 2008 New version frontpaged at the Armaholic.com homepage. The Armaholic.com download page can be found here: http://www.armaholic.com/page.php?id=3053 Share this post Link to post Share on other sites
johnnyboy 3797 Posted June 14, 2008 New code is looking nice and lean! I think the angle code is wrong though (still shooting all over). If you change this: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">_v = (((getPos _u select 0) - (getPos _u select 0)) atan2 ((getPos _f select 1) - (getPos _f select 1))) +360 % 360; to this: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> _v = (((getPos _u select 0) - (getPos _f select 0)) atan2 ((getPos _f select 1) - (getPos _u select 1))) +360 % 360; ...it will then match the code in mando_angles function. Question: Is there a performance reason for shortening all the variable names? Share this post Link to post Share on other sites
Rommel 2 Posted June 15, 2008 Ah bugger. Thats why... quick fix. Sorry for the incon ArmAholic and other places who mirrored. Thank you Xeno for the help and ideas you sent me, and to that aswell Sickboy and JohnnyBoy. Regarding the variable names, it was simply because I read them more easily when their shorter. More manageable. First page update (112.2) Share this post Link to post Share on other sites
Deadeye 1 Posted June 15, 2008 ArmedAssault.info Mirror (fixed version) : http://www.armedassault.info/download.php?cat=addons&id=506 Any chances to get that script in a self activating pbo version? Share this post Link to post Share on other sites
Guest Posted June 15, 2008 Latest version frontpaged at the Armaholic.com homepage. The Armaholic.com download page can be found here: http://www.armaholic.com/page.php?id=3053 Share this post Link to post Share on other sites
Hadudy 0 Posted June 15, 2008 oh hello, is there a way to make an unit execute the startup script upon mission test start automatically? like umm adding it into config? im the kinda guy who places three or four platoons on the map and starts blasting. thangs for any constructive reply Share this post Link to post Share on other sites
mattxr 9 Posted June 15, 2008 oh hello, is there a way to make an unit execute the startup script upon mission test start automatically? like umm adding it into config? im the kinda guy who places three or four platoons on the map and starts blasting.thangs for any constructive reply like an addon executes on all groups auto. Share this post Link to post Share on other sites
Rommel 2 Posted June 15, 2008 Ah shut up the lotta ya's. Like a bunch of birds eating fries but wanting the fish. Sickboys done it all (addon wise). Im just going to be working with him on updating it to newest version plus a few other fixes. Expect a addon within a few days chaps. Share this post Link to post Share on other sites
nikita320106 0 Posted June 17, 2008 wow) another one thanx for another necessary reliase) //but second why you already don't use "getHideFrom" and "setHideBehind" with "findcover"?? //or can I be wrong? Share this post Link to post Share on other sites
Rommel 2 Posted June 18, 2008 wow)another one thanx for another necessary reliase) //but second why you already don't use "getHideFrom" and "setHideBehind" with "findcover"?? //or can I be wrong? Because it does almost nothing, taking fire is about getting down fast, the ai dont have a concept of this and them moving towards cover is as close as it will get due to their pathfinding issues. Moving behind cover provided worse or in some cases no results in comparison. Share this post Link to post Share on other sites
nikita320106 0 Posted June 18, 2008 ok) thanx for reply) what do you planing next??) Share this post Link to post Share on other sites
Rommel 2 Posted June 18, 2008 My next heading will be a combination of improved current features and newer ones. I'm not entirely sure, but I will be working away on it. Share this post Link to post Share on other sites
law-giver 190 Posted June 22, 2008 Man i love the addon version. I was playing cRCTI and viewing the game with the real time editor when a resistance unit was flanking and one of my soldiers spotted him, branched off then started following him. Crouched then took him out, and returned to what he was doing previously. Even taking the towns takes longer than normal. Brilliant work Rommel, Sickboy etc etc. Will you be adding a function for ai to enter and check buildings or enter and take up positions in buildings. That would be so cool. Anyway thx for improving the gameplay even more with your excellent ai script/addon. Â Share this post Link to post Share on other sites
Rommel 2 Posted June 28, 2008 You could guys should complain more. <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> /* ROMMELS IMPROVED AI (LITE); Version: 112 [14, 06, 2008]; Author(s): Rommel [rommelvonrichtofen_at_bigpond.com]; Execution: nul = [group this] call compile preProcessFile "ROMM_IA.sqf"; */ if !(isServer) exitWith {}; _fA = { _g = _this select 0; _s = _this select 1; _b = _this select 2; _f = _this select 3; _l = leader _g; {_x doFollow _l; _x setUnitPos "AUTO";} forEach units _g; _g setCombatMode _b; _g setSpeedMode _s; _g setFormation _f; _k = false; }; _fB = { private ["_g", "_d", "_o", "_u"]; _g = _this select 0; _d = _this select 1; _g setCombatMode "YELLOW"; _g setSpeedMode "FULL"; _g setFormation "LINE"; _o = []; {[_x, _k, _d] spawn _fC} forEach units _g; _k = true; {[_x, _d] spawn _fD} forEach units _g; }; _fC = { private ["_u", "_k", "_d"]; _u = _this select 0; _k = _this select 1; if (_k) exitWith {}; _u setUnitPos "DOWN"; if (count _this > 1) then { _d = _this select 2; _u doWatch [(getPos _u select 0)+ sin(_d) * 43,(getPos _u select 1)+ cos(_d) * 43, (getPos _u select 2) + 1]; }; doStop _u; }; _fD = { private ["_u", "_d", "_i", "_t", "_f","_v"]; _u = _this select 0; _d = _this select 1; _t = "Logic" createVehicleLocal [0,0,0]; _f = _u findNearestEnemy getPos _u; _u reveal _f; if !(vehicle _f in crew _f) exitWith {}; _i = 0; while {(alive _u) && (_i < 28)} do { _u doWatch position _f; sleep (random 3.0); _v = (((getPos _u select 0) - (getPos _f select 0)) atan2 ((getPos _u select 1) - (getPos _f select 1))) +360 % 360; if (abs _v < 32) then { _t action ["useWeapon",_u,_u,1]; }; _i = _i + 1; }; deleteVehicle _t; }; private ["_g", "_i", "_k","_s", "_b", "_l", "_d", "_t", "_o", "_od", "_c"]; _g = _this select 0; _i = {alive _x} count units _g; _k = false; _s = speedMode _g; _b = combatMode _g; _f = formation _g; _c = -1; sleep (random 10.0); While {_i > 0} do { if (isNull _g) exitWith {}; If (_i > count units _g) then { {[_x, _k] spawn _fC} forEach units _g; _c = _t + 43; _i = {alive _x} count units _g; }; _l = leader _g; _d = getDir _l; _t = time; if (!(isNull _l)) then { _o = nearestObject [_l, "BulletBase"]; If (!(isNull _o)) exitWith { _od = getDir _o - 180; If ((_od < _d + 109 AND _od > _d - 109) OR (_od > _d + 109 AND _od < _d - 109)) then { [_g, _od] call _fB; _c = _t + 73; }; }; }; If (_c != -1 AND _t > _c) then { [_g, _s, _b] call _fA; _c = -1; }; sleep (random 3); }; Tested and Works in Warfare, code name "ROMM_IA (LITE)" Its just the basics with a heavy on initial suppression to give the extra heat to those fightfights. Now the problem with the initial script was that it WASNT EVEN WORKING. <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> _v = (((getPos _f select 0) - (getPos _u select 0)) atan2 ((getPos _f select 1) - (getPos _u select 1))) +360 % 360; Needs to be: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> _v = (((getPos _u select 0) - (getPos _f select 0)) atan2 ((getPos _u select 1) - (getPos _f select 1))) +360 % 360; I couldnt help but wonder... why are they not firing!? Its because it was getting the angle of you to them, not them to you (you being you or the people shooting them). I'll be releasing a fixed version with new features soon, just got on holidays so expect a huge amount of improvements!!! Romm out. Share this post Link to post Share on other sites