Hello boys and girls.
I'm having trouble to do what I want with Construct 2.
I'd like to do a simple switching weapon system. Your character start the level in a initial state called "Idle" for example.
Once you step on a weapon, you pick it up. Then you character take the color of that weapon.
If you take another weapon, you can switch to that new weapon by pressing space. But you can't go back to your initial state "Idle", you have to pick on the the two weapons stored in your character.
I tried to follow this tutorial on youtube : youtube.com/watch
It's great but since I'm not that good with Construct, I can't figure how to be able to tweak this switching system to have, for example, the 0 on the array to be a no-return point. Once you get to 1, you can't go back to 0.
Since I'd like to have my "Idle" to be in 0, my red weapon to be in 1 and my Yellow weapon to be in 2 for example.
So I'd like to be able to switch between 1 and 2 but not 0.
I made a little picture , then I take a screenshot of my event sheet so far :
Any advice or tips is welcomed.
Thanks by advance. :)
Here you go:
Note that there is a "color" instance variable defined on the Weapon sprites. Color values should be the same as character animations.
Develop games in your browser. Powerful, performant & highly capable.
You're a wizard. A magician. This is incredible.
I made an UI to work with your incredible piece of code. And now I'm stuck at some point.
I'm trying to figure how to only have 2 weapons / color equipped at the same time.
I'm using an old .capx that a user made 3 years ago, for the inventory.
construct.net/forum/construct-2/how-do-i-18/how-do-i-switch-weapons-attack-101999 here it is.
User Janlindo made a great work and it fits very well for my needs.
But as far as I unterstand all of these codes, I can't make them communicate.
I was able to make my inventory slot1 to take the color of the thing I just stepped in. Then, make the slot 2 take the color of the second thing I was stepping in.
But I don't know how to be able to "Select" which slot I want to be equipped.
I tried to store some values in a dictionnary, I tried to make a "Cursor" to make a selection of which slot had to be active and the one who wasn't overlapped by the cursor set to inactive... But that didn't work either.
I want to be able to switch between my 2 slots inventory, and when I step in a new color, replace the active color that I'm using by the new color I just stepped in.
If anyone have any idea or could lead me to a video that I didn't found, or had a similar system, and if you don't mind sharing, it would be so helpful.
Thanks by advance and... I can't tell how your capx was helpful Dop2000. Thanks again.
EDIT : The .capx is here : dropbox.com/s/kipgnwjjljv8v6b/Sprite.capx
If there are only two weapon slots, then it's even easier, you don't need the array.
Sir you are a genius. Thank you very much for what you have done.