Crafting patch for tbaMUD

Login to reply  Page: « < 1 of 1 > »
23 Mar 2009 - 15:421268
Crafting patch for tbaMUD
Lots of MUDs have a crafting system, and so I decided to create a crafting patch for tbaMUD.

Features:
* Designed from scratch to be as flexible as possible, so can be adjusted for any MUD
* Adds a craftedit OLC for adding, editing or removing crafts
* Adds 'show crafts' Imm command to list all crafts or just one specific craft.
* Adds crafts command for players, to display known crafts.
* Add a new dimension for players, the ability to create their own stuff by collecting ingredients
* Crafts are automatically available to the player dependant on level, class and skill - no pfile changes!
* ASCII crafts data file (in lib/etc) for easy manual editing
* Patches into the latest tbaMUD cleanly (was created for tbaMUD 3.58)
* An Imms manual is provided with the patch

Feel free to download the patch from here. You can also grab a copy of the PDF manual from here.

If anyone has any problems with this, please let me know...


__________________
23 Mar 2009 - 16:061269
Great work as usual Jamdog.


__________________
Rumble
The Builder Academy
tbamud.com 9091
24 Mar 2009 - 00:251271
Not meaning to be picky but the fact is, I'm not smart enough for anything else. However, in the manual, near the bottom, I see this:

Next, in the file spell_parser.c, add a new crafto line:
+ crafto(SKILL_COOOK, "cook");

This patch looks incredible and I hope I get a chance to try it out.


24 Mar 2009 - 10:441272
Thanks, Parnassus. I have now updated the manual in the downloadable patch.

Also, the patch instructions in the readme file weren't quite right - I've updated those too.


__________________
25 Mar 2009 - 12:301275
This patch is having a trial-run in Frenze's Trigun MUD (thanks Frenze for testing this!)

Unfortunately, a bizarre and unexplained crash bug has forced a re-write of much of the code.

The original system created a list of crafts, just like the object, room or mobile lists. Personally, I don't like the way these work, and in this case, gdb was telling me the crash happened in copy_craft, after it was called from add_craft on this line:
  copy_craft(craft_list+top_of_craft_table, new_craft);
In gdb, printing craft_list+top_of_craft_table gave a valid address for a craft_data structure. When I stepped into copy_craft, I was getting addresses like 0x52, 0x99 and 0x20 - I could not understand why, but if anyone has seen this before, and knows what I did, I'd be REALLY interested in finding out. This only happens when adding the 2nd craft (the first craft adds fine!?!).

Anyway, rather than using the bugged sequential list, I have re-written the code to use a linked list, something I am far happier using anyway. The above link now points to the updated version of the code. You only need to replace the old craft.c and craft.h files - no other files were changed.


__________________
26 Mar 2009 - 17:161280
Another update to the crafting patch. The link in my original post has been updated.
This fixes a bug in requirement deletion, which Frenze discovered, and also adds the ability to delete the craft, or to delete all requirements in craftedit.
The craft.c file holds most of the changes (so just replace your old one with this new one), although the following change is also required in oasis.h (if you have already added the original patch):
 #define CRAFTEDIT_REQ_FLAGS            12
 #define CRAFTEDIT_REQ_DELETE           13
+#define CRAFTEDIT_DEL_CRAFT            14
+#define CRAFTEDIT_REQ_DELCONF          15
 
 int  save_config( IDXTYPE nowhere );


__________________
06 Apr 2009 - 19:571315
Wouldn't you need a CON_CRAFTEDIT in close_socket as well? (based on the post 'DC on QEDIT')


06 Apr 2009 - 21:511317
Yes, thanks Slicer!

There should be a case CON_CRAFTEDIT: line in close_socket (comm.c) to handle any imms that get disconnected while in the craftedit OLC.

For some reason, I have created numerous OLCs for various MUDs, but never spotted that a line is needed in the close_socket function. If anyone has added any of my OLC-based patches (forge patch with forgeedit, auto transport system with tredit, mail upgrade patch with mailedit, autoquests patch with qedit (added to stock tbaMUD in version 3.56 I think), prefedit player preference/toggle editor patch, etc...), then a line will need to be added for all of these.


__________________
06 Apr 2009 - 22:001318
Quote Jamdog:
For some reason, I have created numerous OLCs for various MUDs, but never spotted that a line is needed in the close_socket function. If anyone has added any of my OLC-based patches (forge patch with forgeedit, auto transport system with tredit, mail upgrade patch with mailedit, autoquests patch with qedit (added to stock tbaMUD in version 3.56 I think), prefedit player preference/toggle editor patch, etc...), then a line will need to be added for all of these.


I don't mean to change the subject, but where can those patches be found?


06 Apr 2009 - 22:231321
Quote slicer:
Quote Jamdog:
For some reason, I have created numerous OLCs for various MUDs, but never spotted that a line is needed in the close_socket function. If anyone has added any of my OLC-based patches (forge patch with forgeedit, auto transport system with tredit, mail upgrade patch with mailedit, autoquests patch with qedit (added to stock tbaMUD in version 3.56 I think), prefedit player preference/toggle editor patch, etc...), then a line will need to be added for all of these.


I don't mean to change the subject, but where can those patches be found?

Many of the patches aren't available any more, due to server moves, but some where posted on the CWG forums.

* Forge patch with forgedit - Was in Aderon, Paragon and Astoria, and the patch is here.
* Transport system with tredit - Used to be available on Aderon's website. I should have a copy somewhere in backups, or could extract a version from Aderon at request.
* Mail upgrade patch with mailedit - Unfortunately I never got round to completing this, but it's VERY close to fully working. It allows gold/object attachments, scripted mail sending, reply/forward options, CC and BCC mailing, and more. The original thread on CWG ran into 6 pages and starts here.
* Autoquests patch with qedit - The original patch for tbaMUD 3.55 is here, although this has been stock since then.
* prefedit player preference/toggle editor - I can't find a patch for this, or a post on CWG, although I was sure I'd posted it somewhere. It simply give players an OLC for setting their preferences, including prompt, toggles, title and more. This does often require lots of tweaking when adding to a new MUD, but I can create a stock tbaMUD version, and then make a patch at request.


__________________
20 Apr 2009 - 02:381375
The crafts are not freed in the game shutdown.

In comm.c, free_craft_list() should be on the list after
log("Clearing other memory.");

Another thing is that free_craft_list(), in craft.c does not free the craft.

So after
free_craft_requirements(this_craft);
there should be
free(this_craft);


Login to reply  Page: « < 1 of 1 > »