• We have updated our Community Code of Conduct. Please read through the new rules for the forum that are an integral part of Paradox Interactive’s User Agreement.

Hardradi

Lt. General
34 Badges
Apr 20, 2008
1.450
7
  • Crusader Kings II
  • Hearts of Iron III
  • Hearts of Iron III: Their Finest Hour
  • Heir to the Throne
  • Europa Universalis: Rome
  • Semper Fi
  • Sengoku
  • Crusader Kings II: Horse Lords
  • Crusader Kings II: Way of Life
  • Mount & Blade: Warband
  • Crusader Kings II: Holy Knight (pre-order)
  • 500k Club
  • Rome: Vae Victis
  • Victoria 2
  • Europa Universalis III Complete
  • Europa Universalis III Complete
  • Prison Architect
  • For the Motherland
  • Divine Wind
  • Deus Vult
  • Europa Universalis III Complete
  • Crusader Kings II: Legacy of Rome
  • Crusader Kings II: Charlemagne
  • Europa Universalis IV
  • Crusader Kings II: The Old Gods
  • Crusader Kings II: Rajas of India
  • Crusader Kings II: The Republic
  • Crusader Kings II: Sons of Abraham
  • Europa Universalis IV: Res Publica
  • Crusader Kings II: Sunset Invasion
  • Crusader Kings II: Sword of Islam
  • Europa Universalis IV: Call to arms event
  • Europa Universalis IV: Wealth of Nations
  • Europa Universalis IV: Conquest of Paradise
:wacko:

I am trying to get a decision to work for a seazone. Basically I want it to be "allowed" when there is only one trireme in the sea province.

Test code so far as follows:

Code:
		allow = {
			291 = {
				and = {
				          units_in_province = this
				          NOT = { units_in_province = 2 }
				}
			}
                          }

Code:
		allow = {
			291 = {
				units_in_province = this
				NOT = { units_in_province = 2 }
			}
		}


Code:
		allow = {
			291 = {
				units_in_province = 0
				NOT = { units_in_province = 2 }
			}
		}

It then says:

(*) Mare Aegyptiacum
Have more units in Mare Aegyptiacum than 0
Have less units in Mare Aegyptiacum than2

That all looks perfect but the problem is even when I have zero ships in sea province 291 it is still "allowed". If I move in more than two it is no longer "allowed".

The "and" appears to make no difference.

Can anyone see what I have done wrong or what I need to change so that it read both parameters at the same time ?

Any help is much appreciated.
 
the first example is wrong, as units_in_province = this is a wrong comparison. all the other examples don't have an AND.

Use this code:

Code:
allow = {
		291 = {
			AND = {
			          units_in_province = 1
			          NOT = { units_in_province = 2 }
			}
		}
           }
 
Have you tried writing units_in_province = 1 instead?

Ah, I got it:

Code:
				units_in_province = 1
				NOT = { units_in_province = 2 }

Now it is "allowed" when one ship is in the sea province.

This most mean that 1 = 0 and 2 = 1. :rofl:

EDIT: You beat me to it adonys

Thanks guys
 
no, it doesn't mean 0=1 and 2=1

units_in_province = 1 comparison is true when 1 unit or more are in that province

Not = { units_in_province = 2 } comparison is true when in that province there are not 2 units or more

if both are true, then in that province is at least 1 unit, but not 2 or more, which obviously means they are both true when only 1 unit is in that province.
 
mostly because the two conditions are actually only one from developers point of view (he needs to check that there's only 1 unit in that province), and because the script doesn't offer any command to directly do so, we must use the little more than but less than trick. grouping them together makes sure that you won't overlook them in large scripts.

also, it forces the script compiler to group them together, and I can bet that leads to better interpreted and faster executed code, than having them separate or with other conditions interposed.
 
mostly because the two conditions are actually only one from developers point of view (he needs to check that there's only 1 unit in that province), and because the script doesn't offer any command to directly do so, we must use the little more than but less than trick. grouping them together makes sure that you won't overlook them in large scripts.

also, it forces the script compiler to group them together, and I can bet that leads to better interpreted and faster executed code, than having them separate or with other conditions interposed.

Appreciate the tips.

I have also found my worst work is done while under the influence. I usually have to rebuild it from the ground up to find the multiple errors that I have included.
 
Ok, got this going as per the posts above. Thankyou for the help

Code:
allow = {
		291 = {
			AND = {
			          units_in_province = 1
			          NOT = { units_in_province = 2 }
			}
		}
           }

My final problem is that I want to allow the decision when it is only a particular country that has 1 trireme in the province. Province 291 is a sea province by the way.

I have tried THIS and controls = 291 but I cant seem to link having the 1 trireme to the decision making country. :confused:

Also galleys_in_province and infantry_in_province do not appear to function in EUR even though they are in the exe.