Larian Banner: Baldur's Gate Patch 9
Previous Thread
Next Thread
Print Thread
Joined: Sep 2017
X
Xaelyn Offline OP
journeyman
OP Offline
journeyman
X
Joined: Sep 2017
I want to create a mod to unlock all the crafting recipes in the game, or at least the non-quest ones.

Is there a way to have a new script run on certain events (game start and level up are what I'm thinking, or on loading the game if that's possible) without editing an existing script or object (to preserve compatibility)?

Is there a code database/array of all recipes and a way I can run through it and run CharacterUnlockRecipe for each entry (easiest and preserves compatibility with updates and mods), or would I need to write a separate line for each recipe manually?

Any help is appreciated.

Joined: Jan 2010
Location: USA
F
enthusiast
Offline
enthusiast
F
Joined: Jan 2010
Location: USA
No worries. I'm about to release my recipe unlocker mod.

edit: Recipe Unlocker

Joined: Sep 2017
X
Xaelyn Offline OP
journeyman
OP Offline
journeyman
X
Joined: Sep 2017
Awesome, that's exactly what I wanted to do, though I was going to unlock the recipes directly in the script and not worry about the journal recipes section.

Does that goal script run on it's own, you don't need to insert a call to run in it somewhere else?

Joined: Jan 2010
Location: USA
F
enthusiast
Offline
enthusiast
F
Joined: Jan 2010
Location: USA
Originally Posted by Xaelyn
Awesome, that's exactly what I wanted to do, though I was going to unlock the recipes directly in the script and not worry about the journal recipes section.

Does that goal script run on it's own, you don't need to insert a call to run in it somewhere else?

Correct. Subgoals run automatically.

For future reference, if nothing's happening, it's probably because you're calling the wrong function. :facepalm:

Here's the source, so you don't have to extract the PAK:

//REGION Unlock all recipes when the player starts the tutorial
IF
GameStarted("TUT_Tutorial_A", _)
AND
DB_IsPlayer(_Player)
THEN
PROC_UnlockAllRecipes();
//END_REGION

//REGION Unlock all recipes when the player loads a save
IF
SavegameLoaded(_,_,_,_)
AND
DB_IsPlayer(_Player)
THEN
PROC_UnlockAllRecipes();
//END_REGION

PROC
PROC_UnlockAllRecipes()
THEN
UnlockJournalRecipe("AllRecipes_Shared_Origin");


LSLib Contributor | My Mods: DOS2, DOS2DE | 560K Steam Workshop Subscribers
Joined: Sep 2017
X
Xaelyn Offline OP
journeyman
OP Offline
journeyman
X
Joined: Sep 2017
I already did but thanks smile

Joined: Sep 2017
X
Xaelyn Offline OP
journeyman
OP Offline
journeyman
X
Joined: Sep 2017
Good to know that subgoals will run automatically. Means a few parts of my mods can be rewritten as scripts for maximum compatibility.

Joined: Mar 2016
Location: Belgium
T
addict
Offline
addict
T
Joined: Mar 2016
Location: Belgium


Link Copied to Clipboard
Powered by UBB.threads™ PHP Forum Software 7.7.5