Jump to content

Need help with recipes file logic !?


r0land

Recommended Posts

Hi

 

 

I am working on my own mod which comes with new items and recipes.

 

In the beginning I had one script-file for the items (beautyitems.txt) and one script-file for the recipes (wootrecipes.txt). This was working fine.

 

Then I was looking through the original game script-files (farming.txt, items.txt, newitems.txt and recipes.txt) and found out that the game developers put items and recipes into just one file.

 

Good example is "Open Tomato Seed Packet" and "Put in packet" inside the farming.txt.

 

I gave it a try and moved the recipe{}-content from my wootrecipes.txt to the beautyitems.txt. So the wootrecipes.txt had just the basic code "module mymod{}". This was working fine too.

 

But then I have deleted the wootrecipes.txt.. and this breaks the game/mod mechanics. My char had still my new items (given by professions changings).. but the recipes were not longer shown.

 

 

This means.. you can put your new items and recipes into only one script-file but you need a second (useless) file with at least "module mymod{}" as content to get the recipes working.

 

This is somehow stupid from my point of view.. the concept/logic as well as the need of heavy try & error for modders.

 

 

Could somebody explain the logic behind that? This looks not just like a bug.. this is coded into the game deliberately with some effort. For which reason?

 

 

Greetings

Link to comment
Share on other sites

Could somebody explain the logic behind that? This looks not just like a bug.. this is coded into the game deliberately with some effort. For which reason?

 

I'll try: creating games is more about 'getting shit done' than it is about 'creating great code' ;)

Link to comment
Share on other sites

Now I have renamed the useless file to just "_" but it looks still silly. This means we can use other file extensions as .txt - which is great!

 

 

@ RoboMat

 

Thank you for your answer.. but it would be easier for the devs without those code parts. ^^

Link to comment
Share on other sites

Hm.. I could do it but I am merging/extending several mods from other peoples and the work is not done yet. I don't want post it here right now (and without permissions).

 

But you can try it yourself with the Dried Fruits mod. The modder has added a cheat/test lua where you can press a key (keycode 36 or 37) to get the needed items added.

 

The mod comes with three script files (assorted_items (dryingrack), dried_fruits and recipes). Move now the contents from dried_fruits and recipes to assorted_items (ofcourse without module and imports). Just let the basic code "module BK_DriedFruits{}" inside the two files (even imports are not needed). The game/mod will still work as intended. Even if you delete one of the (not longer needed) files or if you rename all of the files to whatever you want.

 

But if you delete both files (dried_fruits and recipes) or if you clean the whole contents of the files.. so you would have just the assorted_items-file left with all the content.. the game/mod will not longer show you the recipes in context menue but you will still have the items.

Link to comment
Share on other sites

And here is another curiosity:

 

The one script-file inside my mod has txt extension and I can rename the file to whatever I want. I can (as said above) rename the second (useless) file to whatever I want and it can have a random extension or no extension. This is all working fine.

 

I am using Notepad2 as text editor if I am scripting and coding things. I hate to link txt-files to Notepad2. Therefor I have renamed my script-file to "beautyitems.txt.np2" (np2 is linked to Notepad2 here). Works great.. the game will find and use the file.

 

But if I rename it to "beautyitems.np2" the game will not find and use it.. even the given items from prefessions are not added.

 

 

I have purchased the game maybe 10 days before and I was modding maybe 4-5 days now. What other crazy things I will find in the next days or weeks?

Link to comment
Share on other sites

I have purchased the game maybe 10 days before and I was modding maybe 4-5 days now. What other crazy things I will find in the next days or weeks?

 

Probably nothing that the other modders haven't seen already ;)

 

Stay on the good side of the force ... resist the backseat coding! :P

Link to comment
Share on other sites

I have purchased the game maybe 10 days before and I was modding maybe 4-5 days now. What other crazy things I will find in the next days or weeks?

Plenty. Much of the game's probably grown organically over the years, without weeks of pre-planning spent on implementation of every single feature, which is why not everything is perfect, but just something that works and does the needed job.

Link to comment
Share on other sites

Probably nothing that the other modders haven't seen already ;)

To have a place where others know the problems I will run in.. sometime in the future? Sounds good for me! ^^

 

Plenty. Much of the game's probably grown organically over the years, without weeks of pre-planning spent on implementation of every single feature, which is why not everything is perfect, but just something that works and does the needed job.

Agree.

But just to say that clear: It's not all bad here from my point of view. I love the possibility to mod this game on my own and it looks very modding-friendly and somehow simple without the need of enormous modding tools.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...