Page 1 of 1

New Crafting System

Posted: Wed Aug 31, 2011 9:55 pm
by Austin
The history: http://forums.polserver.com/viewtopic.php?f=9&t=2332

Everything works under this principle
Tool on Material
The material on tool, tool on material and vice-versa workings are terribly unintuitive.

Say you have a black smith hammer and use it on a material that isnt in a materials.cfg
You will get the message "You cant make anything with that material."
If you use a tool on a material without an entry point in a toolOnMaterial.cfg you will get "You cant make anything with this tool on that material."

Following the black smith hammer on an ingot example
1. Tool is used, material is looked up in :*:materials.cfg
The match will be found in pkg/items/ores/config/materials.cfg
https://mytharria.svn.sourceforge.net/s ... erials.cfg

Okay so it gets the category there as 'Ingot'

It will now check :*:toolOnMaterial.cfg for Tool=ObjType&Material=[Category] and find a match here
https://mytharria.svn.sourceforge.net/s ... terial.cfg

It just wants to know... when that combo is used, what config elem does it load in :*:craftMenus.cfg
I formatted them to be more human readable so in this case it is pointing to :BlackSmithing:HammerOnIngot

It will then find this
https://mytharria.svn.sourceforge.net/s ... tMenus.cfg

It will now being showing the menus based on the info in :Blacksmithing:HammerOnIngot

This is where the real beauty comes and how easy it will be to do things!

Prior in craft systems you had to do something like Entry ObjectType Graphic DisplayName, etc.
All you need to do now is Entry ItemName

Itemname would be the Name entry in an itemdesc.cfg - it will fill in the graphic, the item name, etc. automatically.

Once an item is selected, it will read :*:craftItems.cfg to get information such as material consumption, etc.


There are a lot of hook scripts that will go into this too. The idea is to avoid changing and kludging the craft core.

toolOnMaterial can specify a menu script that runs instead of crafting's built in slider menu that is mostly client driven. (Also the slider menu items will match material color)
materials.cfg will have a script that can be run once an item is made for specific material - an example would be silver is used to make a weapon, that script could apply properties to make it better against undead.
craftItems.cfg will have scripts that can be executed prior, during and after the item is made, hooks for material consumption, etc.


Code:
https://mytharria.svn.sourceforge.net/s ... /crafting/

Re: New Crafting System

Posted: Wed Aug 31, 2011 9:55 pm
by Austin
The base craft configs are in pkg/systems/crafting/config
These shouldn't be used though - stuff should be packaged. These files are used to reference what config elem properties are used by the craft system.

In a sort of flow they are referenced:

1. https://mytharria.svn.sourceforge.net/s ... erials.cfg
2. https://mytharria.svn.sourceforge.net/s ... terial.cfg
3. https://mytharria.svn.sourceforge.net/s ... tMenus.cfg
4. https://mytharria.svn.sourceforge.net/s ... tItems.cfg

5 - optional https://mytharria.svn.sourceforge.net/s ... /tools.cfg
This is for tools in the area the user may need additionally - it will attempt to auto find even if its static.

Re: New Crafting System

Posted: Wed Aug 31, 2011 9:59 pm
by Austin

Re: New Crafting System

Posted: Fri Sep 02, 2011 4:50 am
by Yukiko
Austin,
For my own understanding here, the Mytharria SVN repository is your original Distro scripts then?
You got me all excited for a moment when I saw the Mytharria name in the URL. I remember hearing the tales of the "Great Shard Wars" between Mytharria and Journey's End and thought for a moment I might get a look at those old scripts.
*grins*

The system sounds like a good idea from your description. There is always a trade-off when designing anything between ease of use, in this case that would be adding new craftables easily (using cfg files) and customization or adding tweaks and customizations to the scripts (crafting core).

One thing that I wasn't sure about is how does your crafting system handle items requiring multiple parts, ie. a clock or a potion keg? Is that handled by the same craft core that handles say armour or do you use a separate system for multi-part items as was used in the "old" Distro?

Re: New Crafting System

Posted: Fri Sep 02, 2011 7:31 am
by Austin
This is actually a lot more flexible than anything before it AND easier. I think a big help is it doesn't rely on object type ids, but instead allows you to use object names that are defined in an itemdesc.cfg

If you wanted multiple materials you just add more material lines
https://mytharria.svn.sourceforge.net/s ... tItems.cfg plus it isn't retardedly hard-coded into anything.

{
Material [clicked] 10
Material FishHeads 10
Material 0x1234 5
}

Re: New Crafting System

Posted: Fri Sep 02, 2011 7:39 am
by Austin
The catch I have right now is recycling - due to the [clicked] - ill probably have a work-around for that later on when I get to there.

Re: New Crafting System

Posted: Sat Sep 03, 2011 3:48 am
by Yukiko
You mean like being able to resmelt armour for ingots etc.? For now you could just leave that out. When I started playing UO on JE we didn't have that ability and it can be left for later when you get it figured out. Multi-part items might be tricky when considering how and in what quantities the various ingredients get recycled from an item. However, if anyone can make this work it's you. You might have frustrated me when you did a complete redesign on the Distro but I have always been amazed at your ability to script complete systems so easily. I still remember the time when you rewrote the "boat" package in just a few hours one night.

