HeroEngine Forums
Welcome, Guest. Please login or Register for HeroCloud Account.
Pages: 1 2 [3]

Author Topic: [Resolved] Inventory Stuff  (Read 8275 times)

mixxit

  • General Accounts
  • *
  • Posts: 25
    • View Profile
Re: Inventory Stuff
« Reply #30 on: Mar 07, 12, 09:48:06 PM »

One thing this tutorial tells me is that a lot of people actually do want to have the same sort of inventory system as other people rather than writing their own

Perhaps the community could work together to create a set of base systems that people want to use for their own games - for example I'm sure a lot of people want the same sort of Inventory and Item systems found in most MMOs but don't want the hassle of taking apart Hero's Journey

Apart from the benefits of learning how to do this by starting at it manually, I think that having a solid community made inventory would serve as a good tutorial in itself and save people reinventing the wheel - or leaving through frustration that they can't do something as simple as an inventory then how will they be able to write something more complex like a crafting system or combat
Logged

TheRabid

  • General Accounts
  • *
  • Posts: 41
    • View Profile
Re: Inventory Stuff
« Reply #31 on: Mar 07, 12, 10:59:26 PM »

I disagree sorry dude.

I have been following this rough outline for a while, and it forces you to understand the system and what it does and why it does it. Thanks to having to do it by myself, I have learned all about what a SpecOracle does, what a Spec is, what a decorator and helper is, and how to actually GLOM them unto a factoried object (I didn't even know what half these words meant 3-4 days ago.) I know it's hella frustrating, and I wish HSL was a little bit more documented, and it can get frustrating but persistence and going back and reading/reading/reading/reading/reading (did I mention reading?) pays off at the end when you learn a new skill within the language, that actually builds upon your foundation of being able to understand the structure and logic of HSL.

Just my 2c... if I have time next week I will record a full tutorial that will take some one through creating a specOracle and even as far as decorator/helper classes.

Logged

mixxit

  • General Accounts
  • *
  • Posts: 25
    • View Profile
Re: Inventory Stuff
« Reply #32 on: Mar 08, 12, 02:22:03 AM »

that would be really great if you could do that! thanks man :-)
Logged

EO-CaSpivey

  • General Accounts
  • *
  • Posts: 16
  • HSL Engineer
    • View Profile
    • Exile Online
Re: Inventory Stuff
« Reply #33 on: Mar 08, 12, 08:26:21 PM »

that would be really great if you could do that! thanks man :-)

Agreed! I have been tearing through whats in HJRef however I have not learned a whole lot, the systems are so complex the only thing I am having trouble understanding is the Spec Decorators I have a spec oracle system created, the other thing is the editors, specifically the HJNPC editor that has all the expanded options, I am pretty sure that is a custom coded UI but I have not found it yet.
Logged
HSL Engineer | Exile Gaming Studio
Website: www.exile-online.com
Follow Us: www.indiedb.com/games/exileonline

Trigger

  • General Accounts
  • *
  • Posts: 59
    • View Profile
Re: Inventory Stuff
« Reply #34 on: Mar 09, 12, 02:20:56 AM »

the other thing is the editors, specifically the HJNPC editor that has all the expanded options, I am pretty sure that is a custom coded UI but I have not found it yet.

I have just recently got all this up and running in my world (along with most the other pieces, inventory included), start a new post if you need any specific information, I donít want to de-rail the thread onto NPC's ;)

It is possible to pull out the Item, Item Visualization and Inventory systems without to much of a problem, all in all it probably took me around 2 months to get them up and running, and I would expert to spend another 1-2 weeks cleaning them up at some point...

I think the Inventory system has been re-done at some point, but there is effectively 2 Inventory systems, one is completely broken (the old legacy system) and the new one (HJInventory) that works, but if you have any specific questions then I will do my best to help :)

I hope to be able to give some information on what I have found during the port (once completed) in terms of whatís working, whatís broken and what to watch out for, but its going to be a little while longer until its complete  :)
Logged

Gothrek

  • General Accounts
  • *
  • Posts: 92
    • View Profile
Re: Inventory Stuff
« Reply #35 on: Mar 09, 12, 05:49:08 AM »

if u can do a tutorial maybe help a lot of people (me too).

i know that its a bit large but, there isn't and many develop need it...i think.

tks
Logged

XCalPro

  • General Accounts
  • *
  • Posts: 105
  • 3D Artist & HSL Coder
    • View Profile
    • Excalibur Productions
Re: Inventory Stuff
« Reply #36 on: Mar 09, 12, 06:51:00 AM »

It took me about three weeks to get the Item Oracle, Item Visualization along with all the Decorators, and Inventory system copied over. I managed to get the Inventory window to pop up and the Item Oracle works. The problem I am having is that nothing shows up in the inventory window, not even empty slots. No slots at all. I get an error saying something about the character not having a registered inventory, so I believe it has something to do with the inventory not being associated to this particular character.

My question to Trigger is, how much of the CCS and CSS did you have to copy over as well? Will I have to copy over the CCS and CSS in order to have the inventory associate with the character?
Logged
Tony Oliveira aka XCalPro
HeroEngine Projects: Traveller 6 Online - www.traveller6.com/forum/
Portfolio: www.xcalpro.com/art

Trigger

  • General Accounts
  • *
  • Posts: 59
    • View Profile
Re: Inventory Stuff
« Reply #37 on: Mar 09, 12, 08:27:20 AM »

I am still using the E_CCS and E_CSS, I am not planning on porting these as there is just so much complexity muddled up with old systems, it's not worth the time...

What I have done is moved these initialization parts into my own Dev script, so I will say for example; call Trigger_Development MakeMeAnInventory

