How do I make an equip button?

Get help using Construct 2

Post » Thu Sep 10, 2015 2:15 pm

hey, i want to make a equip and buy button that makes the player wear the selected clothes (animation)
i have a button of two animations 1.buy button animation and 2.Equip button animation
now.. i want to make the buy button to store the selected animation and when the selected animation is already bought i want to change it to equip animation, the main thing i want to do is making the buy button to store the animation name.
C2 Intermediate Developer
Feel free to contact me
B
7
S
2
Posts: 111
Reputation: 908

Post » Thu Sep 10, 2015 2:31 pm

I guess I would use a boolean variable BOUGHT

button boolean is Bought
> set animation to equipped
else
> set animation to buy

on button clicked
> set boolean bought : true

Or is there something more specific going on here?
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 Sep 10, 2015 2:37 pm

what do u mean by (button boolean is Bought)??
C2 Intermediate Developer
Feel free to contact me
B
7
S
2
Posts: 111
Reputation: 908

Post » Thu Sep 10, 2015 2:38 pm

and there is so much animation ... its a ragdoll game so every part have more than 5 animations
C2 Intermediate Developer
Feel free to contact me
B
7
S
2
Posts: 111
Reputation: 908

Post » Thu Sep 10, 2015 2:39 pm

and i have a preview for the animation. i want the buy button store the animation name that is on the preview
C2 Intermediate Developer
Feel free to contact me
B
7
S
2
Posts: 111
Reputation: 908

Post » Thu Sep 10, 2015 2:45 pm

Ah.. there is more to the question..
It might have been easier to know that before..

Where are the buttons?
In a menu or in the same layout as the ragdoll?
I assume the name of the equipped animations should be stored in an instance variable on the right ragdoll part?
Would using an array work?

By the way..
"what do u mean by (button boolean is Bought)??"

create a new event
choose the button
choose "is boolean variable set"

event made..
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 Sep 10, 2015 2:51 pm

the buttons are on a customization preview layout and i will try the instance variables.
C2 Intermediate Developer
Feel free to contact me
B
7
S
2
Posts: 111
Reputation: 908

Post » Thu Sep 10, 2015 2:55 pm

what type of variable should i use ... num, boolean, text?
C2 Intermediate Developer
Feel free to contact me
B
7
S
2
Posts: 111
Reputation: 908

Post » Thu Sep 10, 2015 2:59 pm

and i don't know how to use array very good .... i am an intermediate.
C2 Intermediate Developer
Feel free to contact me
B
7
S
2
Posts: 111
Reputation: 908

Post » Thu Sep 10, 2015 3:00 pm

Depends..

do you want to use text, than you should use text
etcetera..

seeing you want to use an animation name, which I presume consists of text, text should be the right one..

For something like a switch or something that is just yes or no / right or wrong a boolean is well suited

num is for numbers as you probably understand..
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: marcinkowski, plinkie, zenox98 and 11 guests