bolbies 13 Posted June 27, 2014 I play Dynamic Universal War System a lot so I need the AI's help regularly. Unfortunately, everyone knows the AI in this game is not the easiest thing to control and requires a lot of micromanagement. Getting medical attention either for myself or just other units is a massive pain. I've been looking around for an automatic AI medic script and have tried this and this but can't get either to work. Does anyone either have a general idea of how to write out a script like this or even know of one that does work? I have put this line in the medic's init field: _dummy = [_medic, units (group player)] execVM "autoheal\autoheal.sqf"; and in the autoheal.sqf I have this at the beginning: _medic = _this select 0; _selectedUnits = _this select 1; _injured = objNull; while {(alive _medic)} do { For some reason I am getting an error saying "Error alive: Type Array, expected Object." Anybody have any ideas on how I can fix this? Share this post Link to post Share on other sites
jcae2798 132 Posted June 28, 2014 Have you checked out A3 wounding system? Its a pretty neat freaking script but calls medic when unit goes down, not necessarily hurt.. http://forums.bistudio.com/showthread.php?170975-A3-Wounding-System Share this post Link to post Share on other sites
Beerkan 71 Posted June 28, 2014 Or...... Automated-medic script by bardosy Share this post Link to post Share on other sites
bolbies 13 Posted June 28, 2014 Have you checked out A3 wounding system? Its a pretty neat freaking script but calls medic when unit goes down, not necessarily hurt..http://forums.bistudio.com/showthread.php?170975-A3-Wounding-System I have been looking through it but I can't seem to find how it recognizes medics and uses them. I'll continue looking but this seems way more advanced than just assigning him the role when you spawn him. Or......Automated-medic script by bardosy Oh I guess I forgot to put links in the original post for "this and this." bardosy's script was one that I've tried but for whatever reason it refuses to work for me. The other is the WW AI Menu. ---------- Post added at 14:19 ---------- Previous post was at 13:54 ---------- Alright so I decided to go back and see what the specific error was for bardosy's script and it's literally the same thing. For whatever reason the medic's init field cannot define a variable. Obviously this is now a DUWS problem so I'll mess around more with that. Any more ideas would be greatly appreciated! Share this post Link to post Share on other sites
bolbies 13 Posted June 30, 2014 (edited) I think I've got almost everything working but there's an error here - if((_x isKindOf "B_Medic_F" || _x isKindOf "O_Medic_F" )&& ("Medikit" in (items _x))) then { _medicsHealing = true; [_x, _selectedUnits] spawn automedic; }; } foreach (_selectedUnits); saying "Error foreach: Type Object, expected Array." Does anyone know what's wrong? Edited June 30, 2014 by bolbies Share this post Link to post Share on other sites