Slot selection (select one at a time) [SOLVED]

Get help using Construct 2

Post » Thu Dec 24, 2015 4:03 am

If I have 4 slots for weapons and if I click on one of the slots, I want that one to be selected. How do I only have one selected at a time by unselecting the others? Possible to do without using arrays?

https://dl.dropboxusercontent.com/u/73836006/slotSelection.capx
Last edited by jook00 on Fri Dec 25, 2015 2:55 am, edited 1 time in total.
Check out my games on Google Play:

BEAST ATTACK (900,000+ downloads!)

ZOMBIE BASH (Android) (Launched Feb 17)

ZOMBIE BASH (iOS) (Launched March 17)
B
49
S
15
G
2
Posts: 427
Reputation: 5,139

Post » Thu Dec 24, 2015 5:00 am

https://dl.dropboxusercontent.com/u/495 ... slots.capx is how I would do it without slot arrays. Mmmm instance variables.
B
43
S
13
G
59
Posts: 1,779
Reputation: 35,731

Post » Thu Dec 24, 2015 7:36 am

This is how I would do it with 1 event
https://drive.google.com/open?id=0B3JLq ... lFhTnpHUU0

If you need access to "selectedslot" at all time, you can move the var outside of the event and make it a global.
Image
B
70
S
27
G
12
Posts: 512
Reputation: 12,153

Post » Thu Dec 24, 2015 10:41 am

Lof wrote:This is how I would do it with 1 event
https://drive.google.com/open?id=0B3JLq ... lFhTnpHUU0

If you need access to "selectedslot" at all time, you can move the var outside of the event and make it a global.


Or even simpler:

Select Only One
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Thu Dec 24, 2015 12:52 pm

I was sure that picking all overrides the picked(touched) object, even if it's not a nested event, good to know I was wrong :)
Image
B
70
S
27
G
12
Posts: 512
Reputation: 12,153

Post » Thu Dec 24, 2015 1:04 pm

Lof wrote:I was sure that picking all overrides the picked(touched) object, even if it's not a nested event, good to know I was wrong :)


Yeah, subevents follow the picking of the topevent, not of other subevents..
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Fri Dec 25, 2015 2:54 am

Thank you for all the suggestions.

This is by far the most simplest method I've seen yet. Going to use this everywhere!
@LittleStain

Or even simpler:

Select Only One
Check out my games on Google Play:

BEAST ATTACK (900,000+ downloads!)

ZOMBIE BASH (Android) (Launched Feb 17)

ZOMBIE BASH (iOS) (Launched March 17)
B
49
S
15
G
2
Posts: 427
Reputation: 5,139


Return to How do I....?

Who is online

Users browsing this forum: FabianB and 9 guests