HeroEngine Forums

HeroEngine Support => Scripting & Programming => Topic started by: 1st4ck on Aug 02, 11, 06:25:58 PM

Title: [Resolved] Inventory Stuff
Post by: 1st4ck on Aug 02, 11, 06:25:58 PM
Hi, i am implementing a inventory system on mu heroEngine game.

This his going very slowly.

In the Tutorial its says CleanEngine don't have a inventory system because it can vary much from 1 game to another.

But i think that at leasy some tools should be ported, Like the Editing of items Visualization.
Select Icons for your items or other things.
this things don't impact any of the ideas of the developers.

And i took about 3 days to get a simple iconIdCell editor.
I can't even think how much i will take to get the items Visualization.

Aside from that, here is my current problem.

I need to know what ways can i use to store the items in a Character.
I know there is a Class E_playerCharacter that have much info about the Char.
There is a List of Abilities there, and i could do a list of items for the inventory, but i think this is not the correct place to put that.

Can someone point me to the right direction?

If someone is willing to help, i would like to make a Tutorial, or help making one, so that inserting a inventory system in the game don't be so dificult.
Some team can be giving up just because they can't make a simple inventory...





Title: Re: Inventory Stuff
Post by: RealityX on Aug 02, 11, 10:41:02 PM
What you could do is "barrow" the code from HJ for their inventory system. I believe the HE guys have said that while models and such cant be shipped with you game, that the scripts are free game so to speak.

check this thread about the code stuff:
http://community.heroengine.com/forums/index.php/topic,573.msg2352.html#msg2352 (http://community.heroengine.com/forums/index.php/topic,573.msg2352.html#msg2352)
Title: Re: Inventory Stuff
Post by: 1st4ck on Aug 03, 11, 04:13:52 AM
i had to copy, and arrange about 20 files, and classes and XML to make just the iconIdCell editor.

Now imagine the inventory??

should be about 100 files. Also because there is a lot stuff not needed. and copy all is not the best idea...

I need the minimum, and then upgrade from there.

We don't need to all have a copy of HJ reference. (also this game use like SVN to store items on server, so once you copy a file it will be there for lifetime, you can flag it as removed, but never delete)

Also with a copy you don't know whay is the arquiteture, and will need much time to understand.

A simple inventory, would need to be all made.

Title: Re: Inventory Stuff
Post by: HE-JAY on Aug 03, 11, 01:31:31 PM
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).
Title: Re: Inventory Stuff
Post by: Rissa2002 on Aug 07, 11, 12:59:02 PM
i like the spec system myself if you plan that way...
 i wont mind posting tips or tricks as i find em going thru it and wails and cries when i get stuck lol.
Title: Re: Inventory Stuff
Post by: Rissa2002 on Aug 12, 11, 03:04:58 PM
http://hewiki.heroengine.com/wiki/Creating_a_New_Spec_Oracle_%28Step_by_Step%29

up until step 13 i followed fairly well in setting this up but the following these directions for the utils side is confusing for the methods mostly because the wiki page your directed to shows slightly diff methods then the ones which are on the original step by step wiki if it tells which template to select when ya open script i missed it several times while looking, and the example name changes between the 2 so im not even sure which default methods need to be hooked to which classes i created following the directions.

i know more then one person does the wiki's or should in the future so maybe a general post of agreed apon example name useages should try to be set up ie mythingy on one page for a class and inventoryitem on another when being redirected can be very confusing for the new to HE folks.

also its not to clear if the specoracleutils you glom is a class you create for the client side or the server side

hope this helps others :>
Title: Re: Inventory Stuff
Post by: Rissa2002 on Aug 17, 11, 01:01:23 PM
i thought i had left a ? here as to the methods to use for the tutorial
:http://hewiki.heroengine.com/wiki/Creating_a_spec_oracle

can someone explain why the methods code is diff between the step 13 goto this page http://hewiki.heroengine.com/wiki/Spec_system#SpecOracleUtils_System_Node

then it tells you 13A B and C slightly differently?

and if these are needed for every oracle why are they not in the template of utilities?