That method does everything needed to setup an Inventory for the char, and could be plugged into any part of your own CCS, when I get home, I will post the code that I am using, if you have ported them directly then it should work for you.

From memory, I think I have hard coded the slot count to 15 just for getting it up and running, but again you can easily add some extra logic in there to set the slot count say depending on level...

3 hours and I will post the code!
Logged

Trigger

  • General Accounts
  • *
  • Posts: 59
    • View Profile
Re: Inventory Stuff
« Reply #38 on: Mar 09, 12, 12:05:50 PM »

Ok so here is how I have it set-up (for now), I have two scripts called Trigger_Development, one on the server, one on the client.

In the server script I have the flowing method (everything named VW was originally HJ)

Code: [Select]
untrusted function MakeMeAnInventory(acount as ID)
   
   var char = PlayerUtils:GetMyChar(acount)
   
   var inv = VWInventoryClassMethods:GetInventoryForCharacter(char)
   
   $CHAT.ChatPlayer(acount,"hsl_debug","Welcome'z " + char.GetName() + ", I created z Inventory with " + inv.GetBackpackSize() + " slots, k?")

.

The "GetInventoryForCharacter()" method will check for an associated "VWInventory", if it doesn't find one, it creates one using "VWInventoryClassMethods:CreateVWInventoryForCharacter(char)", if you look in that method you will see where it is creating the persisted node and setting the backpack size, and then adding an association to the player.

If that runs without errors, you should be able to open the inventory and have it display the amount of slots that you specified.

Although I have my method setup in a standalone script, you will want a method in your Character class, something like;

Code: [Select]
method GetMyInventory() as NodeRef of Class VWInventory
  return VWInventoryClassMethods:GetInventoryForCharacter(me)
.

How and when you call that is then up to you...

having just done a search through my code base, that is definitely the only initialization point inventory wise, just yell if you need to know anything else :)
Logged

XCalPro

  • General Accounts
  • *
  • Posts: 105
  • 3D Artist & HSL Coder
    • View Profile
    • Excalibur Productions
Re: Inventory Stuff
« Reply #39 on: Mar 09, 12, 02:00:06 PM »

I was able to locate the methods you mentioned. I believe my problems stems from the _character_class itself as I have not copied all the fields and parent classes as well. There seems to be a lot of unnecessary fields which I didn't want to copy. There is also an InventoryProcessor parent class which appears to be left over from the old Inventory system as well as additional fields added to the _PlayerCharacter base class instead of an HJ extension class. This is when I started to doubt the efficiency of this system.

I feel that I am close to getting this to work. I will continue to copy over more of the character_class methods in hopes that it will solve my errors. I hope to get this resolved by Monday.
Logged
Tony Oliveira aka XCalPro
HeroEngine Projects: Traveller 6 Online - www.traveller6.com/forum/
Portfolio: www.xcalpro.com/art

Trigger

  • General Accounts
  • *
  • Posts: 59
    • View Profile
Re: Inventory Stuff
« Reply #40 on: Mar 09, 12, 02:38:56 PM »

InventoryPossesor is for the old system just ignore it, on the server I have got (VW is HJ);

  Inventory
  InventoryContainer
  InventoryItemsContainer
  InventoryObject
  VWInventory

the client has;

  Inventory
  InventoryContainer
  InventoryEvent
  InventoryGUI
  InventoryGUISlot
  InventoryGUITabs
  InventoryIconContainer
  InventoryItemsContainer
  InventoryOracle
  VWCharaterInventorySlotCount
  VWCharacterInventoryWindow
  VWInventory
  VWInventoryGUI

Some of those could be related to the old system though, I haven't started tidying things up yet.

They only thing you should need on top is the GUI XML, just remove code for the systems you don't want and you should be ok
Logged

XCalPro

  • General Accounts
  • *
  • Posts: 105
  • 3D Artist & HSL Coder
    • View Profile
    • Excalibur Productions
Re: Inventory Stuff
« Reply #41 on: Mar 09, 12, 02:58:00 PM »

Thanks, that should narrow it down a bit.
Logged
Tony Oliveira aka XCalPro
HeroEngine Projects: Traveller 6 Online - www.traveller6.com/forum/
Portfolio: www.xcalpro.com/art

joshwebb84

  • General Accounts
  • *
  • Posts: 24
    • View Profile
Re: Inventory Stuff
« Reply #42 on: Mar 12, 12, 12:11:26 AM »

One resource that might be helpful to help you understand how an Inventory might be implemented in HeroEngine is the following wiki page which was written using HJ Reference as a guide:

http://hewiki.heroengine.com/wiki/Inventory_System_Tutorial

The Spec System (http://hewiki.heroengine.com/wiki/Spec_System_-_Basic_Usage) is ideally suited for the creation of item definitions and subsequent factorying of items. Additionally, items could be visualized on the client using Prop Buckets (http://hewiki.heroengine.com/wiki/Prop_buckets), and they could be stored in one of several ways (http://hewiki.heroengine.com/wiki/Data_storage_options) that would be linked to the character or account in question (via associations, for instance).

Hero's Journey is a good reference to understand the premise behind storing things on a character/account and replicating this information to the client, but it should not be assumed to be the optimal solution (as each game's design is different).

Well if the Game you are making is an traditional MMORPG the the HJref is a very good starting point. what I suggest is if people use the HJref as a starting point then once they have it ported then they need to edit it to fit their game.. thats what I done with a few of the HJref systems is ported them then adapted them to my needs.. also doing it this way is a good hands on approach to learning the HE scripting.. 
Logged
Pages: 1 2 [3]