The Daily Click ::. Forums ::. Klik Coding Help ::. Making a large inventory in TGF (100+ items)
 

Post Reply  Post Oekaki 
 

Posted By Message

Mr Fwibbles



Registered
  12/08/2006
Points
  8
18th August, 2006 at 07:39:00 -

Thanks for the input, everyone. I'll start with Skydragon's way, and if that doesn't work for me, I'll give the other ideas a try.

 
n/a

Joe.H

Evil Faker

Registered
  19/08/2002
Points
  3305
18th August, 2006 at 07:52:25 -

if you have a legal version of TGF, i suggest getting a discount on TGF2 or MMF2, as TGF is severley outdated and is very limited

 
My signature is never too big!!!

AndyUK

Mascot Maniac

Registered
  01/08/2002
Points
  14586

Game of the Week WinnerSecond GOTW AwardHas Donated, Thank You!VIP Member
18th August, 2006 at 08:42:29 -

The list object could help you somewhat.

 
.

Mr Fwibbles



Registered
  12/08/2006
Points
  8
18th August, 2006 at 17:29:41 -

Skydragon, where abouts in the code do I tell it to change the animation for items with an ID number of over 31? I tried retrieving the value of the direction with a counter, then saying "if counter is greater than 31, then display animation 32-63" but that didn't work... everything else works perfectly though!

 
n/a

Deleted User
18th August, 2006 at 19:18:22 -

Hmm, glad it works.
To solve that,, try making the item get the direction to an alterable value first, then change direction into the value, and also change animation if the value is greater than 32?
Im too damn tired to explain it better Sorry...

 

Werbad



Registered
  18/09/2002
Points
  235
19th August, 2006 at 06:59:39 -

Translation into TGF code:
* ItemN >= 1
+ ItemN < 32
- Active1 set direction to ItemN
- Active1 make visible
- Active2 make invisible
- Active3 make invisible
- Active4 make invisible

* ItemN >= 32
+ ItemN < 64
- Active2 set direction to ItemN - 32
- Active1 make invisible
- Active2 make visible
- Active3 make invisible
- Active4 make invisible

Using different animations is recommended since it uses only 1 object/itemslot

 
n/a

Mr Fwibbles



Registered
  12/08/2006
Points
  8
19th August, 2006 at 10:01:45 -

Eee, I've just about done it (I just set alterable value B to the value of the INI at the same time it retrieves the direction). Just one small issue right now - instead of displaying item #31 as 31, it's showing direction 0 of animation 2 (or "direction 32"). Not entirely sure why, but I'll keep playing around with it and see if I can fix that.

Edit: I have to change the animation to CustomAnim1 if alterable value B >= 33? That doesn't make sense... the directions are 0 to 31... what happened to direction 32? Oh well, at least it's working now. It only took me... ALL DAY ;_;

Edit 2: The last object is sticking on "cherry" (item 16) instead of "pineapple chunks" (item 48 ). All of the other animation changes work fine though. Could this be to do with the number of loops or something?

Image Edited by the Author.

 
n/a

Mr Fwibbles



Registered
  12/08/2006
Points
  8
19th August, 2006 at 15:26:54 -

OK, changing the animations was working briefly, but now it's gone totally haywire and it's changing the animation RANDOMLY. Seriously. I've noticed that it's displaying the wrong items, but if the item is wrong it's always 32 items in front or behind the number it should be - hopefully meaning the animation is just wrong. But WHY? It was working before and I didn't change anything! *Grumbles*

(Oh yeah, and I double posted because I got sick of editing the previous post)


Edit: It works fine (apart from the last slot) if I manually alter the item numbers in the INI, but if I let the game set the item numbers, it messes everything up (only changes the animation for some, not others).

Image Edited by the Author.

 
n/a

Deleted User
19th August, 2006 at 16:43:23 -

Ahh, sorry, i dont have time to help you.
Hope you solve it somehow, just try looking through the events after mistakes in the code.

 

steve



Registered
  13/09/2002
Points
  200

VIP Member
22nd August, 2006 at 11:13:31 -

Does TGF have Active Picture object? I can't remember... anyway that would help you to not have so many active objects (as you would read in each item picture as an external)

 
n/a

Joe.H

Evil Faker

Registered
  19/08/2002
Points
  3305
22nd August, 2006 at 11:53:22 -

it has picture object, on the multimedia bit, which can load external files

 
My signature is never too big!!!

Mr Fwibbles



Registered
  12/08/2006
Points
  8
22nd August, 2006 at 15:19:58 -

@JonWoG: Thanks for the offer. I'm just going to finish off a few other things in this same "level" (frame) first, and then I can send it to you. Might be a couple of days yet.

 
n/a

DaVince

This fool just HAD to have a custom rating

Registered
  04/09/2004
Points
  7998

Game of the Week WinnerClickzine StaffHas Donated, Thank You!Cardboard BoxDos Rules!
22nd August, 2006 at 15:39:16 -

Don't use directions, use frames! And set the frame speed to 0.

Then, in the event editor, set the frame number to the item number when loading an item.

 
Old member (~2004-2007).

Alice Pierce



Registered
  08/01/2006
Points
  6
23rd August, 2006 at 14:03:36 -

Small tip about "inventory":
You can save many values in one.
If you want to save 5 values [value1,value2,value3,value4,value5] in one [called ValueZ, or if you want - global value 1 etc.], and every value can keep integer between zero and Q, save using this equation:
ValueZ=1*value1 + Q*value2 + (Q^2)*value3 + (Q^3)*value4 + (Q^4)*value5.
To load values, use this equation:
value1 = (ValueZ) /1) mod Q
value2 = ((ValueZ) /Q) mod Q
value3 = ((ValueZ) /(Q^2) ) mod Q
value4 = ((ValueZ) /(Q^3) ) mod Q
value5 = ((ValueZ) /(Q^4) ) mod Q
I recommend to save inventory in Dynamic Array 2 [easy to add and remove item from inventory].

 
;]
   

Post Reply



 



Advertisement

Worth A Click