Thanks.

Re: New Crafting System

Posted: Sat Sep 03, 2011 10:25 am
by Austin
I figured out recycling, it required a small change to craftItems.cfg.
I added RecycleCategory string

Then I put this together
https://mytharria.svn.sourceforge.net/s ... clingTool/

On pol startup, it makes a cache in a data file of each material category from :*:materials.cfg
It gets the material's color either from its materials.cfg elem or its itemdesc.cfg elem, and tracks the color as a cprop in the datafile, and the objtype as the cprop value. This makes looking up the material really fast, and keeps the flexibility of the system.

Re: New Crafting System

Posted: Mon Sep 05, 2011 5:12 am
by Yukiko
Cool.
I'll have to look through the system and see if I can implement it in my scripts.
Thanks Austin.

Re: New Crafting System

Posted: Fri Sep 09, 2011 4:22 pm
by *Edwards
It's awesome how it works but a major visual downgrade with the old gump menus. I started modify so this could be used with the Distro099 crafting menus. I do not garantee it will be this weekend, it depends on how I feel!

Re: New Crafting System

Posted: Fri Sep 09, 2011 5:22 pm
by Austin
Some wanted the slider, some did not - Thats why I put in the MenuScript plug. The menu script just needs to return the objtype of what to make - otherwise a menu script can do anything.

Re: New Crafting System

Posted: Wed Sep 14, 2011 8:34 am
by Austin
Im starting to work on an application in the SVN to modify all the crafting stuff.

Re: New Crafting System

Posted: Wed Sep 14, 2011 2:16 pm
by Austin
Here is where I am at so far. I started this morning.
It will take in the root directory for POL. It will go through and find all the pkg.cfg files and which ones are enabled.
If a package is enabled, itll look for itemdesc.cfg, materials.cfg, toolonmaterial.cfg, craftmenus.cfg and craftitems.cfg either in the package root or inside of the package's config folder.

Itll then load the config files and cache them.

Next step.. using all that parsed config info, and at some point allowing writing.

Re: New Crafting System

Posted: Wed Sep 14, 2011 3:38 pm
by *Edwards
Dude, it's awesome..

Re: New Crafting System

Posted: Wed Sep 14, 2011 9:17 pm
by Austin

Re: New Crafting System

Posted: Thu Sep 15, 2011 3:26 am
by Yukiko
Austin... Wow!
Thanks.

Re: New Crafting System

Posted: Thu Sep 15, 2011 10:47 am
by Austin
More refined materials tab.

Re: New Crafting System

Posted: Sat Sep 17, 2011 11:57 pm
by Yukiko
I am still not clear for which scriptset this crafting "configurator" is written. Does this work with the Distro (Edwards release) or your original system?

I know it doesn't work with my scripts at all : P
I'm almost ready to throw out my stuff and start over with whichever scripts I need just because of this utility.
Unless I can integrate the new crafting system into my scripts but I think that might be a "six of one or half-dozen of the other" situation.

This looks great Austin.

Re: New Crafting System

Posted: Sun Sep 18, 2011 9:23 am
by Austin
Yukiko,

This crafting system is like many things I put out - pretty generic and can snap into almost any shard with minimal effort. It doesn't really tie into any other systems outside of a few utility ones that have been common in the POL distro since 097.

The tool only works with the new craft system.

Here are the craft menu and craft item tabs.

Re: New Crafting System

Posted: Sun Sep 18, 2011 6:04 pm
by Yukiko
This looks just great. I'm salivating over getting the new crafting system into my scripts and being able to use your tool.

THANKS AUSTIN!!!!!!!!

*poke*

Re: New Crafting System

Posted: Sun Sep 18, 2011 8:21 pm
by Austin
Okay here is a... beta-build.

To-do:
1. finish craft tree
2. finish tying in muls to show item pictures

Both are low priority though... let me know if you guys have issues and or exception errors.

Re: New Crafting System

Posted: Wed Oct 19, 2011 3:50 pm
by Austin
New Zip with the UseChangeTo check box in the CraftItems tab.

Re: New Crafting System

Posted: Wed May 24, 2017 11:29 pm
by Yukiko
I recently took a look at this again. It's been a while since I ran it. At that time I didn't have the 0.98 Distro or the Mytharria scripts setup. I have since setup the Mytharria scripts and tried this tool again.

One issue I noticed is that it doesn't display the graphic images from art.mul. Instead it displays that "unused" graphic we all know and love. Has anyone used the Crafting Tool and had success with getting tile art graphics to display properly?

Re: New Crafting System

Posted: Sun May 28, 2017 7:12 am
by Austin
That part was never completed.

Re: New Crafting System

Posted: Wed May 31, 2017 4:26 am
by Yukiko
Thanks Austin!

Long time, no see on the forums. I hope all is well with you and yours.