Multiple Items combine to form new item?

Login to reply  Page: « < 1 of 1 > »
05 Jun 2010 - 06:432671
Multiple Items combine to form new item?
Any ideas on how one might get a trigger going that involves gathering up items, then combining them together to form a new item? Hopefully able to be disassembled into component parts? What I am trying to do is put together something that allows you to make unique weapons (guns, for example) out of component parts like cartridge, barrel, etc.

I may try to implement some code involving a "build" skill, but if I can do it via triggers, I think that would be the best option.


05 Jun 2010 - 10:592672
If you don't want to use scripts you can use this.
http://www.tbamud.com/forum/thread/456#1375


05 Jun 2010 - 21:192673
I see no easy way to do this with existing functionality (assedit, triggers).

What I'd suggest is adding a new item type, ITEM_COMPONENT, that will be used for modifying weapons etc. This will give you a lot of options for what effects the items will give.

Howeverm this is a major code change - be sure o make a good backup before starting.



__________________
You know who I am.
05 Jun 2010 - 21:502674
You can do it with triggers, but I think you'd find a hard coded solution to be easier in the long run. The problem with doing it through triggers is that each component needs to check if other compatible objects are in the user's inventory. By the time all is said and done, for something like a 5-piece component item, you've probably written like 100 lines of script for each item. Then to top it off, if there's a bug somewhere, you'd need to go through each item to fix the problem. All for 1 item.

I looked into assedit (an older circlemud patch), but never actually got it working. The idea behind it was really cool, as it was an OLC-style way of creating component objects based on skills the player had. This is one of those patches I wish somebody would update, as I'm sure many people would like it.


06 Jun 2010 - 05:312676
Quote Axanon:
The problem with doing it through triggers is that each component needs to check if other compatible objects are in the user's inventory.


You're severely over-complicating the process.

Only one component for each final object needs to have a script on it and it can be under 10 lines.

Slacker, describe how it should work from the player's perspective (ie. don't worry about how it should actually be written, and just describe what the player should type, and what the result should be etc.)


__________________
06 Jun 2010 - 19:362680
From a player POV:
Inventory: M16 Upper Receiver, M16 lower receiver, M16 Bolt Pin, M16 Magazine (30 rounds)

Player types: Assemble M16

(player) assembles an M16

Player Inventory becomes: M16 Rifle

Player command: Reload M16
(new magazine put in, old magazine comes out)

Player command: Disassemble M16
Inventory: M16 Upper Receiver, M16 lower receiver, M16 Bolt Pin, M16 Magazine (30 rounds)

That would be the basics. I tried the crafting patch but the run didn't work so I am going to attempt a hand patch. I know how complicated this is, but such is the work of building a great MUD. :)



Last edited by Slacker (06 Jun 2010 - 19:37)
Login to reply  Page: « < 1 of 1 > »