The Daily Click ::. Forums ::. Klik Coding Help ::. Inventory, Text and Active Objects.
 

Post Reply  Post Oekaki 
 

Posted By Message

Devernath



Registered
  04/12/2004
Points
  54

VIP Member
3rd May, 2009 at 05:10:50 -

So, while working on my game, I realized that if I opened up an inventory (active object, white display) I couldn't put any text on it, since Active Objects naturally cover them.

The inventory is text-based. Items are typed out and have a numeral beside it (Potion x3). But i dont want a numeral displayed if theres only 1 of an item, and i dont want the item displayed at all if theres 0 of them. I also want the display to be smaller than the total possible number of items, so that you would need to scroll down (with a keyboard cursor, not a scroll bar).

So how could I achieve all this? I'm using TGF 1, btw.

Thanks for your help in advance

 
n/a

UrbanMonk

BRING BACK MITCH

Registered
  07/07/2008
Points
  49566

Has Donated, Thank You!Little Pirate!ARGH SignKliktober Special Award TagPicture Me This Round 33 Winner!The Outlaw!VIP MemberHasslevania 2!I am an April FoolKitty
Picture Me This Round 32 Winner!Picture Me This Round 42 Winner!Picture Me This Round 44 Winner!Picture Me This Round 53 Winner!
3rd May, 2009 at 14:29:36 -

First to make the text on top of the inventory active go to the string object settings and uncheck "display as a background"

Then you will need to use fast loops to loop though your object list, either stored inside of an array or an ini

Like so:
Always-
-Destroy String
-Start loop "Get Inventory" (Number of Items) times

On loop Get Inventory-
If Item (Loop Index "Get Inventory") >1 -
-Create String
-Set String to Item (Loop Index "Get Inventory")
-Position String ... BLah Blah Blah

Anyway, you get the point,
I'm sure someone with tgf can make you an example

 
n/a

Devernath



Registered
  04/12/2004
Points
  54

VIP Member
3rd May, 2009 at 20:47:12 -

Yeah, that would help, since i dont know what a fastloop or an array is...I don't see those objects in my thing.

That sounded like japanese to me O.O

Also, is there any way to make this display scroll? The edit object can be used for this, but you have to use the mouse, and i want a keyboard controlled scrollbar.

Thanks.

Edited by Devernath

 
n/a

UrbanMonk

BRING BACK MITCH

Registered
  07/07/2008
Points
  49566

Has Donated, Thank You!Little Pirate!ARGH SignKliktober Special Award TagPicture Me This Round 33 Winner!The Outlaw!VIP MemberHasslevania 2!I am an April FoolKitty
Picture Me This Round 32 Winner!Picture Me This Round 42 Winner!Picture Me This Round 44 Winner!Picture Me This Round 53 Winner!
4th May, 2009 at 04:29:06 -

hmm, everything you ask for is possible, and I could possibly put together an example for you.

After final exams this week, I'll download tgf 1 and try and put something together for you.

In the mean time you aught to look up ini tutorials, which btw are also a method of saving game data, so that the player can load up their game again later!

 
n/a

Devernath



Registered
  04/12/2004
Points
  54

VIP Member
4th May, 2009 at 20:05:00 -

Sounds good tyvm

 
n/a
   

Post Reply



 



Advertisement

Worth A Click