New update:
- Remove hardcode for player array (I'm using switchableUnits and playableUnits to count the players instead depending on whether you're on MP or SP). You should be able to disableAI on the mission without breaking it now.
- Added another Random Marker-Based spawn option. This pretty much is like the last marker spawn randomly on the map and find nearestBuilding except that the marker will be placed only on land and not water (so this will avoid the ocean). This will reduce the super high probability of your town being a coastal town.
- Added nearestLocations based spawn where a randomize Location object from Arma 3 is picked then place a marker around that area and use nearestBuilding to place you in a building in that city, village, etc. There are 5 Random Location parameters to choose from....
+ CityCapital only; CityCapital, City; CityCapital, City, Village; CityCapital, City, Village, Local; Marine (close to ocean)
- I fixed a code for loadouts at the end for hintsilent say the uniform name if you're naked to count uniform instead of count weapons... This is used for debugging purposes in case you guys have no uniforms or weapons.
I think its good enough now. I was testing the crap out of it although I can still find some bugs here and there that I cannot reproduce and disappear when I reload the mission or whatsoever.
Issues I came across:
- After not hardcoding the player spawns, all the spawns that are not predefined by the mission making, may have a chance of not spawning the player at the designated spawn point (so the player is pretty much stuck far away from the objective). I tried to add a hint to switchableUnits count and playableUnits count and it says 16 so that's correct. I had a feeling that something interrupted the code for counting playable or switchable units so it didn't get all the players, not sure. I clicked team switch before the script finished running. I ran the mission again and got same problem some times, then relaunch again multiple time and it was completely okay so I have no idea...
- False negatives with "missing weapons" on hints. Makarovs, CZ Phantom, pistols should have the proper ammo and gun now. I did got a couple X not missing but I already encountered for weapons. I didn't get that anymore though later so no idea....
- naked dude. I swore all the uniforms I tested with forceAddUniform should work. I don't know about the U_Marshall from the Karts DLC for those who don't have it, but I was naked once while testing (low ammo if naked
), but other than that I haven't been naked. No idea on problems, but I'm suspecting the Kart DLC uniform, but I'm not completely sure myself.
Overall, I'm probably about to port this over to Altis soon after my finals. I'm not sure if this post is clear on some points. I'm going to take a break now since my forearms are a bit sore-ish and I can't think much while I'm writing this.