How do I toggle between selected buttons?

Get help using Construct 2

Post » Mon Oct 19, 2015 9:26 am

Hi all, I would like a bit of help regarding an issue I'm having with my shop.

I have built an in-game shop, in which I can buy different in-game features, and use these during game play. The problem that I am having is that while I can make selections from the bottom item to an item above( ex first skip, then slow), I cannot do the opposite (first slow then skip). Would it be possible for someone to take a look at that in order to help me fix the issue?

Here is the capx of my work so far : https://www.dropbox.com/s/utee9sockkxx8 ... .capx?dl=0 .


Thanks to all in advance :)


Assumed sections from the event sheet causing problems :
Image


Pictorial explanation of what is happening :

Step 1: Link to shop is selected from menu and shop is displayed as such:
Image

Step 2: Player buys items - resulting in something similar to this:
Image

Step 3: Player decides to use third item as an aid during game. Resulting in this:
Image

Step4: Player changes his/her mind and decides to use the first item from the list as aid. Resulting in this:
Image

Step5: Player changes his/her mind again, and wants to use second item as aid. However he/she is unable because this does not work. Player is now very sad (like this cat).

Image
Last edited by Minjaware on Mon Oct 19, 2015 6:45 pm, edited 2 times in total.
B
5
S
1
Posts: 36
Reputation: 451

Post » Mon Oct 19, 2015 2:41 pm

Some of us are negligent in keeping C2 up-to-date. Could you post screenshots of the affected area? (highlight, right click and choose "Screenshot selection"; use control click as necessary to select areas)
https://www.ravenheart.ca/home
I don't check the forums much anymore, but I will receive an email for PMs.

"Someone once told me I bite off more than I can chew...

I told them I would rather choke on greatness than nibble on mediocrity."
B
23
S
6
G
1
Posts: 1,419
Reputation: 4,857

Post » Mon Oct 19, 2015 3:58 pm

@gumshoe2029: I wasn't exactly sure regarding what you meant, so I updated my question with pictures. Hope they help.
B
5
S
1
Posts: 36
Reputation: 451

Post » Mon Oct 19, 2015 4:17 pm

LOL. Not quite. I mean in Construct2. In the events tab of your Layout where you are doing stuff. You can select the events (turn them yellow) by clicking (or control clicking on a number of them) and then right click (to get the menu) and choose "Screenshot selection") then you can Paste (control-V) this screenshot into Microsoft Paint and save the image and post it to a website like http://postimage.org/ for free and include the link here, so I can see what you are doing.

[ img ] http://s13.postimg.org/en5zxics5/image.png[ / img ]
Image
https://www.ravenheart.ca/home
I don't check the forums much anymore, but I will receive an email for PMs.

"Someone once told me I bite off more than I can chew...

I told them I would rather choke on greatness than nibble on mediocrity."
B
23
S
6
G
1
Posts: 1,419
Reputation: 4,857

Post » Mon Oct 19, 2015 5:22 pm

@gumshoe - here you go - [img=http://postimg.org/image/6zdy0sby5/]Image[/url]

Image

Apologies for my misunderstanding. Hope this explains things a bit better.
B
5
S
1
Posts: 36
Reputation: 451

Post » Mon Oct 19, 2015 6:08 pm

The pictures are too small...

I had a look in your code and I can't understand what is going on.
Could you make more documentation about your code? Use Q to insert comment in the event sheet and tell what certain events should do.
For example What is the meaning of variable 0 1 and 2? What are their purpose?
It's time for me to return the favor :)
B
32
S
9
G
9
Posts: 132
Reputation: 5,375

Post » Mon Oct 19, 2015 6:46 pm

@ikke2902 - reuploaded the code to dropbox. Hope I clarified things a bit. :)
B
5
S
1
Posts: 36
Reputation: 451

Post » Mon Oct 19, 2015 9:24 pm

@minjaware That definately helped and I found the problem.
Asuming you have selected the third item "Freeze" and all other items has been bought.

Now you select the fourth item "Slow", the following steps will be walked through.
Global variable freeze will be set to 2 (starting from row 120 in Eventsheet). Note, at this state the global variable freeze and slow have a value 2.
The eventsheet will be readed till the last event and there after it starts from the top. The next influental event occures in the group "variable is 2". Within that group the first met condition is freeze=2 (remember event sheets reads from top to down). This event sets globale variable "bridge", "long" AND "freeze" to 1!
Now freeze is 1, the next condition where freeze should be selected will not be met.
Same applies to other items.

There is a point I would like to make. In row 115 you stated in the condition item=item_buy.item
You don't have to use it. When you use on-touch-object condition, only the touched objected will be taken account to check the sub events.

At the end, you should try to read like C2. Read the events from top to down. Perhaps you can find a solution now for your problem :)
It's time for me to return the favor :)
B
32
S
9
G
9
Posts: 132
Reputation: 5,375

Post » Tue Oct 20, 2015 9:09 am

Aha ... thanks :). What might be a possible solution to fix it?
B
5
S
1
Posts: 36
Reputation: 451

Post » Tue Oct 20, 2015 11:14 am

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

Next

Return to How do I....?

Who is online

Users browsing this forum: John Cutter and 8 guests