Aller au contenu

Photo

Basic Custom Crafting System - Volunteer Located!


  • Veuillez vous connecter pour répondre
11 réponses à ce sujet

#1
indio

indio
  • Members
  • 204 messages
I need a system that follows this basic pattern:

1. Player acquires reagents (defined on a recipe)
2. Places reagents into container (preferably a bag stored in the player's inventory)
3. Player activates bag
4. Item is created

If it is possible, would someone script it for me? I know, it's a big ask. 

Is it even possible?

Many thanks.

Modifié par indio, 17 juin 2010 - 11:22 .


#2
TimelordDC

TimelordDC
  • Members
  • 923 messages
Crafting system is possible - Phaenan has released a module called Winter's Forge that does this. The easiest option would be to get the b2b files from here - http://social.biowar...ject/672/#files - and see how it is done.

You should be able to copy the basic logic and customize it for your own reagents/recipes/crafting method.

#3
indio

indio
  • Members
  • 204 messages
Thanks.



I had a look at Phaenan's work in-game and had a chat with him about it 6 months ago I suppose. It's great, and completely beyond my skill level. I'm just a level designer who likes tinkering with existing systems. His system is simply too complex for me.



I will take a look at the source files, but am still interested in a beginners system that is not dialogue based.

#4
Phaenan

Phaenan
  • Members
  • 315 messages
That's definetely possible and won't require dialogs or anything. Even the "bag in the inventory" can be done somehow, or at least it's possible to give that impression to the players.

As for my code, you're looking for the phae_forge_enchantskl script and its dependencies. It's prolly messy since it's not only used for crafting items, but my source is usually overly commented so you should find your way nonetheless. :o

#5
indio

indio
  • Members
  • 204 messages
Hi Phaenan.

I just looked at that script, and it is beautifully commented. In a fashion, I followed it. In another fashion it confirmed what I suspected about DA scripting and me; I'm blind without Lilac Soul. I don't want to seem unwilling to try...heck, I've spent years pouring over things in toolsets. I just realise that this is out of my reach.



I'd love some help putting this system together, or to help steer me through Phaenan's. Thanks for the help so far. Nice to see people willing to lend a hand.

#6
Phaenan

Phaenan
  • Members
  • 315 messages
Thing is, that code works but it's a rather poor study: it's not properly designed. To be more exact, it slowly evolved from my initial trials and errors, and there are unnecessary / obsolete stuff here and there. But for several reasons (retrocompatiblity, and me being a lazy sod) I never redesigned those parts. For instance, the vanilla crafting_recipes table is expanded while it'd much simpler to have a single stand-alone table. (because we " can't " use the vanilla crafting GUI anyway)

In the end, the main decision you'll have to take is : " How will the scripts recognize the recipe ?"
Meaning you have to decide whether you want the recipes to be guessed...
  • ... from the selection of ingredients placed in your container by the players
  • ... from a specific ingredient unique to each recipe. (e.g. my TWF scrolls)
  • ... from the skill/talent/spell used to trigger the script. (e.g. NwN2 : cast Barkskin and the script checks reags against the natural armor recipes)
Those two last methods are the easiest to code, while the first one (which I actually used at first) is harder to get right.

If you choose to use the second method, you can easily browse your container inventory for the recipe-specific item. If you decide on the last one, you can even more easily retrieve which talent/spell/skill was used from the ability structure in the triggered script. In both cases, those two tasks are not that hard (or long) and people here will be able to help through any issue once you're clear on what you wish to do. ^_^

I could provide a framework for custom crafting skills, tho. Never thought of that, but well, why not since it's mostly copy & paste for me. But I wouldn't be able to promise it'd be available soon, or even soonerish, and it's always more satisfying to do such things on your own. :o

Modifié par Phaenan, 15 juin 2010 - 04:41 .


#7
indio

indio
  • Members
  • 204 messages
How will the scripts recognize the recipe? Specific ingredients.



The premise of the system is this:

The player will acquire dropped or found goods.

Each good will have a set of recipes on it for which the good can be used.

Put the correct goods inside the bag, activate the bag, presto.



Thanks for the guidance.

#8
Phaenan

Phaenan
  • Members
  • 315 messages
Well, that was fun.
* drops her DACraftskill framework *
Despite what I said in my previous post, I didn't copy & paste TWF bits since TWF code is actually tailored for TWF needs (who would have guessed) and therefore wasn't really flexible. Well, it ain't flexible at all.
So I basically redesigned that stuff from scratch. Which is exactly why it was fun !
But which also means the code is highly untested. :unsure:

Modifié par Phaenan, 17 juin 2010 - 12:51 .


#9
indio

indio
  • Members
  • 204 messages
These jawdropping acts of generosity add such a richness to my modding life.



I'm about to take my son to rehearsal, so I can't test this at all, but I look forward to it tonight.



Many, many thanks.




#10
Phaenan

Phaenan
  • Members
  • 315 messages
Nah, don't mind me I was just indulging a passing fancy of mine. ^_^
Still, it'll nice if it could actually be of any use, so by all means be my guest.

#11
indio

indio
  • Members
  • 204 messages
I'm an hour into your work (following your truly wonderful documentation and screenshots) and I simply cannot proceed further until I say a few things.

It's very humbling to see the volume and quality of work you've done in such a short space of time. That I don't understand how you do your scripting is no surprise to me, but having read through your code remarks it's very clear that you're no ordinary coder. The sheer amount of code it requires is incredible. That your code remarks and forum posts are so self-effacing speaks of character that is most evident when others aren't watching...the best kind.
I'm just genuinely cheery about it. It's given me resolve to continue with my project.

It must be said also that you're a hard worker and thorough. Everything is carefully categorised and notated. I don't know what you do in real life but I hope they hold you in the same esteem I now hold you. I am in your debt and will glady assist with any level building task you would like help with.

It's next to impossible, for me at least, to come off without sounding cheesy in this medium, but I am most grateful to you.

Modifié par indio, 17 juin 2010 - 10:06 .


#12
CID-78

CID-78
  • Members
  • 1 124 messages
commenting is something that veries alot between coders. I like function descriptions but keep comments in the code to a minimum.



if you name your functions and variables right the code will be as plain text for a scripter and having alot of comment inside that is just making it harder to actually read the code. (rather then the comment)



some coders don't write a single line of comments or keep it seperate from the code, I tend to drag it slightly behind. because my code evolves and grow during development and some code is replaced five or six times before the final product. and documeneting all those earlier versions would have been a waste of time.



in average we are bad at it.