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

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

1st4ck

  • General Accounts
  • *
  • Posts: 2
    • View Profile
[Resolved] Inventory Stuff
« 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...





« Last Edit: Nov 02, 12, 08:35:35 PM by HE-Cooper »
Logged

RealityX

  • General Accounts
  • *
  • Posts: 15
    • View Profile
    • Vaporware Studios
Re: Inventory Stuff
« Reply #1 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
« Last Edit: Aug 02, 11, 10:42:47 PM by RealityX »
Logged

1st4ck

  • General Accounts
  • *
  • Posts: 2
    • View Profile
Re: Inventory Stuff
« Reply #2 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.

Logged

HE-JAY

  • HeroEngine
  • *****
  • Posts: 122
    • View Profile
Re: Inventory Stuff
« Reply #3 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).
Logged

Rissa2002

  • General Accounts
  • *
  • Posts: 43
    • View Profile
Re: Inventory Stuff
« Reply #4 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.
Logged

Rissa2002

  • General Accounts
  • *
  • Posts: 43
    • View Profile
Re: Inventory Stuff
« Reply #5 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 :>
Logged

Rissa2002

  • General Accounts
  • *
  • Posts: 43
    • View Profile
Re: Inventory Stuff
« Reply #6 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 :>
Logged

FI-ScottZ

  • General Accounts
  • *
  • Posts: 1407
    • View Profile
    • Forever Interactive, Inc.
Re: Inventory Stuff
« Reply #7 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.
Logged
Scott Zarnke
Lead Programmer, Visions of Zosimos
CTO, Forever Interactive, Inc.

FI-ScottZ

  • General Accounts
  • *
  • Posts: 1407
    • View Profile
    • Forever Interactive, Inc.
Re: Inventory Stuff
« Reply #8 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.
« Last Edit: Aug 17, 11, 04:17:01 PM by ScottZarnke »
Logged
Scott Zarnke
Lead Programmer, Visions of Zosimos
CTO, Forever Interactive, Inc.

Rissa2002

  • General Accounts
  • *
  • Posts: 43
    • View Profile
Re: Inventory Stuff
« Reply #9 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..
Logged

HE-JAY

  • HeroEngine
  • *****
  • Posts: 122
    • View Profile
Re: Inventory Stuff
« Reply #10 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:
« Last Edit: Aug 29, 11, 08:47:11 AM by HE-Jay »
Logged

Rissa2002

  • General Accounts
  • *
  • Posts: 43
    • View Profile
Re: Inventory Stuff
« Reply #11 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..
Logged

HE-JAY

  • HeroEngine
  • *****
  • Posts: 122
    • View Profile
Re: Inventory Stuff
« Reply #12 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.
Logged

Rissa2002

  • General Accounts
  • *
  • Posts: 43
    • View Profile
Re: Inventory Stuff
« Reply #13 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..

Logged

HE-CHRISTOPHER

  • HeroEngine
  • *****
  • Posts: 424
    • View Profile
Re: Inventory Stuff
« Reply #14 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).
Logged
Christopher Larsen
CTO
HeroEngine
Pages: [1] 2 3