Jump to content

[EE] How-to: Editing your save game via the console


Recommended Posts

The CLUA console has always been a useful tool for debugging a game or handing out a little extra gold or XP. The Enhanced Editions added a command, Eval, which makes it possible to make a lot of changes to your game that were only possible previously via an editor like Near Infinity or EEKeeper.

Eval allows for the execution of normal scripting commands, opening up a range of possibilities, by wrapping a normal scripting action like so:

C:Eval('stuff')

A quick note: all of the examples below use Player1, which is the identifier for Gorion's Ward in the BG series, or the first character created in IWDEE. To target other party members, you can replace Player1 with Player1Fill for the NPC in the top portrait slot on the right, Player2Fill for the second, Player3Fill for the third, etc.

Changing stats

You can execute the ChangeStat command at the console. For example, you can set your PC's dexterity to 18 by using:

C:Eval('ChangeStat(Player1,DEX,18,SET)')

All stats listed in stats.ids can be adjusted this way. This includes basic stats, weapon proficiencies, thieving points, hit points, saves, and resistances.

Adding kits

Other things you can do via the console include adding a kit with

C:Eval('ActionOverride(Player1,AddKit(BERSERKER))')

So you can create a multiclass fighter/mage during character creation and then add a berserker kit at the console. You can also un-kit a character by using TRUECLASS. Note that this does not get around the limit of only one kit per character. If you have additional kits from mods, you can check your override folder for an updated kit.ids with the mod kits.

Changing race/class/gender/alignment/appearance

You can change other basic information with:

C:Eval('ChangeRace(Player1,TIEFLING)')
C:Eval('ChangeClass(Player1,FIGHTER)')
C:Eval('ChangeGender(Player1,FEMALE)')
C:Eval('ChangeAlignment(Player1,CHAOTIC_GOOD)')
C:Eval('ActionOverride(Player1,Polymorph(MAGE_FEMALE_ELF))')

Valid values for these are from race.ids, class.ids, gender.ids,. alignmen.ids, and animate.ids.

Adjusting reputation

You can adjust reputation with

C:Eval('ReputationSet(20)')

Adding or applying kit abilities or HLAs

Some kit abilities are applied to a character--like the HLA Use Any Item or a Swashbuckler's AC/to-hit/damage bonuses--and some are granted as a castable ability, like a blade's Offensive Spin or the HLA Greater Whirlwind. You can do both via the console.

Let's say you wanted to make your PC ridiculously, super-overpowered by adding the strongest HLA available, ranger tracking:

C:Eval('ActionOverride(Player1,AddSpecialAbility("spcl922"))')

If actually wanted to make your PC overpowered, you could apply the Use Any Item HLA with

C:Eval('ApplySpellRES("spcl915"),Player1')

You'll need the actual file names for the various kit abilities or HLAs. Conveniently, these pages prefix all of these abilities to indicate if they're gained (GA_) or applied (AP_).

Casting spells

You can also use ForceSpell to cast spells for non-spellcasters. For example, if you want to cast Freedom in the Underdark to start Vithal's quest, you can use either of these options:

C:Eval('ActionOverride(Player1,ForceSpell(Player1,WIZARD_FREEDOM))')
C:Eval('ActionOverride(Player1,ForceSpellRES("SPWI917",Player1))')

ForceSpell requires a name from spell.ids. ForceSpellRES lets you cast a spell by its filename, which allows for a broader selection of spells--assuming you can figure out their file names. In this case the first Player1 is who you want to cast the spell, and the second Player1 is who's being targeted by the spell.

Other changes?

If you have questions about changing something not covered here, just ask below and I'll check if it's possible.

Edited by CamDawg
Link to comment

So, let's say for example that I have installed a new kit added by one of the many kitpacks out there.  I play through BG1 with the new kit, and then upon importing my character to BG2, I discover that my character has the wrong kit.  As I understand it, this usually happens because BG2 will not always assign new kits the same id number as BG1.  Would the proper procedure in that case be to look at your BG2 override folder to find the proper kit.ids for the mod-added kit you want and use AddKit to assign the proper kit to your imported character?

Link to comment

The Eval() console command is even more powerful than this.

Instead of using a specific target, such as "Player1", you can replace it by "Myself" and execute the command while the mouse cursor is placed over the target character or creature.

The same is true for actions that are applied to the active creature instead of a specific target, such as AddSpecialAbility():

C:Eval('ActionOverride(Player1,AddSpecialAbility("spcl922"))')

can be shortened to

C:Eval('AddSpecialAbility("spcl922")')

while the mouse cursor is placed over the target (selection circle or character portrait).

Alternatively, C:Eval() does also accept a second argument that indicates the portrait slot index of a party member who should be selected as target, starting with 0 for the current party leader. For example:

C:Eval('AddXPObject(Myself,1000)',0)

adds 1000 experience to the character in the first party slot. This option doesn't require the mouse cursor placed over the target.

Link to comment
1 hour ago, Delior said:

.. to find the proper kit.ids for the mod-added kit you want and use AddKit to assign the proper kit to your imported character?

Yes, the AddKit script action works for this. Any abilities for your current kit will be removed and the abilities of the kit you add will be applied. For the argument, you can either use the ID number or the internal kit name; e.g, an Archer would be 0x4007, 16391, or FERALAN. The kit name is usually the most convenient here; just watch out for the cases in which it doesn't match the common name for the kit.

As of the current patch of the EE, the kit lists have been padded with dummy kits so that if you install the same kits in the same order on both BGEE and BG2EE, they'll have the same ID number and a character with a mod kit will import properly.

Link to comment
46 minutes ago, jmerry said:

As of the current patch of the EE, the kit lists have been padded with dummy kits so that if you install the same kits in the same order on both BGEE and BG2EE, they'll have the same ID number and a character with a mod kit will import properly.

The problem arises when you install a BG2-only mod that comes with new kit (as many of Lava's mods do just as one example), which makes it difficult to get the kits added in the same order.  

Link to comment

Join the conversation

You are posting as a guest. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...