I wrote some tuts, was loud-mouthed about some of my module plans... and then dissapeared.
Well, in short, my thesis happened. Cant really put time in my module anymore, but I certainly havn't forgotten about it. But I have some ideas for it that other module writers might be interested in, so I'm posting some stuff here. That and to say that I am not dead yet.
It's sci-fi based, and one of its inspirations is Space Station 13. A nice, if primitive multi-player rogue-ish game. One big feature is its ability to assemble various components to create something new. Like a plasma tank to a timer and a igniter makes a bomb. Naturally I need to be able to do this.
First, there are 3 types of crafting I am considering. Actual crafting, like making a sword from metal, Improvement, like fitting a piece of armor or sharpening a sword, and assembly, which is simply putting together some components.
I'm starting with assembly, its simple and reversible. Crafting and Improving is a one-way process.
I havn't done much beyond deciding how it should look data side. I decided to put the recipes into the object file, instead of creating a new type of entity.
Code: Select all
newEntity{
define_as="LASER_GUN",
display="-", color=colors.RED,
craftable={
frame={type="frame", subtype="handgun"},
power={type="ammo", subtype="power_cell"},
barrel={type="barrel", subtype="laser"},
},
components={
frame=resolvers.object{"frame"},
power=resolvers.object{"power"},
barrel=resolvers.object{"barrel"},
}
dam=function(self)
return self.components.barrel.dam
end,
dam_type=function(self)
return self.components.barrel.dam_type
end,
accuracy=function(self)
return self.components.frame.accuracy*self.components.barrel.accuracy_mod
end,
}
Now, one limitation of this is that the recipes that can be parsed is determined by the zone. If you have a zone that no laser guns can spawn in, you cant craft a laser gun. I'm considering maybe spawning a dummy zone or object generator for crafting, will see how that goes. As this is I can spawn fully assembled weapons, all with spawned components without actually adding any custom code other than the special resolver.
On my TODO to actually create something useful from this is the actual parser to create a list of recipes from the loaded objects, do a canCraft check that sees if you have all the needed stuff in your inven, and finally a UI for the process.
Once that's all done I'll move on to crafting and improving, the latter perhaps by somehow applying egos to already created objects? Will see, but I'm trying to use as much of the existing engine classes I can. Will perhaps also need to add a requirements field as well, where certain stats or talents are needed to assemble or disassemble some objects.