How to add costumes?

Get help using Construct 2

Post » Sun Jan 26, 2014 5:44 pm

Hello, Scirra Community, I need your help with transferring data to one layout to another. I cant figure it out...

I have a shop on a Shop layout with different skins and masks, and if I buy one I want it to be attached to the player on the GAME layout. How is this possible?
B
12
S
3
G
1
Posts: 79
Reputation: 1,055

Post » Sun Jan 26, 2014 6:10 pm

I set this up but it doesnt work:

on the shop layout:

If Coins equal or bigger than 500 set SOLDOUT Visible
                                  set HAT opacity to 50
                                  system substract 500 from Coins
                                  Set Text to Total Coins: &Coins
                                  System toogle Boolean ON to true
                                  (the hats has a boolean for the system
                                  to check if true or false)

on the game layout:

If Hat boolean is ON    Set hat visible
                        Set position to Player.X, Player.Y

But it doesnt work. Is there any flaw in my logic? I think this is the correct way of doing it but... I need help...
B
12
S
3
G
1
Posts: 79
Reputation: 1,055

Post » Sun Jan 26, 2014 6:10 pm

Set a global variable to the selected object in the shop layout,
Then check the variable on start of game layout and have the player object spawn the corresponding object. pin it to the player and job done!
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 » Sun Jan 26, 2014 6:19 pm

LittleStain, kudos, that worked perfectly. Thanks a lot :)Frostolo2014-01-26 18:38:28
B
12
S
3
G
1
Posts: 79
Reputation: 1,055

Post » Sun Jan 26, 2014 6:30 pm

I would make 1 object called hats
put all hats in different animation frames of the object and set animationspeed to 0.

right click the event sheet and add global variable hats

when hat one picked in store set the variable to 1, when hat two set to 2 etc..

on start of game layout object hat set frame to global variable hats.
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 » Sun Jan 26, 2014 6:41 pm

That seems even better. Thanks again :) Will try that.

Now I have one problem with the pin behavior. When my player overlapses a gravity zone, the player changes angle to look like a fish, but with the pin behavior I cant make it look like its changes with the player in the animation, how can I make his work?

It seems like I need to adjust set position and calculate it exactlyFrostolo2014-01-26 18:42:05
B
12
S
3
G
1
Posts: 79
Reputation: 1,055

Post » Sun Jan 26, 2014 6:43 pm

Rope style seems to do it it better but then its a little off. Can I adjust the pin location?
B
12
S
3
G
1
Posts: 79
Reputation: 1,055

Post » Sun Jan 26, 2014 6:52 pm

I can't realy comment to this, for I can't see the effect.

You can always unpin set position an repin if nescessary, but choosing the right way to pin (position and angle) and making sure your animation is consistent should be enough.
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 » Sun Jan 26, 2014 6:58 pm

Done :)

Thanks a lot LittleStain for your help. Without it I would still be on the shop section and now it rotates nicely using set position image point, the correct angle and pin position only. :)
B
12
S
3
G
1
Posts: 79
Reputation: 1,055


Return to How do I....?

Who is online

Users browsing this forum: John Cutter and 6 guests