Craft System

Archive of posts related to former distro versions. Be aware that posts here do not refer to the current distro and may not work.

Moderators: POL Developer, Distro Developer

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

Craft System

Post by Austin »

Ive identified a few problems people have when setting up distro shards and crafting.
The first is the difficulty in adding new craftables, the second adding new materials to craft with.

Im starting to draft out new ideas for a consolidated craft system on the 097 svn (which is the one for the time being ill be working on, due to demands of our user-base [see, we do sorta listen])

I haven't written anything major since late 1996, and want to create something that makes it easier for you guys to design your games.

Code: Select all

[23:21] <@Austin> Im really out of practice with escript ;O
[23:24] <ncrsn> distro's head dev speaking
[23:25] <ncrsn> what are you working on currently?
[23:25] <@Austin> new craft system
[23:25] <@Austin> thats a lot easier to change
[23:26] <@Austin> I havent really done any major scripting since maybe late 2006?
[23:26] <@Austin> since then, no ne else has really touched the distro, either :o
[23:27] <@Austin> im gonna make it so people can use uo's horizontal slider menu or a custom gump.. itll just start a seperate script that passes it info necessary to build a gump then use its return value
[23:28] <ncrsn> whole new structure, then?
[23:28] <@Austin> yeah
[23:28] <ncrsn> looking forward to it
[23:28] <@Austin> When you use an item, itll reference :*:materials to determine if it is a valid 'material'
[23:29] <ncrsn> it's funny to see what others are doing, sharing ideas and so forth
[23:29] <@Austin> so say you double click a smith hammer, then click ingots
[23:29] <@Austin> itll determine if its a valid material you can work with
[23:29] <@Austin> so in each package you can sort materials (ores would go in the ore package, etc.)
[23:29] <@Austin> I just thought this up a few days ago... so there may be flaws in my idea
[23:30] <@Austin> then some sorta config to determine what that material + tool combo can make
[23:30] <@Austin> materials.cfg would have modifiers for quality or other stuff
[23:30] <ncrsn> umm, I was just going to ask about that
[23:30] <@Austin> maybe the ability to have a special craft creation script after being made to apply magic properties
[23:30] <ncrsn> the material + tool / skill thingy
[23:30] <@Austin> well there will be a craftitems.cfg
[23:30] <@Austin> that determines the base skill
[23:31] <ncrsn> uhuhu, if possible, add it before the item creation
[23:31] <@Austin> so maybe an optional argument in materials.cfg
[23:31] <@Austin> where it runs a script before the item is made to determine the skill check
[23:31] <@Austin> external skill checker
[23:31] <@Austin> and then once you make it.. a material may have special properties to apply in a seperate script
[23:31] <ncrsn> like ItemIsAboutToBeCraftedHereAreTheParamsReturnValuesWillBeUsedToCreateTheItem--Script
[23:31] <@Austin> like say you use wet pasta to make a sword... it makes it bendable 
[23:31] <@Austin> heh
[23:32] <@Austin> yeah ill try to make it where people can have external scripts (hooks) 
[23:32] <@Austin> based on both material and the item being crafted 
[23:33] <ncrsn> it would be very useful because the stacking.
[23:33] <@Austin> true 
[23:33] <@Austin> create the item in a seperate storage container, then move it to the backpack
[23:33] <@Austin> thats what I did on tsse
[23:33] <ncrsn> and somewhat useful if you have, say, explosable sword you want to set off after player gots his "you created a explosion sword!" message
[23:33] <@Austin> or use proto-items actually
[23:33] <@Austin> that was added in 095 to resolve that issue
[23:34] <ncrsn> yeah, and that's not neat
[23:34] <@Austin> its not?
[23:34] <ncrsn> I say it isn't
[23:34] <@Austin> I thought it was a useful feature
[23:34] <@Austin> gives you a chance to create an item, apply properties to it, then make it appear so it doesnt stack wrong.
[23:35] <@Austin> I remember back on pol 094 players would craft something stackable in color 0, then make something in red, and the whole color 0 stack became red 
[23:35] <@Austin> to get around that you had to make the items in a storage area, then move them
[23:35] <@Austin> thats why Racalac made the proto-item function
[23:35] <ncrsn> mmh, I mean, if you can create a special item either using modified itemdesc values or creating a basic item and modifying it afterwards, I'd go with the first one
[23:36] <ncrsn> is that the proto item version?
[23:36] <@Austin> I hit /clear as you typed that last message :(
[23:36] <ncrsn> way to go.
[23:36] <ncrsn> say, you want to create stackable item with different color
[23:37] <ncrsn> I'd do it -- var itemdesc := GetItemDescriptor(objtype); itemdesc.color := realcolor; CreateItemInBackpack(who, itemdesc); --
[23:37] <@Austin> right
[23:38] <@Austin> thats what i meant by protoitem.. couldnt remember the exact function name (told you im rusty!)
[23:38] <ncrsn> yeah, it hit me after I read what you wrote
[23:38] <@Austin> I remember whats there, but I dont have all the properties and functions memorized anymore
[23:38] <@Austin> happens when you dont use a language for a while
[23:38] <ncrsn> so basically POL does the same scripter would have had to do himself before: creates the default item and modifies it how ordered to.
[23:39] <@Austin> yes
[23:39] <@Austin> this should be an interesting craft system to make
[23:39] <ncrsn> could be useful to know, thank you
[23:39] <@Austin> My goal is to .. make it like this one craft system a few shards can adopt and share stuff
[23:39] <@Austin> like.. I try to do with everything
[23:40] <ncrsn> good goal it is
User avatar
Austin
Former Developer
Posts: 621
Joined: Wed Jan 25, 2006 2:30 am

Re: Craft System

Post by Austin »

1. Have packaged support for a 'materials.cfg'
This way people can have an ore package and define the ores as materials that can be crafted into ingots.
An ingot package could have a materials.cfg that would craft into swords.

Etc.

2. A user clicks a smith hammer and selects the ingot.
This would run a menu config to see what can be made with that tool object type and the item clicked.
The item clicked would reference materials.cfg to see if it is valid.

3. A script would run (or use the crafting system's core menus) to make a menu of what can be crafted.
The core-script or sub script would then return what was selected to be made.

4. Material amounts are checked for presence.
Maybe allow a seperate sub script to also handle material consumption - pass it what craftitems.cfg says it should consume.

5. Do a skill check - or allow a subscript to do the checks (>0 means a pass)

6. The object type selected to be made would go to a craftitem.cfg and determine the material(s) it needs.
If say the user clicked on superore it would maybe apply a high quality modification and special color to the item made.
A script could be run to handle the item when it is a descriptor to manipulate it further.

7. Make the item - run an optional subscript to apply special stuff to it from both the material information and the craftitems.cfg information (could be possibly 2 scripts)
User avatar
OldnGrey
POL Expert
Posts: 657
Joined: Sat Feb 04, 2006 6:26 pm

Re: Craft System

Post by OldnGrey »

When I last looked at the distro crafting, it always wanted you to target an ingredient.
May I suggest that for some things you really don't need to do that - the script can often find the substance it needs (eg logs or iron ingots etc) and keep searching if the stack is insufficient, and even look for multiple instances of something (eg the script calls for 2 nonstackable items). And on that point, it should search the TOP backpack first before descending into subpacks. That's a script search cos the current functions that searches into subcontainers don't check the top container first.

When you look at complex crafting where you need 3 ingredients, it does get to be a pain having to have all the bags open and ready to select when commencing.

And yeah, not stacking of items with different colours or other properties is still 'not easy'.
User avatar
Austin
Former Developer
Posts: 621
Joined: Wed Jan 25, 2006 2:30 am

Re: Craft System

Post by Austin »

The reason for selecting a material is that there are usually different types of the same material.
Iron ingot, copper ingot, etc.

The secondary materials will be automatically consumed by the craft core.
There will be an ability to make a subscript to override that though and consume in anyway endusers see fit.
Say you want to make the player target all the materials needed or any other possibility.

Im also going to make a config setting 'ToolIsMaterial'
My understanding is wool is used on a loom, rather than the loom on wool.
Wool with that flag could still have the craft use script bound to it - so it would become the tool and the material O_o
Yukiko
Distro Developer
Posts: 2825
Joined: Thu Feb 02, 2006 1:41 pm
Location: San Antonio, Texas
Contact:

Re: Craft System

Post by Yukiko »

Actually it's wool used on a spinning wheel, yarn used on a loom but yeah basically you got it.
*grins*

Maybe to overcome the need to click on many different "ingredients" when crafting, the script could do a check on the item targeted and if it's a container it would only use ingredients in that container. This would preclude the player knowing exactly what she or he needed to craft and placing only the right ingredients in that container for the type of items to craft, eg. ingots for weapons, wood for furniture etc. Naturally you'd ave to make sure you only had one type of each raw material in the container, iron or copper ingots but not both etc. I could imagine the system getting lost if there were all sorts of raw materials in the container and it trying to determine which menu to display.
*laughs*

*POL grumbling to itself*
Damn! Is she trying to bake a cake, create a suit of plate mail or make a table?!!??!
Yukiko
Distro Developer
Posts: 2825
Joined: Thu Feb 02, 2006 1:41 pm
Location: San Antonio, Texas
Contact:

Re: Craft System

Post by Yukiko »

Oh yes, one more thing. I'd hate to see the use of the old style slider gump in the crafting system. You've done such a great job with the newer GM gumps like the "go" system or the info/iteminfo that to go back to the slider would be a visual let down. That being said I am not the one having to write the scripts so I would understand not wanting to slug through the gump system since the slider is so much easier to set-up.
User avatar
Austin
Former Developer
Posts: 621
Joined: Wed Jan 25, 2006 2:30 am

Re: Craft System

Post by Austin »

I agree with the menu suggestion - but that can be done in a menu script.
My goal is to do this in baby steps. I want to make a baseline functional craft system, then add extensions where things can be hooked. The concept is similar to how the POL core does base things and has hooks.
Locked