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...
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
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?
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).
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.
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)
@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
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.
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].