Oh I was talking of coding in general. Many coders now share things, but still, many keep to themselves or just forget to put things in public.
Another reason is that not every part of code *can* be publically released and used. Code without proper documentation or not written to be reused by others will usually not be interesting to grab.
Anyway, seems like you have a good approach for this, so let's see where this goes ^^
Inventory system
Forum rules
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
Re: Inventory system
Hmm.Gau_Veldt wrote:I blame that on the ability to seal everything in an archive which results in many projects that do not give any code back to help others as well as the general culture of secrecy that surrounds graphic novel design.
I'm not sure there's really a "general culture of secrecy", to be honest - the people on this forum in particular are typically very eager to help people out with bits of code. There's a general culture of not-wanting-people-ripping-off-your-graphics and a general culture of not-wanting-people-cheating-their-way-through-your-VN-instead-of-enjoying-it-properly, but those are totally different things. Most projects don't do anything special with the engine, and thus they don't really have any code to 'give back' outside of their game script, which it's far more understandable to want to keep secret.
Even in the wide world of general programming, people frequently duplicate the functionality of existing libraries, whether those libraries are distributed binary-only and charged for or are distributed as source under a free license like the MIT or anything in between - and I believe the reason for this is usually not because there's a culture of secrecy around programming, but for two other reasons. Firstly, sometimes people find that an existing solution isn't quite right for them, that they'd prefer to write their own which does only what they want, exactly the way they want it, rather than shoe-horning someone else's version in and adding the missing features; secondly, a lot of programmers suffer from not-invented-here syndrome - which in a lot of contexts is far from a bad thing - where they will prefer to write their own version of something so that they understand it totally and can maintain it themselves rather than having to rely on some third party to fix any bugs they find. (The beardy open-source answer to this is always "if the code is open-source, then you can always find and fix the bugs yourself" - but this always makes me want to commit violence, because being "open source" doesn't magically make the code "easy to follow and understand", so it's still sometimes better to write your own version.)
Server error: user 'Jake' not found
Re: Inventory system
It does the basics but I need to add support for use/consume and named players. The example here does the basic give/check/remove:monele wrote:Oh I was talking of coding in general. Many coders now share things, but still, many keep to themselves or just forget to put things in public.
Another reason is that not every part of code *can* be publically released and used. Code without proper documentation or not written to be reused by others will usually not be interesting to grab.
Anyway, seems like you have a good approach for this, so let's see where this goes ^^
Code: Select all
init:
python:
e = Character('Eileen', color="#c8ffc8")
MasterList={
"food": {
"name": "Tasty Food",
"stacksize": 20,
"consumable": True
}
}
start:
python:
inv=InventorySystem(MasterList)
inv.SetMoneyName("quid")
rc1=inv.GiveToPlayer("food")
rc2=inv.RemoveFromPlayer("food")
rc3=inv.PlayerHasItem("food")
thing=repr(inv.inventories)+(" (add 1=%s rm 1=%s has 1=%s)" % (rc1,rc2,rc3))
e "%(thing)s"
I'll post this now then add the use/consume and named players while I'm house-and-cat-sitting.
- Attachments
-
- inventory.rpy
- Inventory System
- (12.58 KiB) Downloaded 155 times
Who is online
Users browsing this forum: No registered users