Hello everyone; I've been working on a few scripts and so far I've had some difficulty with the `realm` scope. Maybe someone might be able to shed some light on what I'm doing wrong?
For starters, I wanted to select all Nestorian provinces under the Abbasid Caliphate. The first idea was doing this:
However, running this with the console yields the following output in game.log:
So, the limit is wrong, somehow. So I take a step back and enumerate all the provinces of e_arabia:
And then we get the following result:
Ok, so it wasn't the limit clause. I'm not sure why any_realm_province is failing to enumerate the provinces of the Abbasid Empire, but we can always switch the logic around. Even though it is more expensive, we can enumerate all provinces and then filter for those in the Abbasid Empire:
This yields exactly zero lines of output, so I decided to enumerate all provinces and list their realm:
This yields a great many lines, which I will sample below:
So now we have something strange turn up: even though the localisation command This.Realm.GetFullName shows the correct realm, the actual scope realm is returning an odd object with a null name and a null ID! Now clearly, those belong to a realm, or the localisation command ought to return empty, as well, right? But, looking at the wiki, the realm is meant to be called from a character or title scope, so I insert an intermediary scope for county, like this:
This yields:
So even calling realm from county scope, we still get a bad value, which is what is causing (I think) the any_realm_province and the limit = { realm = { title = /*whatever*/ } } fail.
However, it is unthinkable that a scope which is supposedly used in several places in the base game could be broken like this; I can only imagine the number of events that would be broken along with it. So it is probably still something I'm doing that I shouldn't be. Can anyone see what is going on? I would appreciate a couple of pointers, if possible.
Cheers for the attention!
For starters, I wanted to select all Nestorian provinces under the Abbasid Caliphate. The first idea was doing this:
Code:
e_arabia = {
log = "This is the [This.GetFullName]"
any_realm_province = {
limit = {
religion = nestorian
}
log = "> The [This.Religion.GetName] province of [This.GetName] ([This.GetID])"
}
}
However, running this with the console yields the following output in game.log:
[effectimplementation.cpp:18398]: EVENT [769.1.1]:This is the Abbasid Empire
So, the limit is wrong, somehow. So I take a step back and enumerate all the provinces of e_arabia:
Code:
e_arabia = {
log = "This is the [This.GetFullName]"
any_realm_province = {
log = "> The [This.Religion.GetName] province of [This.GetName] ([This.GetID])"
}
}
And then we get the following result:
[effectimplementation.cpp:18398]: EVENT [769.1.1]:This is the Abbasid Empire
Ok, so it wasn't the limit clause. I'm not sure why any_realm_province is failing to enumerate the provinces of the Abbasid Empire, but we can always switch the logic around. Even though it is more expensive, we can enumerate all provinces and then filter for those in the Abbasid Empire:
Code:
any_province = {
limit = {
realm = { title = e_arabia }
}
log = "> The [This.Religion.GetName] province of [This.GetName] ([This.GetID]) in the [This.Realm.GetFullName]"
}
This yields exactly zero lines of output, so I decided to enumerate all provinces and list their realm:
Code:
any_province = {
log = "> The [This.Religion.GetName] province of [This.GetName] ([This.GetID]) in the [This.Realm.GetFullName]"
realm = {
log = "It belongs to the realm of the [This.GetFullName] ([This.GetID])"
}
}
This yields a great many lines, which I will sample below:
[effectimplementation.cpp:18398]: EVENT [769.1.1]:> The Catholic province of Vestisland (1) in the Prince-Bishopric of Vestisland
[effectimplementation.cpp:18398]: EVENT [769.1.1]:It belongs to the realm of the ()
[effectimplementation.cpp:18398]: EVENT [769.1.1]:> The Catholic province of Austisland (2) in the Prince-Bishopric of Austisland
[effectimplementation.cpp:18398]: EVENT [769.1.1]:It belongs to the realm of the ()
[effectimplementation.cpp:18398]: EVENT [769.1.1]:> The Catholic province of Tír Chonaill (3) in the Chiefdom of Tír Chonaill
[effectimplementation.cpp:18398]: EVENT [769.1.1]:It belongs to the realm of the ()
(ommitted for brevity...)
[effectimplementation.cpp:18398]: EVENT [769.1.1]:> The Zoroastrian province of Dihistan (631) in the Abbasid Empire
[effectimplementation.cpp:18398]: EVENT [769.1.1]:It belongs to the realm of the ()
(ommitted for brevity...)
[effectimplementation.cpp:18398]: EVENT [769.1.1]:> The Catholic province of Almada (2013) in the Umayyad Sultanate
[effectimplementation.cpp:18398]: EVENT [769.1.1]:It belongs to the realm of the ()
[effectimplementation.cpp:18398]: EVENT [769.1.1]:> The Sunni province of Huelva (2014) in the Umayyad Sultanate
[effectimplementation.cpp:18398]: EVENT [769.1.1]:It belongs to the realm of the ()
So now we have something strange turn up: even though the localisation command This.Realm.GetFullName shows the correct realm, the actual scope realm is returning an odd object with a null name and a null ID! Now clearly, those belong to a realm, or the localisation command ought to return empty, as well, right? But, looking at the wiki, the realm is meant to be called from a character or title scope, so I insert an intermediary scope for county, like this:
Code:
any_province = {
log = "> The [This.Religion.GetName] province of [This.GetName] ([This.GetID]) in the [This.Realm.GetFullName]"
county = {
log = "It is the seat of the [This.GetFullName] ([This.GetID])"
realm = {
log = "It belongs to the realm of the [This.GetFullName] ([This.GetID])"
}
}
}
This yields:
[effectimplementation.cpp:18398]: EVENT [769.1.1]:> The Catholic province of Vestisland (1) in the Prince-Bishopric of Vestisland
[effectimplementation.cpp:18398]: EVENT [769.1.1]:It is the seat of the Prince-Bishopric of Vestisland (c_vestisland)
[effectimplementation.cpp:18398]: EVENT [769.1.1]:It belongs to the realm of the ()
[effectimplementation.cpp:18398]: EVENT [769.1.1]:> The Catholic province of Austisland (2) in the Prince-Bishopric of Austisland
[effectimplementation.cpp:18398]: EVENT [769.1.1]:It is the seat of the Prince-Bishopric of Austisland (c_austisland)
[effectimplementation.cpp:18398]: EVENT [769.1.1]:It belongs to the realm of the ()
(ommitted for brevity...)
[effectimplementation.cpp:18398]: EVENT [769.1.1]:> The Nestorian province of Basra (649) in the Abbasid Empire
[effectimplementation.cpp:18398]: EVENT [769.1.1]:It is the seat of the Sheikhdom of Basra (c_basra)
[effectimplementation.cpp:18398]: EVENT [769.1.1]:It belongs to the realm of the ()
(ommitted for brevity...)
[effectimplementation.cpp:18398]: EVENT [769.1.1]:> The Sunni province of Huelva (2014) in the Umayyad Sultanate
[effectimplementation.cpp:18398]: EVENT [769.1.1]:It is the seat of the Sheikhdom of Huelva (c_huelva)
[effectimplementation.cpp:18398]: EVENT [769.1.1]:It belongs to the realm of the ()
So even calling realm from county scope, we still get a bad value, which is what is causing (I think) the any_realm_province and the limit = { realm = { title = /*whatever*/ } } fail.
However, it is unthinkable that a scope which is supposedly used in several places in the base game could be broken like this; I can only imagine the number of events that would be broken along with it. So it is probably still something I'm doing that I shouldn't be. Can anyone see what is going on? I would appreciate a couple of pointers, if possible.
Cheers for the attention!