609_Relentov Posted November 17, 2016 Share Posted November 17, 2016 In a training mission I spawn a HMMWV/Tow via scripting, as well as an M818. However, when I attempt to reload the HMMWV with the M818, I see the message: Unable to start ammo replenishment: ammunition is not available as if there is no truck there. However, if I have an M818 vehicle placed in the mission via the Mission Editor, it will replenish. I'm wondering if there's something special I need to do with a spawned M818 such that it will be treated as a re-supply vehicle. Thanks, Relent Link to comment Share on other sites More sharing options...
Grimes Posted November 17, 2016 Share Posted November 17, 2016 To my knowledge there is nothing special required for it to work. I just tried it out on the tester version and it was working fine. Is playerCanDrive set to true for the M-818? That is about the only thing I could think of that might be causing it. That or a bug that exists in the release build but not a tester build, but that is fairly rare. The right man in the wrong place makes all the difference in the world. Current Projects: Grayflag Server, Scripting Wiki Useful Links: Mission Scripting Tools MIST-(GitHub) MIST-(Thread) SLMOD, Wiki wishlist, Mission Editing Wiki!, Mission Building Forum Link to comment Share on other sites More sharing options...
609_Relentov Posted November 17, 2016 Author Share Posted November 17, 2016 Thanks Grimes - yes, I set the playerCanDrive property to true, but then again, the M818 units I added via the mission editor had that property set to true as well. Any other ideas please throw those out as well! Link to comment Share on other sites More sharing options...
FlightControl Posted November 17, 2016 Share Posted November 17, 2016 Does the M818 have a route and did it move towards the HMMWV? Or is it just spawned and sits there? Also, is the M818 of the same country as the HMMWV? Try to spawn the HMMWV using the EXACT structure as in the mission file. check if that works. [TABLE][sIGPIC][/sIGPIC]| Join MOOSE community on: DISCORD :thumbup: Website of the MOOSE LUA Framework. MOOSE framework Downloads. Check out Example Missions to try out and learn. MOOSE YouTube Channel for live demonstrations and tutorials. [/TABLE] Link to comment Share on other sites More sharing options...
609_Relentov Posted November 17, 2016 Author Share Posted November 17, 2016 (edited) Thanks for the response FlightControl. You bring up a good point. When I used the mission editor I'm pretty sure the group/unit only had the spawn point with no additional waypoints. When I spawn the group/unit they always have the spawn point plus one waypoint. I will look into that and experiment some more (didn't realize that would make a difference to the behavior of an M818 ). The groups/units I'm spawning are all coalition.country.USA (from memory,not at my PC). I've compared the structure of the units in the mission file to what my script has and all of the properties look the same, which is one of the reasons I was scratching my head. Thanks, Relent Edited November 18, 2016 by 609_Relentov Link to comment Share on other sites More sharing options...
Grimes Posted November 18, 2016 Share Posted November 18, 2016 Being the same country and having a route shouldn't matter. The only requirement is that its on the same coalition and within the rearm range for that object, which is usually 200m. I've attached a test mission from 1.5.5 where it works for me. It uses mist.cloneInZone() because it is a quick and lazy way to spawn a unit. All that does is it makes sure to inherit the same properties of the existing unit placed in the editor. If that doesn't work it may be helpful to post a code snippet from however you are spawning it to see if anything is missing or incorrect or whatever.dynAdd_rearm.miz The right man in the wrong place makes all the difference in the world. Current Projects: Grayflag Server, Scripting Wiki Useful Links: Mission Scripting Tools MIST-(GitHub) MIST-(Thread) SLMOD, Wiki wishlist, Mission Editing Wiki!, Mission Building Forum Link to comment Share on other sites More sharing options...
609_Relentov Posted November 18, 2016 Author Share Posted November 18, 2016 Thanks Grimes, I'll check it out. Link to comment Share on other sites More sharing options...
609_Relentov Posted November 20, 2016 Author Share Posted November 20, 2016 Hey Grimes - I tried your mission and the first time the resupply seemed to work via LAlt-\. After I let the two units spawn, I fired off all of the tows on the M1045 TOW, then drove a short distance away. When I tried LAlt-\ it said no ammo available, which was expected. Then I drove the M818 and parked it nearby and this time the resupply worked, so check. I reviewed my scripts and after scouring the route/points and unit properties, the main thing I noticed is that for my template I included in the group: route.points[1].task.params.tasks[1].action = "EPLRS", so I reset the route.points[1].task.params.tasks table to nil, removing it. However, it didn't change the result, same as before. Then I tried your mission again, and this time, I moved the spawned M1045 TOW a lot further away from the original 2 units that were put in the mission editor. After using up all of the ammo, I moved the spawned M818 near the spawned M1045 TOW, and this time, I saw the same thing I saw in my case - Unable to start ammo replenishment: ammunition is not available. Grimes, can you re-play your mission again and try what I did - i.e. move the spawned units far away from the pre-existing units from the mission editor (e.g. a mile), then try to re-supply? Thanks! Link to comment Share on other sites More sharing options...
Recommended Posts