Need pointers for a few things... Inventory, etc.

For questions about using Classic.

Post » Sun Apr 19, 2009 11:08 am

Remember that long-winded topic I made about what kind of menu I wanted to make? No? Well, I had to make one by myself anyway. I'm wondering how anyone else would've done it. Is the way I've tackled it okay?

Furthermore, I'm wondering if anyone can explain why my animation sometimes glitches up. I have no idea why sometimes while jumping, the character will revert to walking animation, and sometimes, while messing around, there can be standing animation while walking. And the frames seem glitchy in the first place, like it's not really playing smoothly. I have no idea.

About that menu, before I try tackling "Items" and "Abilities"... if you try the .cap, you'll see how I have all the menu selection done via variables and using text as the physical placeholders. I'm going to use text for the exact same thing for "Items", and have a certain number of preset places for that. Like, for example, two seperate strings of blank text, representing two item slots that are empty.

But I have no idea how to get the game to remember a certain order of items acquired. Let's say for example, I DID have two blank strings of text as physical placeholders for items... and the player picks up "Potion"... How can I have it so that the FIRST text placeholder says "Potion", while having the SECOND placeholder text say "Antidote" or something if "Antidode" is picked up afterwards? Or vice versa, depending on item acquisition? How can I have the game not only display the text placeholders properly, but also FUNCTION properly? I'm guessing using Global Variables in some tricky manner or something... (As a side note, can item re-arranging be possible? Like, say if the player wishes to organize the items, or have them auto-organized? Probably getting even more complicated going that route...)

That's all I had to ask really. "Why are my animations screwing up?" "How can I go about adding a typical RPG-ish item menu?" and "How would you have done this sort of menu, or is it okay as is?"

P.S. I just thought... What if you have a Global Variable for "Potion", whose default variable is 0... and an "Item" Global Variable whose default variable is 0... Player picks up "Potion" item... "Potion" Global Variable is added by 1... to represent how many... and "Item" Global Variable is added by 1... Telling the game... "Make the Item 1 slot text say 'Potion'." But then, you'd have to specify to the game... "If 'Potion' greater than 1, AND 'Item' equal 1... Make the Item 1 slot text say 'Potion'." and so on for all the other items and quainities thereof...

http://www.megaupload.com/?d=NJYSLAGT

Z = run/cancel, X = jump/confirm. Very NES-ish by design.

Warning: Trying to change to Full Screen or Window will make it crash, since apparently, so far, Construct cannot allow for resolution changes with Modal Layouts.

Also, upon further testing for customization, wanting the ability to change the window and border color seperately, you can change the color of the menu with Q. W, E, A, S, and D keys, With QWE raising the RGB values, and ASD lowering the RGB values.



EDIT: Oh gosh damnit, right after making this post, I go browsing at my leisure, and almost immediately find this: viewtopic.php?f=8&t=2920
That movement with the scrolling and objects is EXACTLY the kind of thing I was going for with the cursor movement and menu selection pop-up in my .cap right there. I wonder if I should try re-wiring the thole thing so that the text and cursor move with sin movement or something... It'd likely be over my head or something though... And maybe unessecary, but I dunno. I'll wait and see what others might have to suggest.
B
4
S
2
G
4
Posts: 164
Reputation: 1,878

Post » Sun Apr 19, 2009 1:43 pm

hi kisai,
that's a rather big and complex cap file; i'm afraid most people won't have the time to read & understand it all the way. it is a lot easier to tackle problems when they are 'on their own'. do you think it would be possible to do that?

whenever i try to build something new (e.g. a menu system), i first try to make my idea work in a fresh cap. that way, all the bugs i encounter are those of my system, and i don't have to worry about strange interferences from other parts. it also helps to find construct bugs/twists that prevent it from working the way i imagined it; these are sometimes very hard to find & can drive you to frustration. if you get stuck that way, it is also more likely that other people can spot the errors when the cap is small. so it's always a good idea to start clean, in a scope that you can grasp completely, and hunt down all the bugs before trying to implement it into an existing system.

