Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: Training academy mod help  (Read 1225 times)

BNDR

  • Bay Watcher
    • View Profile
Training academy mod help
« on: January 11, 2016, 07:06:52 am »

Hi guys/fellow Urists

In an attempt to make a little less cheating, actually realistic training academy, I came up with reactions to train, which use:
Coins (to pay the 'imaginary' trainer inside the shop)
Drink (to keep dwarves happy)
Charcoal 1-2 bars for heating (Dwarves need a comfy training den)
Another Charcoal as a FILLER item.

Now, I'm still balancing it, but the problem is, while I can assign DRINK to be used, when trying to use FOOD, the game uses RANDOMITEM instead, sometimes the dwarves pull the precious steel bars to the shop and destroy them, sometimes more charcoal, whatever item is the closest gets filled in.

Thats why I resorted to using another charcoal as 'filler' but it feels very, very weird this way. I WANT to use FOOD, but it wont work!

Now, since DRINK and FOOD are both viable options, why is it not taking food, but lists DRINK, DRINK-containing item, COINS, CHARCOAL BARS, and (when I try to add FOOD) - ITEM. ITEM is obviously the FOOD item (when I add it to the reaction), but it doesnt recognize and accept it, hence the game simply listing "ITEM".

Here's what works for drink:
   [REAGENT:drink:300:DRINK:NONE:NONE:NONE]
   [REAGENT:barrel/pot:1:NONE:NONE:NONE:NONE][CONTAINS:drink][PRESERVE_REAGENT]

They haul a pot/barrel of drink, and the drink gets used up correctly.

Now adding
   [REAGENT:food:300:FOOD:NONE:NONE:NONE]
   [REAGENT:barrel/pot:1:NONE:NONE:NONE:NONE][CONTAINS:food][PRESERVE_REAGENT]

or simply
   [REAGENT:food:300:FOOD:NONE:NONE:NONE]

or any variation like
   [REAGENT:food:2:FOOD:NONE:NONE:NONE]
or
   [REAGENT:food:1:FOOD:NONE:NONE:NONE]

Isnt accepted. The game still calls for 'ITEM'. Hence why I use CHARCOAL, I just cant get the FOOD item to be used up for training. Now FOOD definetly is a viable option, isn't it, at least RAWEXPLORER lists FOOD and DRINK under the same tab, the DF exe as well has FOOD and DRINK in it under the same paragraph so to say.

I also tried: ITEM_FOOD and FOOD + specificly ITEM_FOOD_ROAST and just FOOD_ROAST.

