Jump to content

ThoraldGM

Recommended Posts

Is it possible to use an array for a required ingredient in a crafting station? For example, my Breakfast of Champions is crafted in the cooking station with Sugar Bombs and beer. The beer MUST be a beer object with formID 0011EA93. It would be more robust if the player could use any of the beer or liquor variants. The old LPC way to do this was to create an array of acceptable items, then check that the player had an item on that list at the time of crafting.

 

I'm just using the breakfast as an example. There are many things that could be improved with arrays. A Nuka Cola grenade that could be crafted with any of the warm/cold/flavored empty bottle variants is another example. So far, the only way I see is to require the scrapped component (glass instead of bottle), but that adds a trip to the workshop and makes it more tedious on the player.

 

I suppose if the modder created an object with a custom crafting script, that would be possible. (Example: a tool belt that deletes ingredients and clones a grenade when activated.) But it would be nice if arrays could be done with things listed in the different stations.

Link to comment
Share on other sites

You could try creating a Levelled Item list with all the different beers in it, then see if the crafting recipe will accept that list as one of the ingredients? I haven't tried this btw, it's just hypothetical.

 

Edit. after some thought, what it would probably do is pick a random beer from the list and then require that you have that exact random beer, which is not quite what you are trying to do.

Edited by steve40
Link to comment
Share on other sites

  • 1 year later...

You could try creating a Levelled Item list with all the different beers in it, then see if the crafting recipe will accept that list as one of the ingredients? I haven't tried this btw, it's just hypothetical.

 

Edit. after some thought, what it would probably do is pick a random beer from the list and then require that you have that exact random beer, which is not quite what you are trying to do.

 

 

Thread necro. Still thinking about this ~2 years later. Would be nice if constructible objects ingredient list would accept an array somehow, maybe via formlist or custom function.

 

I tested the leveled list option and it does exactly what you predicted. I had bloatfly meat and beer, but recipe (leveled list RNG) chose radstag meat at cook time, so no chops.

 

Maybe some wizardry can be done under the crafting conditions? I noticed conditions will accept entries like GetItemCount > MyLeveledList > MyCondition.

 

1. Quick beer chops test in CK. Ingredients are list of all meats and list of all beers. The goal is Any Meat + Any Beer = Beer Chops.

 

 

DVEBqkjW4AApB_c.jpg

 

 

2. Failed beer chops test in game as described.

 

 

DVEBoNxXcAAK1Ad.jpg

 

 

Flexible ingredients are not a critical feature, but I rank it medium-high on the "would be nice to have" scale.

Link to comment
Share on other sites

I whipped up a script that works in the debugs and (most of the) screenshots, but I think the cooking station calculates inventory / ingredients before quest script receives OnMenuOpenCloseEvent. Kinda sucks because I really thought I was on to something.

 

 

What's the Point?

 

  • A test to see if recipes can be dynamically flexible. If a recipe calls for beer or Nuka-Cola, players can't use Ice Cold Gwinnett Stout or Nuka-Cherry. ... Or can they?! (inquisitively arched eyebrow)
  • If somebody can figure this out, we can make our recipes accept variants of ingredients. No more being picky about which beer, cola, meat, vegetable, etc if you don't want to be that demanding.

 

Methodology:

 

  • Registered for OnMenuOpenCloseEvent (OMOCE)
  • When OMOCE fires, script counts number of beers and raw meats in player's inventory
  • Script adds "generic" beers and raw meats (forms from my mod test) to match number of "real" beers and raw meats (checked via formlists of vanilla items)
  • Beer Chops recipe: 1 generic beer + 1 generic meat
  • Debug TraceAndBox shows the correct calculations of "real" and "generic" beers and raw meats
  • However, the recipe shows I have zero of each generic (see theory about event arriving after inventory was calculated by cooking station)
  • Debug TraceAndBox show that my "generics" were cleaned up correctly when cooking menu closed

 

Think of the generics as a temporary currency. Beer coin. Like BitCoin, but tastier. They only exist while the cooking menu is open. Then they disappear like my bank account balance.

 

If anyone wants to take a swing at this, the project (script, screenshots, esp, 7z, etc.) is open source at: https://github.com/ThoraldGM/BeerChops

 

I don't want to post it on Nexus yet until it works. It is very much a test in progress.

 

Screenshot (more in the project link):

 

BVS = BeerVariantsStart (how much beer was in inventory at start)

BGS = BeerGenericsStart (number of generics added)

MVS = MeatVariantsStart (how much raw meat was in inventory at start)

MGS = MeatGenericsStart (number of generics added)

 

 

DVGIsXJXkAAfEkw.jpg

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...