violgamba Posted May 3 (edited) Is there a good way to have an inventory type that can be collected from other kinds of inventory? For instance, if I wanted different kinds of coins to all translate to a common currency, or different kinds book to all translate to "research". The result, in all cases, being a countable inventory type that can be pulled and used like normal inventory. I recognize that I could probably implement this as an integer variable to represent each collected inventory: currency, research, etc, but it might be some effort to get that to work nicely with the existing inventory system. EDIT: I should have mentioned: I'm working in ZScript, though I'm open to non ZScript solutions. Edited May 5 by violgamba 0 Quote Share this post Link to post
kalensar Posted May 4 Actually yes that is possible. Its a technique used in Doom FreeRoam where it uses the 'score" as a currency for in game shop locations to buy items and weapons. Thats the quickest direction I can point you to other than the ZDoom Wiki Strife Dialogue page as Strife kind of had its own shop system in it too. 0 Quote Share this post Link to post
violgamba Posted May 4 (edited) Oh wow, hi! I'm a big fan of Castlevania 3, by the way. It's a great example of fun gameplay with a different flavor to what you get with vanilla doom. I should have opened by mentioning that I'm working with ZScript, which I've now added to the OP. I'm inclined to have a generic Inventory that is collected (cash), then make a class "ProxyInventory" that differs only in that it adds a different class to your inventory than itself. Then I can subclass ProxyInventory with copper, silver and gold, each providing their own amount to "cash". Edited May 4 by violgamba 1 Quote Share this post Link to post
kalensar Posted May 4 (edited) Decorate or Zscript, the mechanics will be the same on the end working. You'll want your Inheritor class ,which looks like you defined already. You'll want a HUD number that can display the total "cash" of your items gathered together in bulk. Then the final part is the spending of your money which can done with a dialogue system with an NPC actor of some sort like vending machine or merchant. Doom FreeRoam does this whole cycle complete with shops, and so does Simons Destiny, but Simons Destiny doesnt have a merchant. So each treasure item just gives a score value to a final lump allocator as a bank account. It ends up being similar to ammo supply in the way it operates. Each cash item is a different bullet amount that gets added to the bank account as a token item inheritance. Easiest way is build it like an ammunition type. So something like: Actor Cash : ammo// or Custominventory but will just use ammo for simplicity { +INvbar Inventory.Amount 0 Inventory.MaxAmount 10000 Ammo.BackpackAmount 0 Ammo.BackpackMaxAmount 20000 Inventory.Icon "CashA0" } ///////////////////////////////// Actor CopperCoin : Cash { Inventory.Amount 10 Inventory.PickupMessage "Picked up 10 Cash" States { Spawn: COPP A -1 Stop } } Edited May 4 by kalensar 0 Quote Share this post Link to post
violgamba Posted May 4 Nice! It looks like ammo type is all about this functionality. Quote Only items that inherit directly from Ammo are separate types. All items that inherit from a subclass of Ammo define new pickup items for that ammo type. - ZDoom Wiki Thanks! 1 Quote Share this post Link to post
kalensar Posted May 4 Yup. One of the first things to know about building a GZD mod is that there can be multiple ways to accomplish a task. I personally love figuring out new techniques to use on various tasks. Good luck on your project and hit me up on any snags you might run across. 1 Quote Share this post Link to post
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.