New Crafting System

Discussion about the development of POL's official distribution scripts.

Moderators: POL Developer, Distro Developer

Locked
User avatar
Austin
Former Developer
Posts: 621
Joined: Wed Jan 25, 2006 2:30 am

New Crafting System

Post 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/
User avatar
Austin
Former Developer
Posts: 621
Joined: Wed Jan 25, 2006 2:30 am

Re: New Crafting System

Post 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.
Yukiko
Distro Developer
Posts: 2825
Joined: Thu Feb 02, 2006 1:41 pm
Location: San Antonio, Texas
Contact:

Re: New Crafting System

Post 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?
User avatar
Austin
Former Developer
Posts: 621
Joined: Wed Jan 25, 2006 2:30 am

Re: New Crafting System

Post 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
}
User avatar
Austin
Former Developer
Posts: 621
Joined: Wed Jan 25, 2006 2:30 am

Re: New Crafting System

Post 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.
Yukiko
Distro Developer
Posts: 2825
Joined: Thu Feb 02, 2006 1:41 pm
Location: San Antonio, Texas
Contact:

Re: New Crafting System

Post 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.
User avatar
Austin
Former Developer
Posts: 621
Joined: Wed Jan 25, 2006 2:30 am

Re: New Crafting System

Post 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.
Yukiko
Distro Developer
Posts: 2825
Joined: Thu Feb 02, 2006 1:41 pm
Location: San Antonio, Texas
Contact:

Re: New Crafting System

Post by Yukiko »

Cool.
I'll have to look through the system and see if I can implement it in my scripts.
Thanks Austin.
User avatar
*Edwards
Forum Regular
Posts: 303
Joined: Fri Dec 28, 2007 11:19 pm
Location: Montreal, Canada

Re: New Crafting System

Post 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!
User avatar
Austin
Former Developer
Posts: 621
Joined: Wed Jan 25, 2006 2:30 am

Re: New Crafting System

Post 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.
User avatar
Austin
Former Developer
Posts: 621
Joined: Wed Jan 25, 2006 2:30 am

Re: New Crafting System

Post by Austin »

Im starting to work on an application in the SVN to modify all the crafting stuff.
User avatar
Austin
Former Developer
Posts: 621
Joined: Wed Jan 25, 2006 2:30 am

Re: New Crafting System

Post 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.
Attachments
itemdesc.jpg
itemdesc.jpg (101.42 KiB) Viewed 16916 times
materials.jpg
materials.jpg (85.35 KiB) Viewed 16917 times
craftTool.jpg
craftTool.jpg (55.17 KiB) Viewed 16920 times
User avatar
*Edwards
Forum Regular
Posts: 303
Joined: Fri Dec 28, 2007 11:19 pm
Location: Montreal, Canada

Re: New Crafting System

Post by *Edwards »

Dude, it's awesome..
User avatar
Austin
Former Developer
Posts: 621
Joined: Wed Jan 25, 2006 2:30 am

Re: New Crafting System

Post by Austin »

Yukiko
Distro Developer
Posts: 2825
Joined: Thu Feb 02, 2006 1:41 pm
Location: San Antonio, Texas
Contact:

Re: New Crafting System

Post by Yukiko »

Austin... Wow!
Thanks.
User avatar
Austin
Former Developer
Posts: 621
Joined: Wed Jan 25, 2006 2:30 am

Re: New Crafting System

Post by Austin »

More refined materials tab.
Attachments
materialstab2.jpg
materialstab2.jpg (66.39 KiB) Viewed 16874 times
Materials.jpg
Materials.jpg (101.16 KiB) Viewed 16890 times
Yukiko
Distro Developer
Posts: 2825
Joined: Thu Feb 02, 2006 1:41 pm
Location: San Antonio, Texas
Contact:

Re: New Crafting System

Post 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.
User avatar
Austin
Former Developer
Posts: 621
Joined: Wed Jan 25, 2006 2:30 am

Re: New Crafting System

Post 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.
Attachments
craftMenus.jpg
craftMenus.jpg (106.75 KiB) Viewed 16800 times
craftItems.jpg
craftItems.jpg (89.28 KiB) Viewed 16800 times
Yukiko
Distro Developer
Posts: 2825
Joined: Thu Feb 02, 2006 1:41 pm
Location: San Antonio, Texas
Contact:

Re: New Crafting System

Post 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*
User avatar
Austin
Former Developer
Posts: 621
Joined: Wed Jan 25, 2006 2:30 am

Re: New Crafting System

Post 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.
User avatar
Austin
Former Developer
Posts: 621
Joined: Wed Jan 25, 2006 2:30 am

Re: New Crafting System

Post by Austin »

New Zip with the UseChangeTo check box in the CraftItems tab.
Attachments
CraftTool.zip
(59.7 KiB) Downloaded 371 times
Yukiko
Distro Developer
Posts: 2825
Joined: Thu Feb 02, 2006 1:41 pm
Location: San Antonio, Texas
Contact:

Re: New Crafting System

Post 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?
User avatar
Austin
Former Developer
Posts: 621
Joined: Wed Jan 25, 2006 2:30 am

Re: New Crafting System

Post by Austin »

That part was never completed.
Yukiko
Distro Developer
Posts: 2825
Joined: Thu Feb 02, 2006 1:41 pm
Location: San Antonio, Texas
Contact:

Re: New Crafting System

Post by Yukiko »

Thanks Austin!

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