also number 10 of the step by step says "10. Repeat steps 1 thru 6 above, creating client side copies of your spec and Spec Oracle classes. " does this also include the step3 optional if ya use that one the server side? it needs to be clear there since it says all the steps then specifies the spec and oracle class only not the instantation class and does it use the specderivedobjectclass method template for sure. and for both the server and if used for client also?

since this system can be very usefull for many things i wish to understand setting one up very clearly :) and be able to go over it with any others in future..

thanks for your patience :>
Title: Re: Inventory Stuff
Post by: FI-ScottZ on Aug 17, 11, 04:06:48 PM
Quote
can someone explain why... it tells you 13A B and C slightly differently?

I believe the Spec System page and the tutorial are actually showing the same thing, except the Spec System page uses "itemSpecOracle" instead of "YourThingSpecOracle" and it shows the whole method, whereas the tutorial steps 13 B and C are only showing the pertinent code.  You can see those tutorial parts listed in the Spec System page inside of the HE_GetAllSpecOracles and HE_GetSpecOracleByClass method listings.

The reason for not being in the template code is that you need to specify the name of your oracle, which obviously cannot be anticipated.
Title: Re: Inventory Stuff
Post by: FI-ScottZ on Aug 17, 11, 04:14:28 PM
Quote
does this also include the step3 optional if ya use that one the server side?

That's correct.  If you created the instantiation class on the server, create a class on the client named the same thing and also make that class have SpecDerivedObject as a parent.

Basically, the spec system works on both the server and client side (which are automatically synchronized with each other).  Therefore, all spec-related classes must exist on both sides (and the classes should have the same fields, as well).

It's true that it is a tricky system that takes time to wrap you head around, but once you get it set up and go beyond theory to actually using it and expanding it, it will make more sense.
Title: Re: Inventory Stuff
Post by: Rissa2002 on Aug 26, 11, 03:40:14 PM
anyone up for posting either here or a wiki on taking an spec oracle and tying it to the hot spot menu and gui so when  it does show on the utilities menu ya click and get a window? i am bout to start on my own but would like an example to check against or follow along if i dont understand it something..
currently the step by step for creating a spec oracle refers ya to generic gui making but not a concrete example of use this class to tie in the spec you created  btw i went to check HJ's xml to see how thats set up and it wont load anything  go figure lol..
Title: Re: Inventory Stuff
Post by: HE-JAY on Aug 29, 11, 08:45:37 AM
This is actually a simple matter.  There are other spec oracles already added to the utilities interface, and the only thing you need to do is copy the format presented and replace the name of the oracle with your own.

For example:
Quote
<_CollapsableCategoryItem name='YourGameSpecificSpecOracleClass' glomClass='_HotSpotItem' script='_SpecOracleUtilsClassMethods'>
  set name='text' attribute='text' value='{u}YourGameSpecificHumanReadableSpecOracleName{/}'/>
</_CollapsableCategoryItem>

It's as simple as that! The mouse click event will get forwarded to the _SpecOracleUtilsClassMethods script, which will load the spec selector for the oracle you named in the 'name' attribute.

References:
Title: Re: Inventory Stuff
Post by: Rissa2002 on Aug 30, 11, 03:06:56 PM
Thanks that worked great: question tho when i click my link it gives me the editor (Yay) but the columns are not the way it should be i get a speckey which is correct but the name and description are gone and what does show is a prototype which populates as inventoryitemspec1 and inventoryitemspec2 for the 2 items i added to see how it was working..

