钢铁雄心4吧 关注:439,788贴子:7,999,201
  • 42回复贴,共1

这种情况求解

只看楼主收藏回复

我写了这么个事件,就是联邦内的立陶宛会独立,向联邦开战
本来应该任何一方投降倾向超过50%后就判定对面胜利,可是实际运行时发现,联邦这边是正常的,如图:

可是立陶宛的投降倾向永远是0(已经加好核心了),只有保存再重新载入之后,立陶宛的投降倾向才会变得正常(下图是保存再载入后,立陶宛投降倾向正常并且出事件):

2L放上事件相关代码


IP属地:美国1楼2019-03-17 23:26回复
    代码如下:
    country_event = {
    id = commonwealth.3
    title = commonwealth.3.t
    desc = commonwealth.3.d
    trigger = {
    tag = PLC
    has_country_flag = PLC_king_A
    not = { has_country_flag = PLC_LIT_ind }
    NOT = { has_completed_focus = PLC_ElectionA }
    focus_progress = {
    focus = PLC_ElectionA
    progress > 0.01
    }
    not = { LIT = { exists = yes } }
    }
    mean_time_to_happen = { days = 7 }
    immediate = {
    hidden_effect = {
    set_country_flag = PLC_LIT_ind
    }
    }
    option = {
    name = commonwealth.3.a
    ai_chance = { factor = 10 }
    784 = { add_core_of = LIT }
    97 = { add_core_of = LIT }
    94 = { add_core_of = LIT }
    95 = { add_core_of = LIT }
    96 = { add_core_of = LIT }
    194 = { add_core_of = LIT }
    204 = { add_core_of = LIT }
    206 = { add_core_of = LIT }
    241 = { add_core_of = LIT }
    207 = { add_core_of = LIT }
    188 = { add_core_of = LIT }
    189 = { add_core_of = LIT }
    11 = { add_core_of = LIT }
    PLC = {
    remove_state_core = 784
    remove_state_core = 97
    remove_state_core = 94
    remove_state_core = 95
    remove_state_core = 96
    remove_state_core = 194
    remove_state_core = 204
    remove_state_core = 206
    remove_state_core = 241
    remove_state_core = 207
    remove_state_core = 188
    remove_state_core = 189
    remove_state_core = 11
    }
    LIT = {
    transfer_state = 784
    load_oob = "LIT_1936"
    transfer_state = 97
    transfer_state = 94
    transfer_state = 95
    transfer_state = 96
    transfer_state = 194
    transfer_state = 204
    transfer_state = 206
    transfer_state = 241
    transfer_state = 207
    transfer_state = 188
    transfer_state = 189
    transfer_state = 11
    }
    PLC = {
    declare_war_on = {
    target = LIT
    type = annex_everything
    }
    }
    }
    }
    country_event = {
    id = commonwealth.4
    title = commonwealth.4.t
    desc = commonwealth.4.d
    trigger = {
    tag = PLC
    has_country_flag = PLC_LIT_ind
    PLC = { surrender_progress > 0.5 }
    }
    immediate = {
    hidden_effect = {
    clr_country_flag = PLC_LIT_ind
    }
    }
    option = {
    name = commonwealth.4.a
    ai_chance = { factor = 10 }
    white_peace = {
    tag = LIT
    message = Sl
    }
    set_cosmetic_tag = PLC_LIT_indep
    }
    }
    country_event = {
    id = commonwealth.5
    title = commonwealth.5.t
    desc = commonwealth.5.d
    trigger = {
    tag = PLC
    has_country_flag = PLC_LIT_ind
    LIT = { surrender_progress > 0.5 }
    }
    immediate = {
    hidden_effect = {
    clr_country_flag = PLC_LIT_ind
    }
    }
    option = {
    name = commonwealth.5.a
    ai_chance = { factor = 10 }
    LIT = {
    remove_state_core = 784
    remove_state_core = 97
    remove_state_core = 94
    remove_state_core = 95
    remove_state_core = 96
    remove_state_core = 194
    remove_state_core = 204
    remove_state_core = 206
    remove_state_core = 241
    remove_state_core = 207
    remove_state_core = 188
    remove_state_core = 189
    remove_state_core = 11
    }
    PLC = {
    annex_country = {
    target = LIT
    transfer_troops = no
    }
    add_state_core = 784
    add_state_core = 97
    add_state_core = 94
    add_state_core = 95
    add_state_core = 96
    add_state_core = 194
    add_state_core = 204
    add_state_core = 206
    add_state_core = 241
    add_state_core = 207
    add_state_core = 188
    add_state_core = 189
    add_state_core = 11
    }
    }
    }


    IP属地:美国2楼2019-03-17 23:27
    回复
      又用同样的代码写了乌克兰叛乱,结果依旧是乌克兰投降倾向一直是0,SL后恢复正常


      IP属地:美国3楼2019-03-17 23:28
      回复
        啊呀呀召唤改派dalao


        IP属地:美国来自Android客户端4楼2019-03-17 23:36
        收起回复
          事寫事件的julao


          IP属地:福建来自Android客户端5楼2019-03-17 23:48
          收起回复
            所以代码呢


            来自iPhone客户端7楼2019-03-18 00:05
            收起回复
              据说2L抽了,补上


              IP属地:美国来自Android客户端8楼2019-03-18 00:08
              回复




                IP属地:美国来自Android客户端9楼2019-03-18 00:12
                收起回复