New OLC Craft System

  • Vatiken
  • Vatiken's Avatar Topic Author
  • Offline
  • Administrator
  • Administrator
  • tbaMUD Programmer
More
7 years 7 months ago #175 by Vatiken
New OLC Craft System was created by Vatiken
I uploaded the ALPHA version on my new crafting system to the download section tonight. The code is completeISH, although there will be some bug-fixing, clean up and documentation to do before an official release. Feel free to download it, play with it, expand it, and try and blow it up.

Cheers,
Vatiken

Crafting Patch, Version 0.1 ALPHA VERSION:
Created by Vatiken, (Joseph Arnusch)
************@gmail.com
June 21st, 2012

:: Patch created using tbaMUD 3.63 r318 ::

Readme Version 1.0

Files:
1) README: This file
2) crafts.c: The crafts.c file
3) crafts.h: The crafts.h header file
4) crafts.patch: The patch file

Before you begin:

IMPORTANT IMPORTANT IMPORTANT IMPORTANT
1) This is the ALPHA VERSION, which means it will contain bugs, issues, and so
forth and so forth. The purpose of this release is for help in troubleshooting
before an official release. I'd advise backing up your MUD just in case if you
choose to progress with applying this patch.

2) I assume no responsibility for any damage this causes in your MUD, apply at your
own risk.

3) Feel free to use this in anyway you see fit.

What this does:

This patch adds a crafting system to your MUD. If you've previously used another
crafting system, you will most likely notice some similarities.

Features:
* Simple, Clean Interface using the 1,2,3 colour options for easy customization.
* Easy to expand upon.
* Duration based crafting, ie: Crafting X takes 6 seconds.
* Skill AND Blueprint based crafts.
* Customizable Display Messages for the character and the room.

Things to note:

1) This system uses linked lists, which means if you intend on having 10000 crafts,
you may want to look at another option.
2) There is no VNUM system for this crafting system, just a reference ID number.
3) You can use > show craft <name> to display info on a craft.
The information varies if the craft is a RECIPE(BLUEPRINT)/NON-RECIPE(NON-BLUEPRINT)
4) Typing "craft" will bring up the crafts list for your character, and colour code
which crafts you have the goods to create.

5) An OFFICIAL release will be coming in the near future, 99% of the additions/modifications
will be to crafts.c and crafts.h, so minimal work should be required to upgrade.

Installation:

1) As this is an ALPHA VERSION, there is only a hand-patch patch file, and the .c and .h. file.
Should be easy enough to figure out.

2) Feel free to send any bugs to me either through the tbamud.com forums, or
by email at This email address is being protected from spambots. You need JavaScript enabled to view it..


tbaMUD developer/programmer

Please Log in or Create an account to join the conversation.

More
7 years 7 months ago #179 by Halenbane
Replied by Halenbane on topic New OLC Craft System
First batch of errors. I'm looking into it now.

crafts.c: In function 'load_crafts':
crafts.c:133: warning: dereferencing type-punned pointer will break strict-aliasing rules
crafts.c: In function 'craftedit_setup_new':
crafts.c:632: error: 'struct oasis_olc_data' has no member named 'craft'
crafts.c:633: error: 'struct oasis_olc_data' has no member named 'craft'
crafts.c:635: error: 'struct oasis_olc_data' has no member named 'craft'
crafts.c:636: error: 'struct oasis_olc_data' has no member named 'craft'
crafts.c: In function 'craftedit_setup_existing':
crafts.c:648: error: 'struct oasis_olc_data' has no member named 'craft'
crafts.c:649: error: 'struct oasis_olc_data' has no member named 'craft'
crafts.c: In function 'do_oasis_craftedit':
crafts.c:704: error: 'struct oasis_olc_data' has no member named 'req'
crafts.c: In function 'craftedit_disp_req_flags':
crafts.c:755: error: 'struct oasis_olc_data' has no member named 'req'
crafts.c: In function 'craftedit_disp_craft_flags':
crafts.c:774: error: 'struct oasis_olc_data' has no member named 'craft'
crafts.c: In function 'craftedit_requirement_menu':
crafts.c:780: error: 'struct oasis_olc_data' has no member named 'craft'
crafts.c: In function 'craftedit_disp_menu':
crafts.c:802: error: 'struct oasis_olc_data' has no member named 'craft'
crafts.c: In function 'craftedit_parse':
crafts.c:921: error: 'struct oasis_olc_data' has no member named 'craft'
crafts.c:937: error: 'struct oasis_olc_data' has no member named 'craft'
crafts.c:938: error: 'struct oasis_olc_data' has no member named 'craft'
crafts.c:939: error: 'struct oasis_olc_data' has no member named 'craft'