i do have displayname and displaydescription fields on my inventoryitemspec class but i musta missed sumthing?
when i click the fx oracle that comes with clean engine it shows the correct column names and info populated..
Title: Re: Inventory Stuff
Post by: HE-JAY on Aug 30, 11, 03:23:26 PM
Here you go (:

http://hewiki.heroengine.com/wiki/Creating_a_New_Spec_Oracle_(Step_by_Step)#Adding_Header_Fields_to_your_Spec_List

You can choose the name or description fields as an additional column.
Title: Re: Inventory Stuff
Post by: Rissa2002 on Aug 30, 11, 05:57:11 PM
yeah i didnt do that step as it doesnt specify where that script goes, ie spec class, oracle class, or utils class methods i did try to add it to spec class and got compile errors so didnt save it.. since the last thing that step by step was telling you to create the client side class methods and adjust things there..

i did load journey up yet again to search for that var oracle and did not find it in the itemspec class nor itemspecoracle server or client. if its just a blank script i tried that also client side and got compile errors on bout every line..

Title: Re: Inventory Stuff
Post by: HE-CHRISTOPHER on Aug 30, 11, 08:37:09 PM
The quickest and easiest way to execute that is in a developer "chat command".  It doesn't go in any of the class methods specifically.  Ultimately, I meant to make a right-click menu option in the spec list UI to add/remove headers but I have not as yet done that.

http://hewiki.heroengine.com/wiki/Making_Your_Own_Tools_Tutorial  (specifically making a command script)
http://hewiki.heroengine.com/wiki//REGISTER
http://hewiki.heroengine.com/wiki/Command_Handler

Optionally, a simple client script that remote calls a server script to execute that code would do the job.  I personally find its almost always useful to have a developer chat command (/cwiss for example) that allows me to quickly invoke arbitrary server script code (such as adding spec headers).
Title: Re: Inventory Stuff
Post by: TGSRofar on Aug 30, 11, 09:03:41 PM
That makes sense.  I never did figure out how to use the AddCollectionHeader method because I also was thinking that was supposed to be in a script somewhere and was clueless where it would go.  I never even considered it was something that can be executed from a command. But it makes perfect sense now.

So, I have been doing my headers completely different...the only way I could figure out how to do it.  I suppose I can do it the "correct" way now.

Just for reference, here is how I am currently doing it.  This is in the SpecOracleClassMethod.

Code: [Select]
method ListCollectionHeaders() as List of String
  //
  // Returns a list of header names for the Spec Selector Editor to display
  //
  headers as List of String
  if me.collectionHeaders.length = 0
    // use default of specKey and prototype Name
    add back "SpecKey" to headers
    add back "ItemType" to headers
    me.collectionHeaderMapFieldNameToDisplayName[ "itemtype" ] = "Type"
    add back "displayName" to headers
    me.collectionHeaderMapFieldNameToDisplayName[ "displayname" ] = "Name"
  else
    headers = me.collectionHeaders
   
    hasSpecKey as Boolean
    foreach h in me.collectionHeaders
      if tolower( h ) = "speckey"
        hasSpecKey = true
      .
    .
    if not hasSpecKey
      add front "SpecKey" to headers
    .
  .
  return headers
.
Title: Re: Inventory Stuff
Post by: TheRabid on Mar 04, 12, 05:39:07 PM
Hey sorry to bump such an old topic, but I have been following it closely to create a Spec Oracle (for inventory items.)
I have managed to get all the way to getting the Spec Oracle added to the Hot Spot menu and prompt an editor, but when I click the Add button, it just hangs on "Requesting New Spec." I was curious if anyone might know where I should start looking to root out the problem.

The error I get in the chat box is "The Pending spec was told it was ready but was unable to locate prototype."
Title: Re: Inventory Stuff
Post by: XCalPro on Mar 04, 12, 11:46:08 PM
Did you create a prototype for your Spec Oracle on the server?
Title: Re: Inventory Stuff
Post by: TheRabid on Mar 05, 12, 12:35:17 AM
Yes I did, and also it creates Spec prototypes, but just doesn't manifest the add dialog.

Code: [Select]
02:58:14: State:  [ORGANIZERMSG PORG PORG ADD ID="9223372055923832015" PARENT="0" NAME="InventoryItemSpec25" DESCRIPTION="Default"]   0 ms
02:58:16: State:  [GOTCHATMESSAGE [hsl_error] 4611686018427637930,6: [Clean Test] SCRIPT ERROR: In function ScriptError: The Pending spec was told it was ready but was unable to locate prototype.
03/05/2012 07:58:26 UTC
Call trace:
  Script PendingSpecPrototypeClassMethods line 70 me[9223372055923832013]
  Script PendingSpecPrototypeClassMethods line 93 me[9223372055923832013]
starting method/function PENDINGSPECPROTOTYPETIMER_TICK
starting me[id=9223372055923832013 class=PendingSpecPrototype]]   0 ms
02:58:16: State:  [SERVERSCRIPTERROR 4611686018427637930,6: [Clean Test] SCRIPT ERROR: In function ScriptError: The Pending spec was told it was ready but was unable to locate prototype.
03/05/2012 07:58:26 UTC
Call trace:
  Script PendingSpecPrototypeClassMethods line 70 me[9223372055923832013]
  Script PendingSpecPrototypeClassMethods line 93 me[9223372055923832013]
starting method/function PENDINGSPECPROTOTYPETIMER_TICK
starting me[id=9223372055923832013 class=PendingSpecPrototype]]   0 ms
02:58:21: State:  [HSE2 SERVER_DECL PROTOS
Title: Re: Inventory Stuff
Post by: TheRabid on Mar 05, 12, 05:08:33 PM
I have been trouble shooting all morning.

Checked all of my classes to make sure they had the proper scripts, I feel like I am missing something though.

Title: Re: Inventory Stuff
Post by: mixxit on Mar 05, 12, 05:42:06 PM
yeah i didnt do that step as it doesnt specify where that script goes, ie spec class, oracle class, or utils class methods i did try to add it to spec class and got compile errors so didnt save it.. since the last thing that step by step was telling you to create the client side class methods and adjust things there..

i did load journey up yet again to search for that var oracle and did not find it in the itemspec class nor itemspecoracle server or client. if its just a blank script i tried that also client side and got compile errors on bout every line..

I had this same problem as the guide had no destination for the information to go to

Having someone execute a command to update it also seems a bit clunky, shouldn't there be a place this goes so the column headers are always shown correctly?
Title: Re: Inventory Stuff
Post by: mixxit on Mar 05, 12, 05:56:09 PM
That makes sense.  I never did figure out how to use the AddCollectionHeader method because I also was thinking that was supposed to be in a script somewhere and was clueless where it would go.  I never even considered it was something that can be executed from a command. But it makes perfect sense now.

So, I have been doing my headers completely different...the only way I could figure out how to do it.  I suppose I can do it the "correct" way now.

Just for reference, here is how I am currently doing it.  This is in the SpecOracleClassMethod.

Code: [Select]
method ListCollectionHeaders() as List of String
  //
  // Returns a list of header names for the Spec Selector Editor to display
  //
  headers as List of String
  if me.collectionHeaders.length = 0
    // use default of specKey and prototype Name
    add back "SpecKey" to headers
    add back "ItemType" to headers
    me.collectionHeaderMapFieldNameToDisplayName[ "itemtype" ] = "Type"
    add back "displayName" to headers
    me.collectionHeaderMapFieldNameToDisplayName[ "displayname" ] = "Name"
  else
    headers = me.collectionHeaders
   
    hasSpecKey as Boolean
    foreach h in me.collectionHeaders
      if tolower( h ) = "speckey"
        hasSpecKey = true
      .
    .
    if not hasSpecKey
      add front "SpecKey" to headers
    .
  .
  return headers
.

This doesn't seem to change my headers when I add this
Title: Re: Inventory Stuff
Post by: JoshHalls on Mar 05, 12, 06:29:39 PM
Restart the client and then check to see if the prototype is there, have had to restart sometimes and reenter the prototype and make sure you are putting it in the right location (server).

--josh
Title: Re: Inventory Stuff
Post by: TheRabid on Mar 05, 12, 06:41:01 PM
I just started from scratch and was able to not run in to this problem again on the second go around.

I am glad I started from scratch, as it helped me understand the Spec system and what all those classes do a lot better.
Title: Re: Inventory Stuff
Post by: mixxit on Mar 05, 12, 08:00:10 PM
Restart the client and then check to see if the prototype is there, have had to restart sometimes and reenter the prototype and make sure you are putting it in the right location (server).

--josh

That was it! I was putting the header code in the client side


Also then got the issue mentioned above about it stuck 'Loading...', appeared I didn't have itemType so i removed these two line and it's now showing displayName correctly

    add back "ItemType" to headers
    me.collectionHeaderMapFieldNameToDisplayName[ "itemtype" ] = "Type"

Yay!
Title: Re: Inventory Stuff
Post by: TheRabid on Mar 05, 12, 08:10:15 PM
I added this to my Developer Class Method script

So when I run "/Developer addheader" it adds the header I want (this was one of the first tuts that taught you how to make a /command.)

Code: [Select]
to "addheader"
     var oracle = GetPrototype("ItemSpecOracle")
     where oracle is kindof ItemSpecOracle
     oracle.AddCollectionHeader("Field Name","Field Description",true)
    .   
  .

Title: Re: Inventory Stuff
Post by: Jrome90 on Mar 05, 12, 10:07:38 PM
To add/change specoracle headers you can use this (https://community.heroengine.com/forums/index.php/topic,1180.0.html) ;)
Title: Re: Inventory Stuff
Post by: JoshHalls on Mar 05, 12, 10:14:57 PM
To add/change specoracle headers you can use this (https://community.heroengine.com/forums/index.php/topic,1180.0.html) ;)

Definitely go with that.  We have a command to do it, but it pretty much does the same thing.
Title: Re: Inventory Stuff
Post by: XCalPro on Mar 06, 12, 07:38:58 AM
I attempted to port over the inventory system used in HJ Ref world a few weeks ago and realized its a major project as there are dozens of class scripts and fields as well as dozens of GUIXMLs to copy over. After about two weeks, I managed to get the inventory window to appear as it should only to realize that in order to assign the inventory to a character, I would also have to port over the CCS and CSS as well. In addition, the inventory system is also tied into many of the other systems like Quest, NPC, and Item Visualization.

I would not recommend trying to port over the inventory system from HJ, but rather build your own from scratch as I have learned the hard way. Starting with a simple inventory and build up from there. One key element that will make creating an inventory system easier will be the addition of the Item System which is not yet available: http://hewiki.heroengine.com/wiki/Item_System
Title: Re: Inventory Stuff
Post by: TamGarTrinKi on Mar 07, 12, 08:50:08 PM
Ah, I see other people have had the "Where does this tutorial's code go?" problem also.

For the moment I refer to this (http://wiki.heroengine.com/wiki/Spec_system#SpecOracleUtils_System_Node), the Spec Oracle section that was itselfed linked from the step by step guide .

The problem arising from the "Implement a Clientside  Singleton Getter" which, if added to the _SpecOracleUtilsClassMethods (which is what it mentions just before the code, regardless of the script editor suggesting you do not change that file) it throws a bunch of warnings when compiled (only some to do with the strictness of the distribution package of the code added).
This pales in comparison to the "Add your oracle to the (Clientside) HE_GetSpecOracleByClass" part which shows a function that does not exist in the listed file.

BUT...

Is this code actually meant to go in a newly made MYNEWSHINYORACLE_SpecOracleUtilsClassMethods?, because neither page manages to say this is the case. And so far it is throwing far less warnings my way.
Title: Re: Inventory Stuff
Post by: mixxit 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
Title: Re: Inventory Stuff
Post by: TheRabid 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.

Title: Re: Inventory Stuff
Post by: mixxit on Mar 08, 12, 02:22:03 AM
that would be really great if you could do that! thanks man :-)
Title: Re: Inventory Stuff
Post by: EO-CaSpivey 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.
Title: Re: Inventory Stuff
Post by: Trigger 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  :)
Title: Re: Inventory Stuff
Post by: Gothrek 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
Title: Re: Inventory Stuff
Post by: XCalPro 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?
Title: Re: Inventory Stuff
Post by: Trigger 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!
Title: Re: Inventory Stuff
Post by: Trigger 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 :)
Title: Re: Inventory Stuff
Post by: XCalPro 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.
Title: Re: Inventory Stuff
Post by: Trigger 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
Title: Re: Inventory Stuff
Post by: XCalPro on Mar 09, 12, 02:58:00 PM
Thanks, that should narrow it down a bit.
Title: Re: Inventory Stuff
Post by: joshwebb84 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..