How do I change and buy skins on demand ?

Get help using Construct 2

Post » Sun Jul 17, 2016 6:13 pm

We have created an app and now we want to add a "skin" system for the character.

The problem is, there are too many variables and too many visibility and opacity changes. -.-

My question: Is there a simpler way or plugin to change skins of the character.

Currently I'm changing them with adding variables to each color, and each change, changes variables for the whole set of colors which adds up to way to many lines of code and is getting easy to get lost in it.

Best Regards.
B
14
S
3
Posts: 20
Reputation: 840

Post » Sun Jul 17, 2016 6:49 pm

XML is great for situations like this.
But you'll still have to manually define values for your variations.
Mistakes were made.
B
55
S
28
G
115
Posts: 1,709
Reputation: 65,116

Post » Fri Jul 22, 2016 9:41 am

Thanks for the tip, it really helped us to try it and gave us the idea to use the Array for it.

But still, entering the values manually is a lot of work xD.
B
14
S
3
Posts: 20
Reputation: 840

Post » Fri Jul 22, 2016 11:43 am

You can create a dictionary object, and attach it to a/any/all character instance... by putting them into a container.

This way, each character has it's own dictionary automatically, that is always referenced to the correct character (because of the container) - then you can reference the dictionary traits of any specific instance; IE - "key : value" -or- "Shirt : 12" -or- "Pants : 'BlueShorts'" -etc-

This way you can simply use your (dictionary) value of each key as an animation frame or animation name to a "shirt" object (sprite); IE "Shirt : 12"

[Every X seconds/on button clicked/whatever condition]
---Set Pants.sprite animation_frame to Dictionary.get("Shirt") {will return "12" because of, "Shirt : 12"}
---Set Shirt.sprite animation_frame to Dictionary.get("Pants") {etc}
--- Set Hat.Sprite animation_frame to Dictionary.get("Hat") {etc}
--- ETC

Hope this makes sense^

*EDIT*
I'm sure your application of it won't be the same approach but it's much easier than handling a tonne of variables, especially when you just loop through the entries.

~Sol
Tired of crappy file hosts that are crappy? Get DROPBOX - https://db.tt/uwjysXJF
Moderator
B
84
S
34
G
40
Posts: 3,032
Reputation: 30,499


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 12 guests