Skip to content

[MOD] Mod that set starting XP in BG2EE for imported characters to BGEE or SoD xp caps

4ltair4ltair Member Posts: 24
edited August 2019 in BGII:EE Mods
As the title says, is there any mod that sets the starting XP in BG2EE to 161k for BG1EE imported character and to 500k for a SoD imported character?

If not, what would be the easiest way to mod it ?
My idea would be to add some script which sets the starting XP to AR0602.bcs and checks if the character is imported from BG1EE or SoD but my modding skills are just beginner level, so how would the code look like?

Short rambling why i am looking for such a mod:
As all of you might know, you still gain XP after you hit the level cap in BG1EE and that XP is transferred to BG2EE in full. This is not a big problem with a party, because then the difference would be only a level or two higher than the BG1EE level cap but when you play solo, this changes drastically (as an example, a solo completionist FMT would gain around 1.3m XP in BG1EE, which would put him to level 9/11/11 or 9/11/12 at the start of BG2EE) which will trivialize the game pretty much from the start.

LE: So, i managed to put together some code which does exactly what i want (see below), managed to make a WeiDU mod which puts this code in AR0602.bcs but the code does not run :( (checked by importing a character with 162000 xp, starting a new game and then checking the xp after Imoen joins the party); if i put this code in baldur.bcs, it will run just fine.

Anyone knows why it runs in one script but not in the other?
IF
	Global("SET_BG1EE_XP_CAP","ar0602",0)
	Global("BD_HAVE_SOD","GLOBAL",0)
	XPGT(player1,161000)
THEN
	RESPONSE #100
		SetGlobal("SET_BG1EE_XP_CAP","ar0602",1)
		ChangeStat(player1,XP,161000,SET)
END

IF
	Global("SET_SOD_XP_CAP","ar0602",0)
	Global("BD_HAVE_SOD","GLOBAL",1)
	XPGT(player1,500000)
THEN
	RESPONSE #100
		SetGlobal("SET_SOD_XP_CAP","ar0602",1)
		ChangeStat(player1,XP,500000,SET)
END

LE2: Solved the problem by adding Continue() in each block and putting it at the top of ar0602.bcs.
I have added the mod in case there are other players which were looking for something similar

Post edited by 4ltair on

Comments

  • TressetTresset Member, Moderator Posts: 8,264
    @4ltair Your discussion was caught by the forum's automated spam filter. I have restored it and verified you so this should not happen again.
  • 4ltair4ltair Member Posts: 24
    edited August 2019
    @Tresset: thanks a lot, i think i have edited my post one time too many and the filter caught it

    To add more detail, in AR0602.bcs, the code is inserted at the bottom (EXTEND_BOTTOM) and in bladur.bcs i have inserted it at the top (EXTEND_TOP)

    A bit off-topic: how often is the code parsed by the engine (i understand that the game parses the script in certain order (override - ... - default) and then restarts this cycle but i did not found anywhere at what time interval this happens)?
  • ilduderinoilduderino Member Posts: 773
    I would use EE Keeper to do this - you can manually increase XP to whatever you like
  • UlbUlb Member Posts: 295

    4ltair wrote: »
    To add more detail, in AR0602.bcs, the code is inserted at the bottom (EXTEND_BOTTOM) and in bladur.bcs i have inserted it at the top (EXTEND_TOP)

    Well, there might be your problem. AR0602.bcs is a really crowded place, most likely some other mod added something at the top which then blocks the script from ever getting to your part.
    (This might have caused other script blocks to not go off as planned as well, with as of yet unnoticed side effects..)
    That's why you should add continue() to all your script blocks. Without continue() the engine will restart the script from the beginning as soon as any contition returns as true. Meaning it is pretty easy to cause a loop.
  • 4ltair4ltair Member Posts: 24
    @Ulb AR0602.bcs is the script for Irenicus Dungeon and as far as I could see in the script, there was nothing added by any mod. I have added my code at the beginning of the script file (and added Continue() as not to interfere with other parts of the script) and it works now.

    So now, my question is more like why doesn't work when it is at the end of the script but works when it is at the beginning? As far as i understood, when the engine parses a script, it goes block by block as follows: if the conditions are met, the block is executed and the script is restarted from the beginning and if the conditions are not met, it goes to the next block until it reached the end of the script.
  • UlbUlb Member Posts: 295
    edited August 2019
    @4ltair
    If your script block works at the top but not at the bottom, then one of the other blocks in the script does loop/block the script.
    (*edit* The only other explanation would be that one of the other blocks changes a global or other condition your block requires to be true, but I think that's unlikely..)
    As far as i understood, when the engine parses a script, it goes block by block as follows: if the conditions are met, the block is executed and the script is restarted from the beginning and if the conditions are not met, it goes to the next block until it reached the end of the script.

    Yes, that's right. It means that one of the script blocks returns true without its resolution causing it to no longer return true on the next iteration. E.g.:
    IF
    	Global("faultyscript","ar0602",0)
    THEN
    	RESPONSE #100
    		ChangeStat(player1,XP,161000,SET)
    END
    

    A pretty crude example, but as you can see, this script block would always be true and as a result the game would never execute any script block that is below since it restarts the script after resolving this block, over and over.
  • 4ltair4ltair Member Posts: 24
    @Ulb indeed but i look over the entire script and i could not identify a script block which would behave like that (i have pasted below the whole AR0602 script so that someone with more experience than me can have a look)
    IF
    	OnCreation()
    	Global("NewGame","AR0602",0)
    THEN
    	RESPONSE #100
    		StartCutSceneMode()
    		HideGUI()
    		FadeToColor([1.0],0)
    		SetGlobal("NewGame","AR0602",1)
    		Continue()
    END
    
    IF
    	Global("BG1Pantaloons","GLOBAL",0)
    	PartyHasItem("MISC47")  // Golden Pantaloons
    THEN
    	RESPONSE #100
    		SetGlobal("BG1Pantaloons","GLOBAL",1)
    		ActionOverride("Picture1",CreateItem("MISC47",0,0,0))  // Golden Pantaloons
    		Continue()
    END
    
    IF
    	Global("BG1DrizztItem","GLOBAL",0)
    	OR(3)
    		PartyHasItem("CHAN06")  // Mithral Chain Mail +4
    		PartyHasItem("SW1H15")  // Icingdeath +3
    		PartyHasItem("SW1H16")  // Twinkle +3
    THEN
    	RESPONSE #100
    		SetGlobal("BG1DrizztItem","GLOBAL",1)
    		Continue()
    END
    
    IF
    	Global("TakeImportItems","AR0602",0)
    THEN
    	RESPONSE #100
    		SetGlobal("TakeImportItems","AR0602",1)
    		StartCutSceneEx("BDSODIMP",TRUE)
    		SetGlobal("Chapter","GLOBAL",1)
    		ActionOverride("Malaaq",MoveBetweenAreas("AR0601",[345.591],SE))
    		ActionOverride("Table3",TakeItemListPartyNum("IMPORT02",1))
    		ActionOverride("DuegarClanChief",TakeItemListPartyNum("IMPORT01",1))
    		ActionOverride("Shelf1",TakeItemListPartyNum("IMPORT03",1))
    		SmallWait(4)
    		TakePartyGold(2147483647)
    		ActionOverride(Player1,DestroyAllEquipment())
    		ActionOverride(Player2,DestroyAllEquipment())
    		ActionOverride(Player3,DestroyAllEquipment())
    		ActionOverride(Player4,DestroyAllEquipment())
    		ActionOverride(Player5,DestroyAllEquipment())
    		ActionOverride(Player6,DestroyAllEquipment())
    		CreateCreature("CSJON",[3210.3304],NE)  // Mage
    		ActionOverride(Player1,PlayDead(165))
    		Wait(1)
    		FadeFromColor([30.0],0)
    		StartCutScene("NewGame")
    END
    
    IF
    	Global("RielevDisable","AR0602",0)
    THEN
    	RESPONSE #100
    		SetGlobal("RielevDisable","AR0602",1)
    		TriggerActivation("Rielevdeadtrigger",FALSE)
    END
    
    IF
    	Global("IrenTeleport","GLOBAL",2)
    THEN
    	RESPONSE #100
    		SetGlobal("IrenTeleport","GLOBAL",1)
    		SmallWait(8)
    		PlaySound("EFF_M29")
    		FadeFromColor([30.0],0)
    		CreateVisualEffect("SPCLOUD1",[3075.644])
    		CreateVisualEffect("SPCLOUD1",[3029.652])
    		CreateVisualEffect("SPCLOUD1",[2975.670])
    		CreateVisualEffect("SPCLOUD1",[3114.665])
    		CreateVisualEffect("SPCLOUD1",[3068.681])
    		CreateVisualEffect("SPCLOUD1",[3004.704])
    END
    
    IF
    	Global("bd_imoen_joined","ar0602",1)
    	Global("MoveScreen","AR0602",0)
    THEN
    	RESPONSE #100
    		SetGlobal("MoveScreen","AR0602",1)
    		SetGlobal("BD_Chapter_Save","GLOBAL",1)
    		SaveGame(15)
    		SaveGame(0)
    		MoveViewPoint([3802.2769],BD_NORMAL)
    END
    
    IF
    	Global("AataqahFight","AR0602",1)
    	Dead("AataqahOgre")  // Ogre Mage
    THEN
    	RESPONSE #100
    		SetGlobal("AataqahFight","AR0602",2)
    		Wait(1)
    		CreateCreatureObjectEffect("AATAQAH","SPCLOUD3",Player1)  // Aataqah
    		ActionOverride("Aataqah",Wait(2))
    END
    
    IF
    	Global("AataqahFight","AR0602",1)
    	NumDead("AataqahGibber",4)  // Gibberling
    THEN
    	RESPONSE #100
    		SetGlobal("AataqahFight","AR0602",2)
    		Wait(1)
    		CreateCreatureObjectEffect("AATAQAH","SPCLOUD3",Player1)  // Aataqah
    		ActionOverride("Aataqah",Wait(2))
    END
    
    IF
    	Global("AataqahFight","AR0602",1)
    	HPPercentLT(MostDamagedOf(Myself),25)
    THEN
    	RESPONSE #100
    		SetGlobal("AataqahFight","AR0602",2)
    		Wait(1)
    		CreateCreatureObjectEffect("AATAQAH","SPCLOUD3",Player1)  // Aataqah
    		ActionOverride("Aataqah",Wait(2))
    END
    
    IF
    	Global("Ellsime","AR0602",1)
    	OpenState("DOOR08",FALSE)
    THEN
    	RESPONSE #100
    		OpenDoor("DOOR08")
    END
    
    IF
    	PartyHasItem("misc4d")  // The Genie's Flask
    	!Global("AddEntry47514","ar0602",5)
    THEN
    	RESPONSE #100
    		AddJournalEntry(47514,QUEST)  // Freeing the djinni I have retrieved the flask from the dryads... all that remains now is to go back to the genie and return it to him.
    		SetGlobal("AddEntry47514","ar0602",5)
    END
    
    IF
    	Global("BD_DEFAI","GLOBAL",0)
    THEN
    	RESPONSE #100
    		SetGlobal("BD_DEFAI","GLOBAL",1)
    		SetGlobal("BDAI_RESET_TIMERS","GLOBAL",1)
    		ActionOverride(Player1,ChangeAIScript("BDDEFAI",CLASS))
    		Continue()
    END
    
  • UlbUlb Member Posts: 295
    edited August 2019
    Can't see anything at a quick glance either, but.. have you tried waiting a few seconds to see if your script becomes true when at the bottom?
    There are quite a few wait() commands in there and I'm not sure how the engine handles those. If the engine indeed waits the allocated time for every block before the next iteration (which I think it should/needs to in order for some scripts to work properly), it might simply take a few seconds before your block gets executed.
  • UlbUlb Member Posts: 295
    If waiting doesn't help, you could find the culprit by simply adding continue() to all the blocks that don't have it and see at what point your script block is no longer blocked..
  • 4ltair4ltair Member Posts: 24
    @Ulb thanks for the hints, will try them (if only for my peace of mind :), because the mod is working)
  • jmerryjmerry Member Posts: 3,829
    4ltair wrote: »
    As all of you might know, you still gain XP after you hit the level cap in BG1EE...
    This is not exactly true. What actually happens, as far as I can tell, is that characters with more XP than the level cap are regularly reset down to the level cap before gaining new experience. An imported character will typically have experience from the final boss fight and not much else past the cap.
    For some hard numbers: In my current run, the protagonist imported from BG1 to BG2 at 166,970 XP. The six-member party, which had stayed together most of the game, had experience from kills totaling 1,229,896 XP. If experience kept accumulating, they would be at around 200K each or more, with the protagonist and Imoen somewhat ahead due to midgame decisions to speed up her dual-classing. This didn't happen, and the rest of the party caught up to my protagonist in XP when they reached the BG1 cap.
  • 4ltair4ltair Member Posts: 24
    @jmerry i have just tested what you said with one solo FMT and indeed, all the xp from the final fight will transfer (minimum 15000 for Sarevok, maximum can be around 50000 if you kill the Battle Horrors and all his companions before killing him) so i guess the only use of my mod is for those who want to start BG2EE exactly from the BG1EE xp cap.
Sign In or Register to comment.