Sirex1 10 Posted December 8, 2010 (edited) Hi! Introduction/Description: This is a script which makes infantry fighting vehicles and their infantry squad cooperate better. It does so in a simple way, when the vehicle discovers an enemy and the enemy is within preset engagement range then: 1. The vehicle stops. 2. The infantry squad dismounts and get locked out of their vehicle. 3. The infantry goes in to combat mode and moves to the enemy position. 4. The vehicle follows the infantry and support its attack. 5. After the engagement the infantry mounts up. This script is intended for use by anyone and as long as my nick is shown in my file i am happy. Feel free to integrate this script in your missions and or addons! This script is designed to be easy to customize and have good documentation. Planned features: Make the script work for choppers. Background: I am/was a trained mech infantry soldier, so when i saw the standard behavior of the ai during assault, with its constant dismount and mount up with no logic and that the ifv wondered off i decided to code my own ai script to solve this. So i started this summer and got a basic version up fast, but now i got a good version up which is highly customizable. The original thread is in the mission section here http://forums.bistudio.com/showthread.php?t=105064 . Install instructions: You download the demo mission. In it will be a file named init.sqf and a directory named "mechInfTac". These two you need to copy and place in your mission folder, then the script will activate for all vehicles which got infantry in their group, which is the standard behavior. Or you use the pbo, it might be outdated sometimes but i will try to keep it up to date. Instructions on how to only make it work for some vehilces (the script version not the pbo): In order to have different scripts with different variable values, thus behavior, running you need to copy the script and pass vehicle to the copy. You then edit the copy with the values you want. Example: I copy my script and rename the copy to mechInfTac_init_amph. In mechInfTac_init_amph i rename MechInfTac_LockCargo to MechInfTac_LockCargo_Amph. And in the init file i declare MechInfTac_LockCargo="false"; and MechInfTac_LockCargo_Amph="true"; And then i pass all my LAV vehicles to mechInfTac_init_amph and the rest of the vehicles on the map to the ordinary mechInfTac_init script. Features and Options: - Provides more realistic combat behavior from mechanized infantry squads. - Default behavior is that the script identifies every ifv with a squad on the start of the mission, in cargo or dismounted, and connects these to each other via code (2 arrays with same index) and activates the script for these units. - Can be changed via init file value so it discovers new vehicle with infantry continually during game run. - Can easily be modified so it only activates the script for the vehicles you pass to the script, just disable the automatic discovery code and pass an array with vehicle objects in the init file, instructions are on the top of the script file in comments and in the init file. - In init their is a variable to make the ifv halt and stand still during combat. - Easy to customize the behavior during different parts of the combat. - Script only tested with IFV and APC. - Tested with vanilla Arma2. But i have AO also. - Added so you can lock the infantry in to the cargo with radio command or by global value. - Known problems, sometime if the soldier the vehicle is following dies the ifv might wounder off a bit, but often it will stay with the group and if it moves if often does so to a better firing position or to the current waypoint. Please give feedback and request for features and report bugs! Also i would like to thank a bunch of people who helped me in the Mission thread, also the guy who made Squint, excellent tool! http://www.mediafire.com/download.php?t2d6nbg77c28neo The important files are the mechInfTac_init.sqf (located in the directory mechInfTac ) which contains the script, then the init file that has some instructions, also their now exist a readme.txt file. This zip contains a demo mission. Only readme file. http://www.mediafire.com/?hy0ianuholl354q Also got an amphibious assault demo where the infantry is locked in the cargo untill they hit the beach. http://www.mediafire.com/?68bpy83npah3t4c Pbo version with standard behavior. http://www.mediafire.com/download.php?1yzqux7ckuswqrj Edited April 2, 2011 by Sirex1 Share this post Link to post Share on other sites
warrior2seven 10 Posted December 8, 2010 Cool, im gonna have to give this one a look, I too am/was a Mech Infantryman, and it does get frustrating when things dont go how you know they should. Share this post Link to post Share on other sites
BigMorgan 11 Posted December 8, 2010 This sounds pretty good. I'm always trying to work out ways to give an authentic approach to mech. infantry in the editor because you generally either get a whole squad killed by one RPG riding inside or to prevent that you basically have infantry moving on foot followed by their vehicle (who tries to keep whatever infantry formation the group is in) and it takes 10 minutes to move 1km. Thanks for sharing. Share this post Link to post Share on other sites
Binkowski 26 Posted December 8, 2010 this is something i've been looking for, for a long time. thank you! Share this post Link to post Share on other sites
das attorney 858 Posted December 9, 2010 (edited) Congrats on the release of your script. :) I've been testing it and really enjoyed the results. I had a few ideas for expanding the script but I'll post them over on the E&S forum. Cheers :) EDIT: lol at the word "pubis" in the download link. /?mnlpubis3cxrj Edited December 9, 2010 by Das Attorney Share this post Link to post Share on other sites
KeyCat 131 Posted December 9, 2010 Thanks for making and sharing, sounds very interesting... /KC Share this post Link to post Share on other sites
TRexian 0 Posted December 9, 2010 Interesting! I actually have a mission I'm working on now where I can use this. :) Share this post Link to post Share on other sites
Sirex1 10 Posted December 9, 2010 Thanks for all the positive replys! Please give feedback on how you felt the script worked out once you tried it! @ Das Attorney: Make sure you do :). Share this post Link to post Share on other sites
Banderas 0 Posted December 9, 2010 Nice script idea, will test it! I would like to ask if it's possible to add a function into it that prevents mounted infantry to dismount in certain situations, I was trying to make an amphibious landing mission but when the swimming vehicles contacted some infantry on the beaches they started to drop their grunts into the water...I mean in vanilla, not with this script of yours. Share this post Link to post Share on other sites
manzilla 1 Posted December 9, 2010 Interesting! I actually have a mission I'm working on now where I can use this. :) Me too! Perfect timing! Thanks a ton! Share this post Link to post Share on other sites
mcvittees 0 Posted December 9, 2010 Like the idea of this, will give it a go asap! Share this post Link to post Share on other sites
CameronMcDonald 146 Posted December 9, 2010 Me too! Perfect timing! Thanks a ton! I also as well in addition can use this on a self-made WIP mission. Cheers. :) Share this post Link to post Share on other sites
Sirex1 10 Posted December 10, 2010 (edited) Thansk guys, hope it lives up to your expectations! Nice script idea, will test it!I would like to ask if it's possible to add a function into it that prevents mounted infantry to dismount in certain situations, I was trying to make an amphibious landing mission but when the swimming vehicles contacted some infantry on the beaches they started to drop their grunts into the water...I mean in vanilla, not with this script of yours. Yes that is possible, the only question is how you want that controlled? A global variables in init would effect all the scripts running and all ifv. A passed variable from init file, to my knowledge, would not be changeable in the script. P.S I mean that you would not be able to switch it on or of from the init file when the script has already launched. But maybe a global would work in your case? Other solution is that some sort of formation leader have a radio option, like the menu 9, to enable or disable dismounts. I have thought about these options but have postponed them since i am unsure how to implement the control mechanics. But i guess i could make a quick global init solution quick if you want it. Have anyone tried the script yet? Would be happy to hear some feedback :). Edited December 10, 2010 by Sirex1 Share this post Link to post Share on other sites
Banderas 0 Posted December 10, 2010 Well, possibly a variable from an init line, and activated when reaching a certain waypoint, because landing AAVs/LAVs would probably come ashore at different times, so the "lock inside APC" might better be deactivated individually to avoid late comers giving a bath for their passengers. My workaround for this problem was to place the passenger "team" far away, then used a "moveincargo" command for one of the waypoints for the LAV. Also, LAVs seemingly has a higher tendency to drop their units at first contact than AAVs. Share this post Link to post Share on other sites
jblack9 10 Posted December 11, 2010 Hi is there a chance somebody can explain to me how I use this? Share this post Link to post Share on other sites
Sirex1 10 Posted December 11, 2010 (edited) Well, possibly a variable from an init line, and activated when reaching a certain waypoint, because landing AAVs/LAVs would probably come ashore at different times, so the "lock inside APC" might better be deactivated individually to avoid late comers giving a bath for their passengers.My workaround for this problem was to place the passenger "team" far away, then used a "moveincargo" command for one of the waypoints for the LAV. Also, LAVs seemingly has a higher tendency to drop their units at first contact than AAVs. Yeah i guess each ifv object could have an additional variable that allows or disallows dismount between waypoints. But i am not in favor of hardcoding a solution that only works for the first waypoint, that would limit to many people. But i could try to make it a radio command, initially for all the ifv on your team, and or for every ifv in your group. The radio command would be able to switch this variable which locks the cargo between waypoints, and when they reach the waypoints it unlocks. Hi is there a chance somebody can explain to me how I use this? Sure! Have you tried the mission? You download the demo mission. In it will be a file named init.sqf and a directory named "mechInfTac". These two you need to copy and place in your mission folder, then the script will activate for all vehicles which got infantry in their group, which is the standard behavior. Then you simply start up your mission and the script will work for the mission with the standard behavior, which is detect all vehicles with an infantry group and activate the script for these. I will update the first post with install instructions. Edited December 11, 2010 by Sirex1 Share this post Link to post Share on other sites
Uziyahu--IDF 0 Posted December 12, 2010 This franchise has needed this since its inception. It has always been something that has bothered me, too. An IFV/APC that has dismounted its troops is a force to be reckoned with, not taken out with one RPG. And chance this can be made to work with Air Assault units (troops riding in helos, who will drop off their troops near the enemy, at a fairly safe distance, and cover them from above)? Share this post Link to post Share on other sites
stun 5 Posted December 12, 2010 Are you planning on making a PBO version so that it automatically works for all existing missions? Share this post Link to post Share on other sites
Sirex1 10 Posted December 14, 2010 This franchise has needed this since its inception. It has always been something that has bothered me, too. An IFV/APC that has dismounted its troops is a force to be reckoned with, not taken out with one RPG.And chance this can be made to work with Air Assault units (troops riding in helos, who will drop off their troops near the enemy, at a fairly safe distance, and cover them from above)? You might try it with airborne now. Their is no code that is land specific i think. As long as helicopters count as vehicle i think the code could be stretched. Problems would probably arise from that the detection variable is only 175 meters right now, try increasing this. I will ofcourse try also but i don't know when i have time, got some exams coming up now before chirstmas. After that i go home and i don't think i will have a computer that runs arma2. I will see if i manage to press in an airborne solution. Are you planning on making a PBO version so that it automatically works for all existing missions? I have no experience with it but i will look into it and see if i manage to come up with something :p. Oterwise, anyone got any feedback from testing the scripts? @Das Attorney: Feel free to post your ideas for the script :). Share this post Link to post Share on other sites
stun 5 Posted December 14, 2010 @Sirex1 you could ask Das Attorney about how to convert your script into a pbo I believe he has done it with his all round defence script. Share this post Link to post Share on other sites
Uziyahu--IDF 0 Posted December 14, 2010 Thanks for the answer. One last idea: a script that would make wheeled vehicle troops and contractors dismount when ambushed. I'm wondering if decreasing the distance to 50 meters for wheeled vehicles might accomplish that. Share this post Link to post Share on other sites
Sirex1 10 Posted December 15, 2010 (edited) Well, possibly a variable from an init line, and activated when reaching a certain waypoint, because landing AAVs/LAVs would probably come ashore at different times, so the "lock inside APC" might better be deactivated individually to avoid late comers giving a bath for their passengers.My workaround for this problem was to place the passenger "team" far away, then used a "moveincargo" command for one of the waypoints for the LAV. Also, LAVs seemingly has a higher tendency to drop their units at first contact than AAVs. I have fixed it for you :). Right now you can lock infantry in to the cargo by two ways, either a global variable in the init file " MechInfTac_LockCargo = "true"; " or by radio if you are atleast a group leader. I have provided an amphibious assault demo so you see how the code works! Will update the first post, here is the amph demo. They update individually when they reach the waypoint. http://www.mediafire.com/?68bpy83npah3t4c Also you can still have the rest of the vehicles on the map in a mechInfTac script that runs seperate so they don't get their infantry locked up. Only change the name of "MechInfTac_LockCargo" in the amphibious script version and in the init file. Example: I copy my script and rename the copy to mechInfTac_init_amph. In mechInfTac_init_amph i rename MechInfTac_LockCargo to MechInfTac_LockCargo_Amph. And in the init file i declare MechInfTac_LockCargo="false"; and MechInfTac_LockCargo_Amph="true"; And then i pass all my LAV vehicles to mechInfTac_init_amph and the rest of the vehicles on the map to the ordinary mechInfTac_init script. @Sirex1 you could ask Das Attorney about how to convert your script into a pbo I believe he has done it with his all round defence script. Will do that! Thanks for the answer.One last idea: a script that would make wheeled vehicle troops and contractors dismount when ambushed. I'm wondering if decreasing the distance to 50 meters for wheeled vehicles might accomplish that. Yes decreasing detection distance should accomplish that, since that controls when the script activates. The variable you want to change, on two places, is: (_ifvArray select _newIfv) setVariable ["_distance", 150, true]; to (_ifvArray select _newIfv) setVariable ["_distance", 50, true]; You could use a version of the method i explained above to only have it execute for the vehicle you want. Create a second version of the script where the detection distance is lowered and pass it the wheeled vehicles. Edited December 15, 2010 by Sirex1 Share this post Link to post Share on other sites
Banderas 0 Posted December 16, 2010 Thank you Sirex, hopefully I can test it in the following days. Share this post Link to post Share on other sites
noricum 10 Posted December 16, 2010 hey, first of all, good work with the script! I have a question; i'm thinking bout implementing this script to Domination, will there be a (huge) decrease of server performance, if i let the script constantly check for mech. inf groups? thx in advance for the info! Share this post Link to post Share on other sites