Please Log in or Create an account to join the conversation.

More
7 years 7 months ago #180 by Halenbane
Replied by Halenbane on topic New OLC Craft System
Seems like maybe there is an include missing in crafts.c? Not sure.

Please Log in or Create an account to join the conversation.

  • Vatiken
  • Vatiken's Avatar Topic Author
  • Offline
  • Administrator
  • Administrator
  • tbaMUD Programmer
More
7 years 7 months ago #184 by Vatiken
Replied by Vatiken on topic New OLC Craft System
Looks like you missed the part of the patch that adds craft & rec to oasis_olc_data.

tbaMUD developer/programmer

Please Log in or Create an account to join the conversation.

More
7 years 7 months ago #186 by Halenbane
Replied by Halenbane on topic New OLC Craft System
Yeah forgot the structs in oasis.h

Still getting the one warning, but thats it.


crafts.c:134: warning: dereferencing type-punned pointer will break strict-aliasing rules

Please Log in or Create an account to join the conversation.

  • Vatiken
  • Vatiken's Avatar Topic Author
  • Offline
  • Administrator
  • Administrator
  • tbaMUD Programmer
More
7 years 7 months ago #187 by Vatiken
Replied by Vatiken on topic New OLC Craft System
Now that I think about it, that's probably because tbaMUD uses an unsigned short int for vnums while I use an int. It shouldn't cause an issue but I will fix it for the official release.

tbaMUD developer/programmer

Please Log in or Create an account to join the conversation.

More
7 years 7 months ago - 7 years 7 months ago #188 by Halenbane
Replied by Halenbane on topic New OLC Craft System
For Craft Skill , When a player succeeds does it increase a craft skill. I'm not seeing it, but I do see that you can set the value.

Edit:

I'm seeing now that it does show craft in prac , gonna craft a bunch and see if it increases.
Last edit: 7 years 7 months ago by Halenbane.

Please Log in or Create an account to join the conversation.

More
7 years 7 months ago - 7 years 7 months ago #189 by Halenbane
Replied by Halenbane on topic New OLC Craft System
Also it seems even when a player fails it doesn't delete the ingredients. Even if you have no flags set (saveonfail, !remove etc)
Last edit: 7 years 7 months ago by Halenbane.

Please Log in or Create an account to join the conversation.

More
7 years 7 months ago #190 by Halenbane
Replied by Halenbane on topic New OLC Craft System
Odd, seems if you have an object set to INROOM it does remove the object when you fail, even if you have !remove set.

Example:

I have a potion that requires 2 ingredients only - If I fail to make it, I don't lose the ingredients, even without !remove set.

If I then add an ingredient to the recipe, a forge for example, that is set to INROOM. When you attempt to craft, after
1 try, even WITH the !remove flag it destroys the forge.

Please Log in or Create an account to join the conversation.

More
7 years 7 months ago - 7 years 7 months ago #191 by Halenbane
Replied by Halenbane on topic New OLC Craft System
Taking the same example as before, and adding a requirement of Blueprint to it, when you fail , it then deletes the ingredients.

Something else that is weird.

