RunUO Community

This is a sample guest message. Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!

Filled commodity deeds as a crafting resource?

Alcsaar

Sorceror
So I'm working on a system akin to masonry/glassblowing that allows players to craft houses using raw materials.

Originally I had intended for them to create "sections" of the house first, and then the final craft would require all of those "parts". However, I've come to realize that its going to be a huge hassle since, for example, a small house will require the folllowing materials:

12000 Boards and 1600 ingots

Even if I made a small house require 12 "sections" of the house to craft, that's still 1000 boards per craft, and players can't carry that many boards... Going any lower than that would be very annoying.

So I'm wondering if its somehow possible for me to make the resource cost for a house section a "commodity deed filled with 3000 boards"

Or some other work around is fine, so long as it doesn't make them craft a million pieces. For example, removing the logs/boards from their bank?
 

pooka01

Sorceror
On the place where the house is going to be, create a new item that inherit from container, then only allow the owner of the future house to open it and drop stuff, (making max weight VERY high, or just no weight at all), then drop ressources in that.
Would that be a good working around?
 

Alcsaar

Sorceror
It might be except that isn't really the direction im going with my system. My system won't require a place to put the house first, it just allows the player to craft a house deed the same as from an architect, except it wont be sell able to npc vendors.


I think what I may do is make a new item which on double click allows the player to select a stack of logs, once it checks its the right amount it removes the logs and converts the item into a new item which is used in the crafting. This allows bypassing dragging 300 or w/e boards at a time into inventory to craft an item. But if there is an easier way I'd like to find out about it now before I go to deep with this.
 

pooka01

Sorceror
Ah i see.

Hard way:
Code:
public class RessourceChecker
{
 private Mobile m_Crafter;
 private int m_WoodAmount;
 private int m_RockAmount;
 private int m_MetalAmount;
 
 private int m_WoodAmountReq;
 private int m_RockAmountReq;
 private int m_MetalAmountReq;
 
 public RessourceStoring(Mobile c, int wa, int ra, int ma, int war, int raq, int maq)
 {
   m_Crafter = c;
 
  m_WoodAmount = wa;
  m_RockAmount = ra;
  m_MetalAmount = ma;
 
  m_WoodAmountReq = waq;
  m_RockAmountReq = raq;
  m_MetalAmountReq = maq;
 
  CheckRessources();
 }
 
 public void CheckRessources()
 {
   //add some checks if alive or not.
   //check if backpack is missing
   Item item = null;
   //search the pack for the deeds and put them in an item array named "deeds"
   for (int i = 0; i < deeds.Length; ++i)
   {
     item = deeds[i].Commodity;
     if (item != null && !item.Deleted && item.Amount > 0)
     {
       if (item is Board || item is Log)
       {
        if(m_WoodAmount + item.Amount < m_WoodAmountReq)
        m_WoodAmount += item.Amount;
        else
        item.Amount -= m_WoodAmountReq - item.Amount;
       //then add the other ressources below here.
 
       //then at the end of the file maybe checking if everything is filled.
     }
   }
    if (m_WoodAmount >= m_WoodAmountReq)
  }
}

Simple way:
in the crafting menu you can add special material, ex:

if( Core.SE )
{
index = AddCraft( typeof( Tessen ), 1011084, 1030222, 85.0, 135.0, typeof( IronIngot ), 1044036, 16, 1044037 );
AddSkill( index, SkillName.Tailoring, 50.0, 55.0 );
AddRes( index, typeof( Cloth ), 1044286, 10, 1044287 );
SetNeededExpansion( index, Expansion.SE );
}

not sure if messing with "typeof" would work, i saw on a server some gloves requiring a special ressource, but for the deeds, you could go in the bases of the craft menu thing where lies the AddRes() method, and creating your own to check for the ressource contained, such as: AddRes(index, new CommodityDeed(item, amount if i'm right), num, num, num), then you could check the required stuffs, i'll try to see tomorrow if i can get something.
 

Alcsaar

Sorceror
AddRes(index, new CommodityDeed(item, amount if i'm right), num, num, num) Would this work? Thats def the easy way to do it if it does.

Edit* Yea, that would have been to easy, doesn't work at least not in that syntax.
 

pooka01

Sorceror
No, what i was referring to is to create a new AddRes method in the craft engines, so you can add like,

public enum CommodityDeedRessource
{
log, board, ironingots, kindlins, whatever
}

then, adding a new AddRes method like:
public void AddRes(...stuff, stuff, CommodityDeedRessource cdr, int amount, stuff...)

then you search for typeof() for commodity deeds, and you get the item contained, if cdr is CommodityDeedRessource.board, it will only take the board one, etc...
 

Alcsaar

Sorceror
Ah I see okay thanks. It would take me some time to work that out. I'll give it some thought and then decide what I think would be the easiest method.
I'm trying to make this script mostly self-contained, so im looking to do as few modifications to existing scripts as possible, which means I may go the route of creating my own new item to add boards to.
 

pooka01

Sorceror
Yea, probably a good idea, you could even just add the item on the crafting, and with that item, you put stuffs in it, and once all is reached double click and get a deed, could be a bit faster, and you could move the thing anywhere.
and too, should consider checking the carpentry skill of the final step of building the house deed out of the created-and-filled item.
 
Top