• 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.

Miraiteko

Sergeant
23 Badges
Mar 22, 2019
67
140
  • Hearts of Iron IV: Expansion Pass
  • Victoria 3 Sign Up
  • Stellaris: Nemesis
  • Stellaris: Necroids
  • Crusader Kings III
  • Stellaris: Federations
  • Stellaris: Lithoids
  • Stellaris: Ancient Relics
  • Stellaris: Megacorp
  • Stellaris: Distant Stars
  • Stellaris: Apocalypse
  • Stellaris: Humanoids Species Pack
  • Crusader Kings II
  • Stellaris: Synthetic Dawn
  • Hearts of Iron IV: Death or Dishonor
  • Stellaris - Path to Destruction bundle
  • Stellaris: Leviathans Story Pack
  • Stellaris: Digital Anniversary Edition
  • Hearts of Iron IV: Cadet
  • Stellaris: Galaxy Edition
  • Stellaris: Galaxy Edition
  • Stellaris
  • Europa Universalis IV
every_state = {
save_scope_as = checked_state
create_building = {
building="test_building"
add_ownership = {
building = {
type = "building_manor_house"
country = scope:checked_state.owner
levels = 2
region = scope:checked_state.state_region
}
country = {
country = scope:checked_state.owner
levels = 1
}
}
reserves=1
}

I want to create a new building in every state, and let them owrned by aristocrats.
However, errors occur:
[17:42:41][jomini_script_system.cpp:265]: Script system error!
Error: create_building effect [ Invalid state in for France for building ownership ]
Script location: file: common/history/global/00_breakout_breed_global.txt line: 10
 
Bump. I tried doing something similar to this, but "region" will reject state region scopes, annoyingly...

Looking at game\common\history\buildings, it looks like "region" uses the State Region names WITHOUT "s:", which seems odd given how every other trigger/effect that uses State Regions requires "s:".

While on the topic of "create_building", would it be possible to make "levels" work such that you can type "levels += 1" and it'll always add 1 building level? This would help out tremendously with modding.

Also, I would like if there were triggers/effects that could query for and alter building ownership.

EDIT: Correction, I meant "s:", not "c:"
 
Last edited:
  • 1
Reactions:
Bump. I tried doing something similar to this, but "region" will reject state region scopes, annoyingly...

Looking at game\common\history\buildings, it looks like "region" uses the State Region names WITHOUT "c:", which seems odd given how every other trigger/effect that uses State Regions requires "c:".

While on the topic of "create_building", would it be possible to make "levels" work such that you can type "levels += 1" and it'll always add 1 building level? This would help out tremendously with modding.

Also, I would like if there were triggers/effects that could query for and alter building ownership.
Not sure about the rest, but there is an effect add_building_level.

As for OP, maybe something like:
Code:
every_state = {
    save_scope_as = checked_state
    state_region = {
        save_scope_as = checked_sr
    }
    create_building = {
        building = "test_building"
        add_ownership = {
            building = {
                type = "building_manor_house"
                country = scope:checked_state.owner
                levels = 2
                region = scope:checked_sr
            }
            country = {
                country = scope:checked_state.owner
                levels = 1
            }
        }
        reserves = 1
    }
}

In case it's an issue with the scoping. One wonders if the quote marks used in the vanilla history file are not just affectation, though, but actually required by the effect. (which would put paid to using variables, but then...)
 
  • 1
Reactions:
Not sure about the rest, but there is an effect add_building_level.
No, this effect doesn't work, and it has never worked before.

As for OP, maybe something like:
Code:
every_state = {
save_scope_as = checked_state
state_region = {
save_scope_as = checked_sr
}
create_building = {
building = "test_building"
add_ownership = {
building = {
type = "building_manor_house"
country = scope:checked_state.owner
levels = 2
region = scope:checked_sr
}
country = {
country = scope:checked_state.owner
levels = 1
}
}
reserves = 1
}
}
In case it's an issue with the scoping. One wonders if the quote marks used in the vanilla history file are not just affectation, though, but actually required by the effect. (which would put paid to using variables, but then...)
This doesn't fix the issue. I've tested it out.

Like I mentioned in my previous note, if I put something like:

"STATE_GEORGIA"

for "region", then it'll work. But if I put:

"s:STATE_GEORGIA"

Then error.log will complain.
 
Last edited:
Ah, yeah so it's a bespoke effect. And too bad about the other effect not working. Maybe both of these are something for the suggestions forum, or a bug report. Bug reports on general modding capabilities are looked at.