If you have a craft that requires ingredient1, ingredient2, and blueprint 1.

You have all items in inventory, craft item and fail, removes ingredient1 and ingredient2. (you keep blueprint)

You get the ingredient1 and ingredient2 again, and try to craft the item, and it says "What are you trying to craft?"

(Even though you have all the required items + blueprint)

drop blueprint
get blueprint

Try again - Works (but still doesn't show in craft list)


Also is there a way for players to see what ingredients are required if they have the blueprint/recipe, other than putting it in the a-desc of the item.
Last edit: 7 years 7 months ago by Halenbane.

Please Log in or Create an account to join the conversation.

  • Vatiken
  • Vatiken's Avatar Topic Author
  • Offline
  • Administrator
  • Administrator
  • tbaMUD Programmer
More
7 years 7 months ago #192 by Vatiken
Replied by Vatiken on topic New OLC Craft System
Both blueprint and non-blueprint use the same remove_components() function, if it wasn't working on one, it shouldn't work on the other. I just tried crafting a skill based craft on my MUD, and upon failure I lost my raw iron, but the in-room & !remove furnace remained.

tbaMUD developer/programmer

Please Log in or Create an account to join the conversation.

More
7 years 7 months ago #193 by Halenbane
Replied by Halenbane on topic New OLC Craft System
1) Craft Name : Steel Sword
2) Craft Timer : 2 seconds
3) Craft Item : "a strong steel sword"
4) Craft Self Msg : "You carefully place a steel hilt and blade together making $p."
5) Craft Room Msg : "$n carefully places a steel hilt and blade together making $p."
S) Craft Skill : No Skill (0)
F) Flags : Needs Recipe
R) Requirements :
[4914] 1 , "a steel hilt" [NOBITS ]
[4915] 1 , "a steel blade" [NOBITS ]
X) Delete
Q) Quit


You are carrying:
[4922] A Steel Sword Blueprint
[4915] a steel blade
[4914] a steel hilt

craft steel

You begin attempting to craft.

You mess up your attempt to craft.

Inventory

You are carrying:

[4922] A Steel Sword Blueprint

load obj 4914
load obj 4915

Inventory

You are carrying:

[4922] A Steel Sword Blueprint
[4914] a steel hilt
[4915] a steel blade

craft steel

What are you trying to craft?

drop blueprint
You drop A Steel Sword Blueprint.

get blueprint
You get A Steel Sword Blueprint.

craft steel
You begin attempting to craft.



Also when I have the hilt and blade and recipe, typing craft doesn't list the craft.

If I remove the recipe from the requirements, and type craft, it lists fine.

Please Log in or Create an account to join the conversation.

More
7 years 7 months ago - 7 years 7 months ago #194 by Halenbane
Replied by Halenbane on topic New OLC Craft System
I've also noticed that at superb craft skill , with a 0 req skill craft, you still fail a good many times. Not sure if it was intended this way.

See Edit in prior post***
Last edit: 7 years 7 months ago by Halenbane.

Please Log in or Create an account to join the conversation.

  • Vatiken
  • Vatiken's Avatar Topic Author
  • Offline
  • Administrator
  • Administrator
  • tbaMUD Programmer
More
7 years 7 months ago #196 by Vatiken
Replied by Vatiken on topic New OLC Craft System
Everything seems to work fine. The reason why you need to drop your recipe and pick it back up again is because you have 3 "steel" items, and when you try and "craft steel" the mud thinks you are trying to get your recipe from the first object with "steel" in it's alias.

"Recipe" crafts don't show up on the craft list, because you need a recipe to know the craft.

There are no skill increases based on crafting use.

With regards to failures, are you sure you are using the craft skill? The above craft isn't.

tbaMUD developer/programmer

Please Log in or Create an account to join the conversation.

More
7 years 7 months ago #197 by Halenbane
Replied by Halenbane on topic New OLC Craft System
Ok I understand the issue of having multiple items with the same keywords.
I also now understand what you were doing with not showing recipes in craft since it requires a blueprint.

