[TECH] - Elections! v1.0
A working example of a complete Elections mechanism for a Second Consul for Rome.
The elections are held, and after the winner is decided, it will be given the Second Consul title. After his office term expires (45 days), he will have the Second Consul title removed, and a new election will be held.
In order to make this work, I had to develop a special mechanism which actually keeps the elections in a random AI country (in order to have access to AI throwing the dices for the options, as only AI can fire the ai_chance effect) and sends the results back to the republic!
Also, as this is a [TECH] example, it is filled up with testing messages and you'll have to don't get upset on me because of them) (they could be made as silent AI events for display purpose, but I'm lazy and I don't have time for cosmetics) 
Be careful though, the conditions required to participate in the Second Consul Elections conditions are VERY HARD to meet:
1) the character must a male having over 42 years, no ruler or prisoner in order to can hold the Second Consul title and participate to Elections
2) to win the Elections for the Second Consul title having:
- Senate and Patricians support (with the biggest chance to win the elections) a candidate must be from the biggest party (to get Senate's support), be a patrician (have a family prestige over 1000 in order to get Patricians' support) and be known (have a popularity over 60)
- Senate, Equestrian and Plebeian support (with a modest chance to win) a candidate must be from the biggest party (to get Senate's support), be an equestrian (have a family prestige over 500 and bellow 1000 in order to get Equestrian's support) and be popular (have a popularity over 80)
- Plebeian support (with an almost impossible chance to win) a candidate must not be patrician or equestrian (have a family prestige bellow 500) and be very popular (have 100 popularity)
Of course this process can, must and will be enriched. A few quick things I think I'll do:
- have several Elections sequences (events), allowing candidates meeting more different conditions to participate in the Elections process (an event will check first conditions for A, B and C social election interest groups and will pick up a candidate 1 for the second Elections round; another event will check the last conditions for D, E and F social election interest groups and will pick up another candidate 2 for the second Elections round; and finally, a final Elections round event will chose between the candidate 1 and candidate 2 picked up in the first elections round, resulting a winner picked up from 6 possible condition groups (the ai_chance function only allows atm only 3 options, at least never saw it used with more than 3, and I didn't had time to check if having more than 3 options works)(LATER EDIT: actually I've found at least one case in which PI uses an ai_chance function with more than 3 options, so it can be made to have more than 3 of them on a round)
- have several special characters marked during the time between two consecutive elections by special events (for example: character X becomes a New Man!) and participating by default in the second Elections round
- some more things (don't have time to detail all of them right now)
The screenshots bellow are illustrating this mechanism with the Plebs winning the Elections for a Second Consul : (please take not that the message stating the Plebeian elections victory contains a wrong description (I've modified the conditions and forgot to fix the description in the test example I've got the screenshots from).
PS: I've also added an easy version, with relaxed conditions and greater class historical accuracy for learning (just 18 years old required for Second Consul position; in martial, civic or religious party and just 20 popularity for Senate and Patricians; in mercantile party and just 30 popularity for Equestrians, Senate and Plebeians and in popular party with just 40 popularity for Plebeians)
Changelog
v1.01
easy version fixed/tweaked
A working example of a complete Elections mechanism for a Second Consul for Rome.
The elections are held, and after the winner is decided, it will be given the Second Consul title. After his office term expires (45 days), he will have the Second Consul title removed, and a new election will be held.
In order to make this work, I had to develop a special mechanism which actually keeps the elections in a random AI country (in order to have access to AI throwing the dices for the options, as only AI can fire the ai_chance effect) and sends the results back to the republic!
Be careful though, the conditions required to participate in the Second Consul Elections conditions are VERY HARD to meet:
1) the character must a male having over 42 years, no ruler or prisoner in order to can hold the Second Consul title and participate to Elections
2) to win the Elections for the Second Consul title having:
- Senate and Patricians support (with the biggest chance to win the elections) a candidate must be from the biggest party (to get Senate's support), be a patrician (have a family prestige over 1000 in order to get Patricians' support) and be known (have a popularity over 60)
- Senate, Equestrian and Plebeian support (with a modest chance to win) a candidate must be from the biggest party (to get Senate's support), be an equestrian (have a family prestige over 500 and bellow 1000 in order to get Equestrian's support) and be popular (have a popularity over 80)
- Plebeian support (with an almost impossible chance to win) a candidate must not be patrician or equestrian (have a family prestige bellow 500) and be very popular (have 100 popularity)
Of course this process can, must and will be enriched. A few quick things I think I'll do:
- have several Elections sequences (events), allowing candidates meeting more different conditions to participate in the Elections process (an event will check first conditions for A, B and C social election interest groups and will pick up a candidate 1 for the second Elections round; another event will check the last conditions for D, E and F social election interest groups and will pick up another candidate 2 for the second Elections round; and finally, a final Elections round event will chose between the candidate 1 and candidate 2 picked up in the first elections round, resulting a winner picked up from 6 possible condition groups (the ai_chance function only allows atm only 3 options, at least never saw it used with more than 3, and I didn't had time to check if having more than 3 options works)(LATER EDIT: actually I've found at least one case in which PI uses an ai_chance function with more than 3 options, so it can be made to have more than 3 of them on a round)
- have several special characters marked during the time between two consecutive elections by special events (for example: character X becomes a New Man!) and participating by default in the second Elections round
- some more things (don't have time to detail all of them right now)
The screenshots bellow are illustrating this mechanism with the Plebs winning the Elections for a Second Consul : (please take not that the message stating the Plebeian elections victory contains a wrong description (I've modified the conditions and forgot to fix the description in the test example I've got the screenshots from).
PS: I've also added an easy version, with relaxed conditions and greater class historical accuracy for learning (just 18 years old required for Second Consul position; in martial, civic or religious party and just 20 popularity for Senate and Patricians; in mercantile party and just 30 popularity for Equestrians, Senate and Plebeians and in popular party with just 40 popularity for Plebeians)
Changelog
v1.01
easy version fixed/tweaked
Attachments
Last edited: