Comrade12 0 Posted June 29, 2008 Im working on some mfcti scripts and wanted to add in some vehicles the ai will buy. How would I go about doing this? this script is from "buylightapc" Last modified 5/21/3 ;Script usage:  [Group,true/false,Factory,Resources] Exec "BuyLightAPC.sqs" ;Use to make AI randomly purchase an APC. _side = _this Select 0 _group = _this Select 1 _teamPurchase = _this Select 2 _factory = _this Select 3 _resources = _this Select 4 ? (_side == east):goto "BuyEast" #BuyWest _vehicleType = M113Type [_side,_factory,_vehicleType,noScript,_group,_teamPurchase] Exec "Main\BuyVehicle.sqs" Exit #BuyEast ;Add APCS here. Exit              Edit: Could I just add another vehicle type right after _vehicleType = M113Type and whats up with add east apcs here. thanks for any help! Share this post Link to post Share on other sites
Pulverizer 1 Posted June 30, 2008 Try the easiest way first: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> ; ### add your custom classes here ### _myVehTypes = [M113Type, "Bradley", "Vulcan", "JeepMG"]; _vehicleType = _myVehTypes select ((random count _myVehTypes)-0.5) [_side,_factory,_vehicleType,noScript,_group,_teamPurchase] Exec "Main\BuyVehicle.sqs" Note that it will almost certainly not work perfectly, if at all. Might have wrong number of crew, a player might not get the vehicle he ordered, wrong weapons, not have a marker etc. If it does work,when the AI buys an M113, it will randomly get one of the 4 vehicles in that array. Share this post Link to post Share on other sites
Comrade12 0 Posted June 30, 2008 Hi sweet! Im definently going to try that stuff out. I have tried a bunch of different ways to get it to work and all I could acomplish was the ai buyng a jeep instead of a m113. Im just wanting the AI to buy diferent light vehicles instead of just one! Like a jeep, mgjeep,truck, and support units. The code just didnt have it in there. Thanks Im going to try this out right away!! Â Â Â Â Â Â Â Â Â Â Â Â Â EDIT:I get this error . '(addwestmannedVehicle== 0) |#|': Error Generic error in expression and the Ai do not buy light vehicles at all. Share this post Link to post Share on other sites