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

xtraeme

Recruit
89 Badges
Jun 19, 2018
8
0
  • Hearts of Iron III
  • Imperator: Rome
  • Stellaris: Federations
  • Crusader Kings III: Royal Edition
  • Imperator: Rome - Magna Graecia
  • Crusader Kings III
  • Semper Fi
  • Hearts of Iron III: Their Finest Hour
  • For the Motherland
  • Europa Universalis IV
  • Hearts of Iron IV: La Resistance
  • Europa Universalis 4: Emperor
  • Stellaris: Necroids
  • Stellaris: Nemesis
  • Battle for Bosporus
  • Surviving Mars
  • Surviving Mars: First Colony Edition
  • Surviving Mars: First Colony Edition
  • Surviving Mars: Digital Deluxe Edition
  • Majesty 2
  • Pillars of Eternity
  • Age of Wonders: Shadow Magic
  • Age of Wonders
  • Age of Wonders II
  • Age of Wonders III
  • Shadowrun Returns
  • Shadowrun: Dragonfall
  • Shadowrun: Hong Kong
  • Crusader Kings II
  • Crusader Kings II: Monks and Mystics
  • Crusader Kings II: Sons of Abraham
  • Crusader Kings II: Sword of Islam
  • Crusader Kings II: Jade Dragon
  • Crusader Kings II: Holy Fury
  • Crusader Kings II: The Old Gods
  • Crusader Kings II: Charlemagne
  • Crusader Kings II: Way of Life
  • Crusader Kings II: Horse Lords
  • Crusader Kings II: Reapers Due
  • Crusader Kings II: Rajas of India
  • Crusader Kings II: Sunset Invasion
  • Crusader Kings II: The Republic
  • Crusader Kings II: Legacy of Rome
  • Crusader Kings II: Conclave
  • Stellaris
  • Stellaris - Path to Destruction bundle
  • Stellaris: Apocalypse
  • Stellaris: Distant Stars
  • Stellaris: Synthetic Dawn
  • Stellaris: Humanoids Species Pack
The quick script below emulates play [id] available in the console by toggling between different players using the "decisions" functionality. The only problem is there is a strange bug where pausing the game and switching back and forth between two different playable characters causes the score for each of the characters to increase summing the previous value with itself (i.e. char1.score = 100, switch to char2, char1.score += 100). The set_player_character effect also causes the character_history={ ... } to needlessly bloat in the save file.

Is there any way to manually hold the previous score with a variable and use the FROM to set the score back to what it was before the set_player_character and also stop the additions to the character_history section?

Thanks for the help!

Code:
targetted_decisions = {
    custom_play_as_target = {
        filter = all
        ai = no
        potential = {
            ai = yes
            is_playable = yes
            is_landed = yes
            is_theocracy = no
        }
        allow = { always = yes }
        effect = { set_player_character = ROOT }
        ai_chance = { factor = 0 }  

    }
}