How do I add a value on an Instance Variable

Get help using Construct 2

Post » Thu Dec 03, 2015 3:16 am

Hey!

Actually the question it's a little more complicated than simple adding a value.
What im trying to do is, when I click on an instance of an object, if it meets the conditions to do it. Add a value to a variable from another instance from another object. If I try to add the value to a Global Variable it ends up adding it. If I try another condition (i.e.: Every X seconds) it adds the value to the object variable.

What am I doing wrong?

Cheers!

P.D.: Here's a Link http://imgur.com/uyNUSJs where you can see the action that I'm trying to work.
B
4
Posts: 6
Reputation: 237

Post » Thu Dec 03, 2015 3:55 am

I guess the title might be a little loose u-u
B
4
Posts: 6
Reputation: 237

Post » Thu Dec 03, 2015 8:49 am

So if I get this correctly you are trying to take the value of an Instance variable for treasure and put it into your players Instance variable?

Make sure that you do the Math's before you destroy the Treasure Object. So have the Treasure Destroy event further down.
B
11
S
3
G
1
Posts: 32
Reputation: 751

Post » Thu Dec 03, 2015 9:34 am

Actually do try the inverse, instead of "Player is overlapping treasure" -> "Treasure is overlapping player".
Same for "ActiveTile", since you have on top of your condition one instance of "Treasure" which is picked, being the one you touched on.
This is THIS instance that helps deciding the other conditions and picking the appropriate tile.

The order of the destroy action does not impact there since the treasure instance will only be destroyed on the next tick no matter what.

The issue there is mainly the picking of the "ActiveTile" instance I think.
New to Construct ? Where to start

Image Image

Image Image

Please attach a capx to any help request or bug report !
Moderator
B
270
S
98
G
70
Posts: 7,267
Reputation: 75,644

Post » Thu Dec 03, 2015 12:19 pm

Okay guys, I'll try those solutions when I get home and tell you how it went! Thanks for the feedback!
B
4
Posts: 6
Reputation: 237

Post » Thu Dec 03, 2015 11:38 pm

Neither of those solutions worked guys :c
B
4
Posts: 6
Reputation: 237

Post » Thu Dec 03, 2015 11:52 pm

HOORAAAAAY! I did it!

The solution was to delete the Treasure overlaping Player, since only one tile can have the active state it wasnt necesary to have that condition. I tried disabling it and now it works c:

Thanks for your responses!
B
4
Posts: 6
Reputation: 237


Return to How do I....?

Who is online

Users browsing this forum: teha and 9 guests