Made a major accomplishment today that took hours. I already had the role system in, and it would allow players to assume the roles of other players if those players quit (for example, the commander quits, the next player to join becomes commander). Now, however, I have finished some EXTREMELY intense code (
) that auto-switches players to fill vital roles in the game. If the commander quits, a captain will switch to the commander position, and a soldier, if there is an extra one, will take the captain's place. I also have created auto assignment of soldiers for each captain, so now the captains can easily see the list of soldiers under their command. The whole system seems to be working, recycling and trading positions as players quit and join. Tomorrow, I will use what I have to create a menu where captains and commander will be able to select players under their command, and select specific orders.
Also, I have created a varied maximum captain limit that changes automatically based on the number of players on each team, to avoid having all captains and no soldiers. If there are too few players on a server, I plan to have a warm-up mode that will still be very playable, where players can spawn and just fight each other while they wait for more players to join.
EDIT: Instead of making a third post in a row, I will just edit. You can now fully issue commands to other players. There are a couple features to tweak, but it all works. Simply select a player, then select a command. In this way, a commander will order a specific captain to fortify in area (in any way the captain chooses so long as it gets done), and the captain can order specific taks to specific units in his squad, like unit #1 build a tower, unit #2 build sandbags or a wall, unit #3 stand guard while construction goes on.
This will be where the game really shines.
I also made it so that vehicles now spawn at the garage. I have yet to let the commander choose which vehicle will spawn. It will be automatic, so that vehicles appear once a garage building finishes building one, but the commander will choose which vehicle. I need to enforce a vehicle limit, and ensure that the vehicles train in such a way so that they are parked appropriately in the garage. Also, more than one player can hop into the driver's seat at the moment, so I need to tie up that loose end. Once that's done, I can start adding the siege tower, and other vehicle physics, such as mowing people down.
All in all the game is coming along well, and it's all starting to come together. A beta is starting to become more and more realistic.