i don't know why your animation glitches or how your menu & item system works; but i think that the item system you describe could be more easily done using the hash table object instead of any global or private variables. you could just add any collected item name as a key, and, in case the item type is already in the inventory, add to the existing key's value. that would make for a more flexible system, since you can add/remove keys from the hash table during runtime and don't have to worry about adding variables etc. for every object you would like to have in your game.
B
2
S
2
G
4
Posts: 171
Reputation: 1,792

Post » Sun Apr 19, 2009 2:08 pm

That's much problems at once ;). I can provide some advise about "order of taken items". IMO ListBox Object would do just fine, since it allows adding, insertion and deleting items in every place. So even rearranging their positions would be easy.
B
6
S
3
G
6
Posts: 219
Reputation: 3,013

Post » Mon Apr 20, 2009 7:21 pm

I guess you can't edit your post more than once... And thanks for the suggestions, but neither of those are capable of doing what I had in mind. Using Global Variables, I DID end up figuring out a way to get the inventory system working EXACTLY the way I intended. ^_^ Check it out! I'm quite imrpessed someone like myself was able to get something like THIS working at all. The items are shoved into the ivnentory in the order of acquisition, and if you use up all of an item, that slot becomes empty and can be filled by that same item again, or an item of a different type. ^^ All as planned.

http://www.megaupload.com/?d=K200BCR6
B
4
S
2
G
4
Posts: 164
Reputation: 1,878

Post » Tue Apr 21, 2009 6:06 pm

That's pretty nifty! Although changing the color of the player doesn't work.
Apart from that it looks like it could be fu-DAMN TURRETS.

Also I noticed you've got 6 frames for your jumping and falling animation, did you run into any problems when doing that?
Mine decides to only show frame 1 or 2 (depending on how it's feeling) of both animations, unless I use the set frame command, then it just displays the first.

Edit: Last thing, you ever considered using box.net? Doesn't have those annoying wait times and it has a good interface so you can update files easily.
B
2
G
3
Posts: 40
Reputation: 930

Post » Tue Apr 21, 2009 11:11 pm

[quote="Lemming":2a9e4829]That's pretty nifty! Although changing the color of the player doesn't work.
Apart from that it looks like it could be fu-DAMN TURRETS.

Also I noticed you've got 6 frames for your jumping and falling animation, did you run into any problems when doing that?
Mine decides to only show frame 1 or 2 (depending on how it's feeling) of both animations, unless I use the set frame command, then it just displays the first.

Edit: Last thing, you ever considered using box.net? Doesn't have those annoying wait times and it has a good interface so you can update files easily.[/quote:2a9e4829]

Thanks! ^^ And no, it doesn't yet because I haven't properly progrmmed the changing of the characters yet. Might be the next thing I tackle after I program the "Abilities" and "Cheats" portions of the menu, and once that's all done, I might finally go onto programming the main gameplay I've had in mind. I'm just getting this menu stuff done first since that's probably going to be the hardest part for me. ;_; Also, those turrets were meant to help me test the feasibility of me creating player health... Notice that for some reason you can only really be harmed by the bullets if your back is facing toward them. No idea what's going wrong in the collision detection there.

And the jumping and falling animation tends to be a bit glitchy. I've seen instances where at the peak of a jump, he'll revert to walking animation, or that the walking animation will sometimes freeze and he'll be stuck in a standing position. I gotta figure out what's causing these glitches. But... it doesn't even play the full animation for you? o_O Really? Geez, I really gotta try and pinpoint that problem... This n00b still has a long ways to go... ;_;

Box.net? I've never even heard of it. ^^;; The only one I really knew of was megaupload.com. I'll have to see what box.net is like then. ^_^ Thanks.
B
4
S
2
G
4
Posts: 164
Reputation: 1,878


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 3 guests