1 more question

0,2000,0,“default,0.4+(0*x)”, this is a line from binge drinking situation. Anyone know what it means ?

0,4000,0 another example from the black market situation

To take the binge drinking line, it starts with a hash, then it says “BingeDrinking” - this is it’s system name, the name you use to refer to it in events, policies, etc., then you have the GUI name - the name that shows up in the game. Next the explanation of what the problem is. Next the segment of the game it shows up in (“LAWANDORDER”). Next the icon for it. Next the messages that show when the situation starts and ends.

You seem to have copied the line from this part. The first number you quote represents whether it is a positive or negative situation - 0 means that it is negative, as opposed to 1 which means that it is positive - eg. tourism. The next number is the cost (the actual cost in the game depends on the wealth of the country in the missions file, but obviously the higher the number you put here, the higher the cost of the situation). Not sure what the next number is - it’s set to 0 for all existing situations, so I’d leave this on zero if I was you.

After this are the inputs or causes of this situation. The game adds up all the inputs, as it does with events or dilemmas. If the situation is not “active”, then it will activate/appear once the total reaches 0.6. The situation will then remain active until the total drops back under 0.4.

To take binge drinking, then, the calculation works like this.

  • default,0.4+(0*x) simply means that you start the calculation with 0.4.
  • The next thing is CrimeRate,0+(0.8x) - this means that the crime rate (a number ranging from 0 which means no crime to 1 that means maximum crime) is multiplied by 0.8, and then nothing is added. So, let’s assume crime is at 0.5, the outcome of this equation is 0.80.5, or 0.4. Added to the default value of 0.4, we’re now at 0.8.
  • Next is CommunityPolicing,-0.1-(0.25x). Let’s assume the slider on community policing is set at maximum, this equation becomes -0.1-(0.251) - the outcome being -0.35. Essentially the number outside the brackets is the bonus just for having community policing in the first place. So, added to out running total, we now have 0.45.
  • Next is AlcoholLaw,0.1-(0.7x). Let’s imagine you have set this slider at minimum - that’s 0. The outcome of the equation is 0.1-(0.70) or 0.1-0. Essentially here the bit outside brackets means that if alcohol law is at minimum, as in this example, there is actually an increase in binge drinking caused by alcohol law - obviously, really. But the higher you take this slider, the less the increase, and eventually the bigger the decrease in binge drinking. The 0.1 sort of moves the zero point - the point at which alcohol law has no effect on binge drinking - to the right. Thus the total outcome is 0.1. Add this into the mix and we have 0.55.
  • Finally PoliceForce,0-(0.15*x). So, if we have a good police force, let’s say 0.75, then the outcome of this equation is -0.1125 - yes, I used a calculator to work that out. Throw it into the mix and the outcome is 0.4375.

The outcome of this equation is thus 0.4375. This means that if the situation was not active, then it would not activate this turn. However, if it was already active, then this figure would not be quite low enough to deactivate it.

After the hash is then the effect of the situation being active, in the case of binge drinking it is Lifespan,0-(0.12*x). The x is the value of the situation - in this case 0.4375. Thus this situation would on this particular turn decrease lifespan by 0.0525.

As you’ve seen above, you can use policies (eg. community policing) or simulation values (eg. crime rate) as inputs in deciding whether a situation activates/deactivates. You can also use the “winning” value. This is a value ranging from 0 to 1, representing how well the player is doing - 0 means really badly, 1 means really well. You’ll see this used in a number of events. If you want to make a situation harder to deal with as the player does better, you can add in something like winning,-0.1+(0.35x). To apply it to the situation above, let’s imagine the player is doing terribly - his “winning” score is 0. The outcome of this final equation is -0.1+(0.350) or -0.1+(0) or -0.1. The outcome of the binge drinking situation calculation would then be 0.3375 - enough to deactivate it if it were active.

However, as the player starts to do better, and gets up to a score of, say, 0.5, the “winning” calculation is now -0.1+(0.35*0.5), or -0.1+(0.175) or 0.075. Added in to the binge drinking situation equation, this is 0.4375 + 0.075, or 0.5125. You can see that this would not reactivate the situation, but would now not be enough to deactivate it either.

Finally, if the player starts doing fantastically well, we’re now talking -0.1+(0.35*1) or -0.1+(0.35) or 0.25. Added to 0.4375, the outcome of the other inputs into the binge drinking situation, we get 0.6875. This means that although the player may earlier have deactivated the situation, it will now be reactivated.

This represents the fact that people will get more demanding the more successfully the player is doing. If the country is a disaster zone, people may have more important things to worry about than binge drinking. However, as other things start to get sorted out, people’s expectations start to increase. Almost any level of binge drinking will not be tolerated in a virtual utopia.

It also helps to solve the problem that the original game generally provides a lot of situations to deal with at first, but once they have been dealt with, leaves little else to do. Once a situation has been dealt with in the original game, it rarely reoccurs later. This makes the start of the game disproportionately difficult and the later stages disproportionately easy. Adding the winning tag to situations helps relieve some of the pressure early on, but then keeps it on for much longer into the game, and means both that situations may reoccur as you do better to continue to test you, and also that once you deal with a situation, you can’t just ignore it, you have to keep improving. If you want to see an example of this, download my situations file upgrade, positech.co.uk/democracy2/ho … pgrade.zip, which adds this winning tag to all the original situations that come with the game.

Hope this helps.

You’ve been great help TomPhil thank you!

I’m working on a new mod which adds aliens to the game -secretly living among us- like Men In Black if you know the movie.
They give you technology, and maybe reveal themselves if you please them (Best) or conquer the world (Worst) in the opposite.
Adds 10-15 new policies, dilemmas, events, situations, attacks…

Thanks to you I’ll be able to complete it!

Wow, that seems like a major project! Good luck with that.

If you haven’t already, you might like to look at my State Union mod, which is the only major mod pack I know of that has been created for Democracy 2. You can get it from tinyurl.com/5nvq69. If you have the version from the mods page on the Positech website, download the one from the link I’ve given here as it’s newer.

You will see some events in it that are conditional on other events. In my mod, the State Union issues a Directive, and then if you don’t comply, you get a fine. How this works is that the “child” event - the one conditional on another event, does not have a high enough value to trigger on its own. The “parent” event - the one that the child is dependent on - uses the “creategrudge” command to “activate” the child event. So the SUDDisabilityBenefit event contains in its OnImplement the line CreateGrudge(SUDDisabilityBenefit,SUDFDisabilityBenefit,1,1);. The SUDFDisabilityBenefit event has only one “influence”, which is 0 = “DisabilityBenefit,0-(0.8*x)”. The event therefore can never display on its own, but once the SUDDisabilityBenefit event has run, the value of the SUDFDisabilityBenefit event is increased by 1. This means that where there is no disability benefit (x = 0), the influences on this event come to 0, but with the 1 added on from the other event, it is enough for the event to display. I hope this makes sense. Take a look at them. I think that you may well find this useful in making your own mod.

Something else that you might find useful that isn’t really documented anywhere. When you are testing your events, dilemmas and situations in the game, you can press Ctrl + SHIFT + E, Ctrl + SHIFT + S or Ctrl + SHIFT + D. These will show all the events/situations/dilemmas (depending on which letter you press), and you can click on each one to see what values all the equations come to and what the total of them all is. Take a look at it - it’s extremely useful.

Hope this helps.