How do I Make Switchable Weapons/Item Slots?

Just started using Construct 2? Post your questions here

Post » Fri Jul 11, 2014 8:23 pm

I have been wanting to make an exploration based action-rpg, similar to the original NES Zelda for a while now and after looking into a lot of different possible game engines I believe that Construct might be the perfect one for the job. I have very little experience with these sorts of things unfortunately, the only other game engine I worked with in the past was RPG Maker XP.

I've seen tutorials on here for drag-and-drop inventories and life-bar HUD's and they seem like they will go a long way to helping this project come to life, but before I can work on the game I need to figure out how to do the player controls.

Ideally I want the player to be able to set any 2 items to their usable items slots (sword, shield, torch, potion, etc.) and then use them to attack enemies or solve the games puzzles, but a lot of the game examples I've seen here have fixed controls. Is it possible to have a variety of potential items/player actions that can only be toggled on or off when the game character has the item equipped, and make it so that the item/ability uses the specific item slot control for use?

(Example: Item slots A and B. If the player equips "sword" to A, then pressing A will activate sword, but if he equips it to B then B will activate sword)

My apologies for the long rambling post.
B
1
Posts: 3
Reputation: 125

Post » Fri Jul 11, 2014 9:01 pm

B
33
S
5
G
1
Posts: 163
Reputation: 2,693

Post » Sat Jul 12, 2014 2:21 am

Those look like good tutorials, but they seem to be tutorials for inventory systems. Inventory is a part of the question I asked, but I was mostly asking if/how it is possible to have player input commands be able to be toggled between different inventory items.

You know, being able to set items from the inventory into 1 of 2 action command slots and then having the item in that slot determine the action that takes place on the screen when the player inputs the command.

Apologies once again if my question was answered in the tutorials posted but I read through them and I'm not sure they would work for this particular problem (though that may be due to my inexperience with this engine).
B
1
Posts: 3
Reputation: 125

Post » Sat Jul 12, 2014 5:56 pm

Could you simply have all your inventory items placed into a family, and give the family two instance variables, for example 'In Slot A' or 'In Slot B' . Pressing the A button activates the object for 'In Slot A' that is true, and pressing the B button activates the object that for 'In Slot B' is true.

Sorry if that's not very well explained, I can further expand on this method if you'd like, and could probably cobble together a small capx to illustrate what im trying to get at.
Intermediate level Construct 2 developer, looking to build up my portfolio : https://seriouslycrunchy.itch.io/

Current projects : Bite Sized Game Development, please have a look at my tutorials and comment!

I also write for http://moonbooks.net/, please come and check us out!

Follow me on twitter! @SrslyCrunchy I'm always looking for games or templates to highlight, use the hashtag #madeinconstruct !
B
15
S
6
Posts: 52
Reputation: 3,026

Post » Sun Jul 13, 2014 1:28 am

That sounds like a simple and elegant solution - if making a CAP file wouldn't be too much trouble I'd be interested in seeing one, but if it would be a hassle don't worry about it; I can probably work something out from your description.

Thanks a lot for the help!
B
1
Posts: 3
Reputation: 125

Post » Mon Jul 14, 2014 2:06 pm

Hope it works out for you!

I'll rustle up a .capx for you within the next day or so, it would probably be good for me to have an example of this sort of thing to hand! Just a thought : you will need the personal license level of C2 to create families, though you can probably find a workaround for it anyway.
Intermediate level Construct 2 developer, looking to build up my portfolio : https://seriouslycrunchy.itch.io/

Current projects : Bite Sized Game Development, please have a look at my tutorials and comment!

I also write for http://moonbooks.net/, please come and check us out!

Follow me on twitter! @SrslyCrunchy I'm always looking for games or templates to highlight, use the hashtag #madeinconstruct !
B
15
S
6
Posts: 52
Reputation: 3,026

Post » Tue Jul 15, 2014 2:51 pm

Finally got around to doing the .capx, hope this provides a decent example to anyone out there, I rushed through it a bit so it doesn't like it if you put two inventory objects in the same slot, but hopefully this will do what you need!

https://dl.dropboxusercontent.com/u/245987915/2slotInventory.capx
Intermediate level Construct 2 developer, looking to build up my portfolio : https://seriouslycrunchy.itch.io/

Current projects : Bite Sized Game Development, please have a look at my tutorials and comment!

I also write for http://moonbooks.net/, please come and check us out!

Follow me on twitter! @SrslyCrunchy I'm always looking for games or templates to highlight, use the hashtag #madeinconstruct !
B
15
S
6
Posts: 52
Reputation: 3,026


Return to Beginner's Questions

Who is online

Users browsing this forum: Sockratease and 0 guests