Step 3:
Probably the most feared step. Actually making some code.
I have tried to explain what I do in the following with Green lines of explanatory text. If its complete gibberish to you, then ask me, and I will try to explain. But basically, this is what I do.
I set the event to be a Round Event, which means it will only be checked at the start of a round. (always remember, you take your turn in each round, if you remember that, then what is a round check and a turn check won´t confuse you.)
The first line of code I do checks which round it is. If it is the 10th round, then the code springs into action. If not, nothing happens. (Because everything is indented below it, it is all part of the check. You might read the line as IF round = 10, then do the indented stuff).
I then make a LOOPER, which is basically a way to do something over and over, just increasing the iteration of it once each time, until it reaches the end point (end point included). In this case it is a looper that starts at 0, and ends at CheckRegimeCount. That last piece of code is just saying to the computer, all the regimes are included.
So what do i do. I change the DipBlock status of the regimes in qusetion (all of them) to being not blocked any more. So now people can declare wars, enter alliances, go to peace, and what not.
Then i tell the computer (or event executioner if you will) that I wish to end the loop here. So it will only loop through those commands below the indention, until it reaches the End Looper.
Them comes the messy part of the code. And by that i mean i could have done it so that it could be replicated in a 4 player, 5 player or so on game. I did not.
Instead I wrote three lines of code, with all the possible combinations of wars that could be done. I changed the relationships of each regime to be at war with all other regimes. First regime 0 with 1, then regime 0 with 2 and then regime 1 with 2. All regimes are now at war.
If there had been more regimes, there would be more lines.
For instance, 5 regimes would be.
0 and 1
0 and 2
0 and 3
0 and 4
1 and 2
1 and 3
1 and 4
2 and 3
2 and 4
3 and 4
So you can see this method is quick to code for few regimes but obviously could be made better with some nifty coding (which I wasn´t in the mood for).
In any case, having done what is needed, in round 10, I now end the event code with a EndCheck, and the code is done.
Save the scenario, and test
