PDA

Click to See Complete Forum and Search --> : Help with rpg inventory....


Sunfire785
Feb 28th, 2002, 09:36 PM
I'm making an RPG, and I'm to the point where I want to add an inventory. Sort of a diablo-ish intentory. I really don't know how I would do this, so I was hoping one of the kind people could help. Here's my game, look at it, give suggestions, do whatever you want....Thanks!

Jotaf98
Mar 1st, 2002, 09:59 AM
An inventory like the one in Diablo is not gonna be easy... what you can have is simply a list of items in an array of UDTs. Like this:



Type tItem
Name
Type
Power
'And anything else you might need for an item
End Type

Dim Items() As tItem

'Then you can use the items like this...
Items(10).Name = "Rusty Sword"

'Here's an example of how to add an item to the list (like when you pick it up) :
Redim Preserve Items(UBound(Items) + 1)
Items(UBound(Items)).Name = "Golden Shield"
Items(UBound(Items)).Type = "Shield"
Items(UBound(Items)).Power = "100"



I hope that clears everything :)

Sunfire785
Mar 1st, 2002, 03:27 PM
Thanks! Now, I'd like to have a place to equip two items...How how I change the Picture property of picture boxes in the code so when I double click on an item in my inventory, it moves to the equipped box? Maybe a sort of zelda-ish inventory system. I can't seem to get the Picture property of a picture box to change in the code. Also, any other suggestions are very welcome, and what do you think of my game?......Thanks!

Jotaf98
Mar 3rd, 2002, 11:11 AM
You can change the picture property of a picturebox like this:



picItem1.Picture = picSword.Picture



Your game is cool, but it's a bit hard, escaping from the bad guy gets annoying after some time. Oh, pressing spacebar doesn't seem to work :)

I think that you should use an array for each level to have more than one enemy. Each enemy should have some health points and the player too, it's not that hard to implement. Oh, and each enemy should have 2 states (sitting and hunting) so that they start without any movement and when the player gets near them they switch to "hunting" and start hunting the player :)

Sunfire785
Mar 3rd, 2002, 09:59 PM
I'm glad you like it! Here's my newest version of the game. I made it a little easier, and i lowered the sword delay. It works, you just have to time it right. Takes a little practice. Now you have you find the sword (go north) to be able to attack. Also added health. Post any more comments you have.

Jotaf98
Mar 4th, 2002, 01:33 PM
Hum... I still think it would be a lot better if there were more enemies (but weaker) :)

Did you try to implement the 2 states in the enemy?