Aller au contenu

Photo

Retrieving list of learned recipes


  • Veuillez vous connecter pour répondre
8 réponses à ce sujet

#1
Schwinni

Schwinni
  • Members
  • 921 messages
Hi all,

I'm searching now for hours, but I just can't find a function which gives me the list of the learned recipes. :crying:

How do I have to do this?

#2
TimelordDC

TimelordDC
  • Members
  • 923 messages
All crafting recipes are items so you should be able to get them with a GetItemsInInventory call. I haven't actually done this so don't know if recipes are treated differently.

#3
Schwinni

Schwinni
  • Members
  • 921 messages
Hmm, I have to do some test with the size of the arrays returned when using the different arguments for the item types, because there is no GET_ITEMS_RECIPES constant or something like that...

#4
Schwinni

Schwinni
  • Members
  • 921 messages
Nope, doesn't work this way.

I first tried
GetArraySize(GetItemsInInventory(oPC, GET_ITEMS_OPTION_ALL, 0, "", TRUE)) - GetArraySize(GetItemsInInventory(oPC, GET_ITEMS_OPTION_BACKPACK, 0, "", TRUE)) - GetArraySize(GetItemsInInventory(oPC, GET_ITEMS_OPTION_EQUIPPED, 0, "", TRUE))
That is = 0. So, "ALL" doesn't give more than "BACKPACK" + "EQUIPPED"


Then I tried
GetArraySize(GetItemsInInventory(oPC, GET_ITEMS_OPTION_ALL, 0, "", FALSE)) - GetArraySize(GetItemsInInventory(oPC, GET_ITEMS_OPTION_ALL, 0, "", TRUE))
That gives exactly the number of plot items I see in the GUI. So, learned recipes are no plot item.


Any other ideas?

Modifié par Schwinni, 09 avril 2010 - 09:11 .


#5
TimelordDC

TimelordDC
  • Members
  • 923 messages
They are definitely items, that I am sure of (ITEM_TYPE_MISC). The game must treat them differently, I guess.

One last thing you can try is to see if CountItemsByTag on the player for a specific recipe tag returns anything.

#6
Schwinni

Schwinni
  • Members
  • 921 messages
I'm pretty sure that won't work.
When adding a recipe with
object learned = CreateItemOnObject(R"gxa_im_cft_run_110.uti", OBJECT_SELF, 1, "", FALSE);
nothing is shown. Even worse, no object is returned. You can test it:
if (GetObjectType(learned) != OBJECT_TYPE_INVALID) {
    DisplayStatusMessage("You learned Journeyman Barrier Rune Tracing.");
}
The message isn't created, so the type is OBJECT_TYPE_INVALID.
It seems like a recipe looses its status as item immediatly when it is added to the inventory - that behaviour is also visible in the GUI when buying a recipe.

I analyzed a save file and saw that learned recipes are stored totally different from other items.
They are saved in SAVEGAME_PARTYLIST\\SAVEGAME_CRAFTING_RECIPE_LIST, and not by name/tag, but by the ID defined in recipes.xls.
The weird thing is, that recipe.xls exists in the toolset's resources folder, but there is no recipe.gda inside the 2da.erf.

I'm stumped...

P.S.: I wish the toolset had a documentation like the Java API docs!

#7
TimelordDC

TimelordDC
  • Members
  • 923 messages
That's because gda are created based on worksheet names - there is a crafting_recipes.gda.

#8
Schwinni

Schwinni
  • Members
  • 921 messages
OK, I understand.
Still, I don't know how to retrieve the damned list of learned recipes. :(

#9
Schwinni

Schwinni
  • Members
  • 921 messages
Anybody?

Devs? :D