NOTHING  >:(

Anybody know if this is even possible? Bug maybe? Or am I missing that tiny little detail that I didnt think of?

Atm it feels still like cheating having a reaction that doesnt use the items I want to.

Btw. the training effectiveness can hardly be called "cheating", as it gives a lousy 30 EXP per training session.

Full code:
   [REAGENT:drink:300:DRINK:NONE:NONE:NONE]
   [REAGENT:barrel/pot:1:NONE:NONE:NONE:NONE][CONTAINS:drink][PRESERVE_REAGENT]
   [REAGENT:A:600:BAR:NO_SUBTYPE:COAL:CHARCOAL]
   [REAGENT:money:100:COIN:NONE:NONE:NONE]
   [PRODUCT:100:1:BAR:NO_SUBTYPE:COAL:CHARCOAL]

The PRODUCT is necessary, because otherwise, the dwarves will not get any EXP, as even though they use all these items, they still DO nothing, and get no EXP, for doing nothing. Thats why you need to return at least 1 item as a PRODUCT. I'm simply using CHARCOAL, as it still uses and destroys 3 of the 4 bars (400) used.
« Last Edit: January 11, 2016, 07:08:47 am by BNDR »
Logged

BNDR

  • Bay Watcher
    • View Profile
Re: Training academy mod help
« Reply #1 on: January 11, 2016, 08:32:42 am »

Nevermind this comment here
« Last Edit: January 11, 2016, 09:03:50 am by BNDR »
Logged

Cheesoburgor

  • Bay Watcher
  • [NO_SLEEP]
    • View Profile
Re: Training academy mod help
« Reply #2 on: January 11, 2016, 02:21:59 pm »

For the food i'd recommend looking around the standard workshop reactions to see if there are any relating to food.
As for the EXP part, you can make the produced product be 100 bars of custom material that instantly evaporates in any temperature so the finished product will literally dissapear into thin air but you will still keep the exp.

I havent actually ever tried modding workshops so these answers may be invalid, hopefully someone who knows this stuff better will reply with a more helpful comment on your mod.
Logged
Im alive again after a 4 year break!

BNDR

  • Bay Watcher
    • View Profile
Re: Training academy mod help
« Reply #3 on: January 11, 2016, 03:31:20 pm »

Thx for the reply;

yeah there is nothing anywhere referring to FODD as a reaction reagent, mostly because you are obviously not supposed to do something else but eat it.

I thought I had it for a moment, but figured it was still using "any item", only items stored in barrel.

Since there is no flag at all determining specifically cooked food (or I havent found it in my 2 months of working on this mod), like "LIQUID_MISC", it seems to be hard as hell, and not the !FUN! way of hell, to do this.

I wish there was something like "HAS_MATERIAL_REACTION_PRODUCT" to make the script detect if the item is cooked, that would filter everything out thats not cooked; like "ITEM_STATE:COOKED", that would be nice.

Also everything being not only hardcoded but also obfuscated makes finding out how standard reactions even work, impossible. I'm used to decyphering games that aren't supposed to be modded at all, or haven't been modded yet, but there is a point where its "effort vs gain".

I'm settling with using a lot of DRINK for each training session as well as plenty of coins and charcoal, just to use up logs.

You know, I'm trying to artificially limit the amount of possible training, and come think of it, there is usually 2000 food in my fortress, and that very very early in the game. But never enough logs, depending on the embark...

Bah, I think I'll leave it at that and just balance it out.

Thx for the help anyways :)

BUT OF COURSE if someone with **legendary** skill in modding comes by saying "hah thats so easy, use this!", I'd still appreciate :)
Logged

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: Training academy mod help
« Reply #4 on: January 11, 2016, 09:28:04 pm »

FOOD refers specifically to cooked food.

If it's using random items, the item itself may be borked and you're SOL. I'm not sure that's exactly what's happening, though. You using FOOD:NONE? Might want to try switching to a more specific food item, such as FOOD:ITEM_FOOD_BISCUIT.

Dozebôm Lolumzalìs

  • Bay Watcher
  • what even is truth
    • View Profile
    • test
Re: Training academy mod help
« Reply #5 on: January 11, 2016, 09:41:26 pm »

The legendary has arrived! ;P
Logged
Quote from: King James Programming
...Simplification leaves us with the black extra-cosmic gulfs it throws open before our frenzied eyes...
Quote from: Salvané Descocrates
The only difference between me and a fool is that I know that I know only that I think, therefore I am.
Sigtext!

Protonicus

  • Bay Watcher
    • View Profile
Re: Training academy mod help
« Reply #6 on: January 12, 2016, 03:16:57 am »

very interesting. ptw
Logged

BNDR

  • Bay Watcher
    • View Profile
Re: Training academy mod help
« Reply #7 on: January 12, 2016, 12:20:00 pm »

FOOD refers specifically to cooked food.

If it's using random items, the item itself may be borked and you're SOL. I'm not sure that's exactly what's happening, though. You using FOOD:NONE? Might want to try switching to a more specific food item, such as FOOD:ITEM_FOOD_BISCUIT.

I've posted above one of the many ways I tried.

I will try using lavish meals, I tried using biscuits and it still said 'Item' in the list.

It is possible to check the list ingame if the reaction is highlighted in red because not all necessary items are available. It then lists what the reaction makes, and what it uses.

It lists everything correctly, but the food item. The food item is always refered to as "Item".

Here is the full list of items for a training reaction:

   [REAGENT:drink:300:DRINK:NO_SUBTYPE:NONE:NONE]
   [REAGENT:barrel/pot:1:NONE:NONE:NONE:NONE][CONTAINS:drink][PRESERVE_REAGENT]
   [REAGENT:A:600:BAR:NO_SUBTYPE:COAL:CHARCOAL]
   [REAGENT:money:100:COIN:NONE:NONE:NONE]
   [PRODUCT:100:1:BAR:NO_SUBTYPE:COAL:CHARCOAL]

