define ingredients

Ask for help about creating mods and scripts for Grimrock 2 or share your tips, scripts, tools and assets with other modders here. Warning: forum contains spoilers!
Post Reply
User avatar
LordGarth
Posts: 500
Joined: Mon Jun 18, 2012 5:07 pm
Location: Colorado USA

define ingredients

Post by LordGarth »

Is there a way to define ingredients.

Is there an exact code example.

Gary
Dungeon Master and DOOM will live forever.
User avatar
Isaac
Posts: 3192
Joined: Fri Mar 02, 2012 10:02 pm

Re: define ingredients

Post by Isaac »

If you mean define original [new] ingredients, I've never had occasion to try ~yet; and will have to look into it.
*The UI only allows for six though, so I suspect one cannot define new ones; [probably hard-coded names].

**Update: One can define new herbs as items, but they don't automatically show up in the alchemy UI. So I think
that any functional herb expansion would likely require a full custom GUI script and a mortar replacement item.
(...or in the very least, intermediary items [created from default herbs] that check inventory for additional
ingredients when equipped; for a two part creation process.)


If you mean recipe creation with existing ingredients, then here is the way:
https://github.com/JKos/log2doc/wiki/As ... recipedesc
defineRecipe(desc)

Defines a new potion recipe or replases an existing recipe. desc is a table with the following fields:

name:the name of the potion recipe to define or replace.
level:Alchemy skill level needed to craft the potion.
ingredients:a number describing the ingredients.
Ingredients are encoded into numeric value. Each digit in the number corresponds to an herb.

The available herbs are:
1 = Blooddrop Cap,
2 = Etherweed,
3 = Mudwort,
4 = Falconskyre,
5 = Blackmoss,
6 = Crystal Flower.

For example, 115 would translate to a recipe with two Blooddrop Caps and one Blackmoss.

Code: Select all

defineRecipe{
	potion = "potion_speed",
	level = 3,
	ingredients = 244,
}
User avatar
LordGarth
Posts: 500
Joined: Mon Jun 18, 2012 5:07 pm
Location: Colorado USA

Re: define ingredients

Post by LordGarth »

Thankyou for the good into.

LordGarth
Dungeon Master and DOOM will live forever.
Post Reply