As far as your question, "are you using the craft skill"

Um, Im typing craft as always, not sure what else I would be typing... or maybe I am misunderstanding your question.

If I have an item that has 0 skill req, and I am superb, i shouldn't fail 4/5.

Please Log in or Create an account to join the conversation.

More
7 years 7 months ago - 7 years 7 months ago #198 by Halenbane
Replied by Halenbane on topic New OLC Craft System
Since you bothered even putting a skill req in crafting, seems maybe it would make more sense to make it take more than 2 or 3 practices to max craft. Otherwise you have a person able to make some elite craft, just as easily as a noobie craft. Then again, if the failure rate is still high at superb, I don't know that it will matter much.


P.s.

What you have done is awesome, and I don't want to take away from that. 100% respect to you for doing it for the community, and answering questions with patience. I just want to post feedback in the efforts that even a little may help.
Last edit: 7 years 7 months ago by Halenbane.

Please Log in or Create an account to join the conversation.

More
7 years 7 months ago #199 by Halenbane
Replied by Halenbane on topic New OLC Craft System
Just had an idea,

It would be pretty cool if you had it so when a person tagged an item as blueprint, if it is assigned to ingredient objects, it then auto-generates a default e-desc with the obj keywords.

So in other words,

If you take my blueprint from earlier, if a player looks at it, it would show.

Blueprint: A steel sword

Required Ingredients

a steel hilt x 1
a steel blade x 1


Of course this could easily be done by the builder making the items , or maybe they don't want the ingredients listed automatically. In which case, maybe another toggle in craftedit , when you set recipe required, it then prompts you:

Would you like to autogenerate ingredient information to recipe?

Please Log in or Create an account to join the conversation.

More
7 years 7 months ago - 7 years 7 months ago #200 by Halenbane
Replied by Halenbane on topic New OLC Craft System
I just tried to craft an item , with level req = 0 , with craft set to superb, and failed the item like 20 times.

**EDIT** Setting the req to 1 instead of 0 , takes out all those failures. I guess 0 is always fail?

Earlier on the same item, I made 5 in a row just fine.

craft sword

You begin attempting to craft.

You mess up your attempt to craft.

You are carrying:
( 7) [4914] a steel hilt
( 7) [4915] a steel blade
[4922] A Steel Sword Blueprint

craft sword

You begin attempting to craft.

You mess up your attempt to craft.

You are carrying:
( 6) [4914] a steel hilt
( 6) [4915] a steel blade
[4922] A Steel Sword Blueprint

craft sword

You begin attempting to craft.

You mess up your attempt to craft.


**The above is from this craft**

1) Craft Name : Sword steel
2) Craft Timer : 2 seconds
3) Craft Item : "a strong steel sword"
4) Craft Self Msg : "You carefully place a steel hilt and blade together making $p."
5) Craft Room Msg : "$n carefully places a steel hilt and blade together making $p."
S) Craft Skill : No Skill (0)
F) Flags : Needs Recipe
R) Requirements :
[4914] 1 , "a steel hilt" [NOBITS ]
[4915] 1 , "a steel blade" [NOBITS ]
X) Delete
Q) Quit
Last edit: 7 years 7 months ago by Halenbane.

Please Log in or Create an account to join the conversation.

More
7 years 7 months ago #201 by Halenbane
Replied by Halenbane on topic New OLC Craft System
Another idea:

Make it so players can 'learn blueprint' to commit it to memory, which then destroys the blueprint.

It would be added to the players list shown when they type craft , along with the recipes that don't require blueprints.

