Displaying Active Object/Equipment With Character

Started by barry.winwood, Wed 08/12/2010 07:38:51

Previous topic - Next topic

barry.winwood

Hey guys,

Sorry if this question has been asked/answered anywhere but I can't find a solution.

What I'm trying to do is create a game where the player can equip the character with different items and have this replicated on screen. I'm aware I could create multiple views with the different items displayed, however this would be time consuming to replicate all the variations.

I'm going to try playing around with a few things myself but in the mean time I thought I would post here and see if there was any giants whose shoulders I could stand on? I don't expect anyone to code me a solution, but if someone knows what direction to point me in it would be appreciated.

Thanks,

Barry

Khris

You could use a GUI with buttons and when the player equips say a shield, set the item's graphic as the button graphic of the shield button.
Have you implemented a way of assigning the equipment type to an inv item?

barry.winwood

Hey Khris,

Thanks for the speedy reply!

Sorry if my original post wasn't clear or if I'm misinterpreting your reply. I'm still working on my game design document so nothing is properly coded yet (I've been trying different things in dummy projects to prove the concepts to myself). In the design document I'm trying to lay out everything conceptually before I begin the main coding.

My intent is to use a GUI to handle the main inventory and a secondary GUI inventory for equipped items, with a drag and drop interface (there is another thread in the forums which discusses this and my plan is to implement a variation of this solution).

Sorry for my ignorance but I'm not sure exactly what you're asking? I think you're asking if I have a way of differentiating between different item types; so say a lantern couldn't be equipped to a hat location? If so my intent is to use a custom property and rules to define what can be equipped where. Honestly the inventory aspect of my design is still quite light on detail.

To clarify I was wondering is there is a default way of displaying (as in your example) a shield on the character that will move with the character without creating a new set of sprites that would include the entire character as well as the shield. The reason I don't want to do this is then I would have to have separate sprites for a character with nothing, with a sword, with a shield, with a sword and a shield, etc.

I'm playing with the move function of an object to tie it to the movement of the character but the coding of this becomes quite intense and I hoped I was just going about it sideways.

The reason I'm asking this question so early in my process, is because the solution will influence how I handle equipment within the game.

Thanks again for your time.

Cheers,

Barry


Khris

Yes, that's what I meant.

Hm, there are several ways to "equip a sprite", if you will.

-Character.FollowCharacter() offers parameters that should be suitable

-Move the shield character to the character's position every game loop.

-When something is (un-)equipped, redraw the character's frames dynamically (my choice)
E.g. for the sprites facing up, draw the shield and weapon, then the character's body, clothing, armor.
You can access and change viewframes during the game; the technical side is trivial.

SMF spam blocked by CleanTalk