now, as soon as I add
   [REAGENT:food:300:FOOD:NONE:NONE:NONE]
   [REAGENT:barrel/pot:1:NONE:NONE:NONE:NONE][CONTAINS:food][PRESERVE_REAGENT]

it hauls another container with food OR drink. So not exclusively food, but anything in a barrel, really.

If I just add
   [REAGENT:food:300:FOOD:NONE:NONE:NONE]
or
   [REAGENT:food:2:FOOD:NONE:NONE:NONE]

it steals another random item, be it my new made weapons, some armor, gem, or more charcoal, whatever is closest by.

**EDIT
And I just now tested:
   [REAGENT:food:1:FOOD:ITEM_FOOD_ROAST:NONE:NONE]
and Urist used a wooden log(!?) in the reaction. Something is broken as hell with this FOOD stuffs. Dangit.

**EDIT 2:
Using:
   [REAGENT:food:1:FOOD:ITEM_FOOD_ROAST:NONE:NONE]
   [REAGENT:barrel/pot:1:NONE:NONE:NONE:NONE][CONTAINS:food][PRESERVE_REAGENT]
returns
        Item
        Food-containing Item

**EDIT 3:
   [REAGENT:food:1:FOOD:ITEM_FOOD:ITEM_FOOD_ROAST:NONE]
   [REAGENT:barrel/pot:1:NONE:NONE:NONE:NONE][CONTAINS:food][PRESERVE_REAGENT]
returns the above
        Item
        Food-containing Item


the drink reaction part:
   [REAGENT:drink:300:DRINK:NO_SUBTYPE:NONE:NONE]
   [REAGENT:barrel/pot:1:NONE:NONE:NONE:NONE][CONTAINS:drink][PRESERVE_REAGENT]
says correctly:
       Drink
       Drink-containing Item

so something is definetly broken, I have now tried ALL variants possible.

**Edit 4
And what is even better, if using the barrel/pot reagent, it will also use gypsum powder, drinks, plants, seeds, whatever is in a container it seems.

The reaction amounts of either 2 or 300 are irrelevant for testing and ofc I have tried all of those, 150 for 1 item, or 1 for 1 item, 300 for 2, and 2 for 2, and so on; if the FOOD token was working as intended, it would still list the required item as "Food" in the reaction ingame list. Which it doesnt. The game says "Item". No matter which settings.

Weird.
« Last Edit: January 12, 2016, 12:36:20 pm by BNDR »
Logged

Cheesoburgor

  • Bay Watcher
  • [NO_SLEEP]
    • View Profile
Re: Training academy mod help
« Reply #8 on: January 12, 2016, 03:30:02 pm »

I think the problem you have here is that FOOD tag does not work at all (i assume this is because it either works differently to DRINK or not at all) while roast is more of an item similar to an artifact where the roast is made out of multiple ingredients so the reaction does not work as the item required is a randomly generated out of what you have. In short there isnt an item called artifact, same way there probably isnt one called roast.

The best advice i can give is to try the reaction with a food that isnt prepared using random things laying around on your fort's stone floor, for example plump helmets or wait around for someone actually experienced with reactions to find this thread.
Logged
Im alive again after a 4 year break!

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: Training academy mod help
« Reply #9 on: January 12, 2016, 06:03:48 pm »

300? FOOD has a size of 1, not 150.

EDIT: oh you handled that

BNDR

  • Bay Watcher
    • View Profile
Re: Training academy mod help
« Reply #10 on: January 12, 2016, 06:32:00 pm »

300? FOOD has a size of 1, not 150.

EDIT: oh you handled that

:P Yeah I've tried quite a few things. Interestingly, both 300 and 2 and any other number causes the dwarves to go fetch a random item.

I will switch to PLANT or something else, I've already run out of trees big time in my current embark, so charcoal actually is a nice way - maybe pot or pearlash, something that takes even longer to produce... get a complicated production circus going, instead of the common "free reactions for everything". To each his own if people want free adamantine and all that, but for me, there must be some effort before the results come. Even if its through a mod building and such..
Logged