If this was done, they would need a way to see what ingredients were required. (If you had it added the ingredients to the e-desc in the blueprint as I stated earlier, this wouldn't help because of the blueprint being destroyed)

Also setting it up this way, 1 person can't get a rare blueprint spawn, and then just hand it to everyone else to use.

Please Log in or Create an account to join the conversation.

  • Vatiken
  • Vatiken's Avatar Topic Author
  • Offline
  • Administrator
  • Administrator
  • tbaMUD Programmer
More
7 years 7 months ago #203 by Vatiken
Replied by Vatiken on topic New OLC Craft System

For Craft Skill , When a player succeeds does it increase a craft skill. I'm not seeing it, but I do see that you can set the value.

Edit:

I'm seeing now that it does show craft in prac , gonna craft a bunch and see if it increases.

It does not increase the craft skill or whichever skill/spell you decide to use, changing it to do so would be a simple change if that's what your MUD desires.

As far as your question, "are you using the craft skill"

Um, Im typing craft as always, not sure what else I would be typing... or maybe I am misunderstanding your question.

If I have an item that has 0 skill req, and I am superb, i shouldn't fail 4/5.

The crafting system is not associated with the "CRAFT" skill. The skill itself is just a simple filler. The idea behind the design was to allow for multiple craft-like skills (Metallurgy, Woodwork, Sewing...), You can choose SKILL_CRAFT as the skill level used in creating the craft, or you can use SPELL_MAGIC_MISSILE, it's completely up to user preference.

Since you bothered even putting a skill req in crafting, seems maybe it would make more sense to make it take more than 2 or 3 practices to max craft. Otherwise you have a person able to make some elite craft, just as easily as a noobie craft. Then again, if the failure rate is still high at superb, I don't know that it will matter much.

This is a generic crafting system designed to be easily expanded upon, I purposely left the skill success system rather bland so that a MUD dev could easily change it to their MUD's preference. If your MUD uses the stock practice system, you can always alter the code to work the way you want.
" 3) Feel free to use this in anyway you see fit."

It would be pretty cool if you had it so when a person tagged an item as blueprint, if it is assigned to ingredient objects, it then auto-generates a default e-desc with the obj keywords.

This would be up to your personal preference, as a craft detail blurb can already be ascertained thru "look <blueprint>", This however got passed over when I was extracting the code from my MUD.
Index: act.informative.c
===================================================================
--- act.informative.c	(revision 318)
+++ act.informative.c	(working copy)
@@ -131,7 +131,9 @@
     case ITEM_DRINKCON:
       send_to_char(ch, "It looks like a drink container.");
       break;
-
+    case ITEM_BLUEPRINT:
+      show_craft(ch, get_craft_from_id(GET_OBJ_VAL(obj, 0)));
+      break;
     default:
       send_to_char(ch, "You see nothing special..");
       break;

**The above is from this craft**

1) Craft Name : Sword steel
2) Craft Timer : 2 seconds
3) Craft Item : "a strong steel sword"
4) Craft Self Msg : "You carefully place a steel hilt and blade together making $p."
5) Craft Room Msg : "$n carefully places a steel hilt and blade together making $p."
S) Craft Skill : No Skill (0)
F) Flags : Needs Recipe
R) Requirements :
[4914] 1 , "a steel hilt" [NOBITS ]
[4915] 1 , "a steel blade" [NOBITS ]
X) Delete
Q) Quit

The above skill doesn't have a craft skill selected, this needs to be selected first for it to work as intended.

Make it so players can 'learn blueprint' to commit it to memory, which then destroys the blueprint.

It would be added to the players list shown when they type craft , along with the recipes that don't require blueprints.

If this was done, they would need a way to see what ingredients were required. (If you had it added the ingredients to the e-desc in the blueprint as I stated earlier, this wouldn't help because of the blueprint being destroyed)

If this is something you'd like it wouldn't be overly difficult to expand the crafts code to allow for it. You'd need to alter list_available_crafts() to show learned blueprints, and then you'd just need some means of saving/loading the data to the actual character.

tbaMUD developer/programmer

Please Log in or Create an account to join the conversation.

Time to create page: 0.385 seconds