system expressions

Get help using Construct 2

Post » Sun Oct 13, 2013 12:36 am

this is a two part question.

I am looking at the SYSTEM EXPRESSIONS page and wondering if there are any examples, I am new to all of that and was hoping there are examples some where.

I am trying to make a system where I collect Acorns in a bag and the counter text goes up 1 every time....so it keeps track of how many Acorns I collect...

then I want to set up to where I can drop off the current amount of acorns when colliding with a object...so lets say I collect 5 acorns...I go an collide with an object and it displays a text of 5 acornscoins...and it keeps track... so if I go out, collect 5 acorns come back collide with object, it adds 5...then I go out collect 10 and go and collide with object it says I now have 15 acorns returned.....

I guess a tracking system for how many acorns I collect and return when I collide with a specific sprite..

this is what I have so far.....right now it tells you the amount of Acorns collected....but the game will focus on how many nuts you return to the home tree...I would want another value for Acorns Returned..
B
9
S
2
Posts: 272
Reputation: 1,632

Post » Sun Oct 13, 2013 1:53 am

http://s93.photobucket.com/user/spawn85027/media/AddingVariables_zps6eaaf80c.jpg.html

how can I get an expression to ADD two variables....

right now I have it and instead of adding the variable , it replaces it..

you can play what I have here...

http://www.dwbailey.com/images/SquirrelNutsSaturday/

this is what I have in my set text

"Acorn: " & AcornCount + AcornReturned

snake850272013-10-13 02:04:33
B
9
S
2
Posts: 272
Reputation: 1,632

Post » Sun Oct 13, 2013 5:02 am

any advice??
B
9
S
2
Posts: 272
Reputation: 1,632

Post » Sun Oct 13, 2013 8:08 am

set text: "AcornTotal: "&(acorncount+acornreturned)

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 Oct 13, 2013 8:48 am

http://www.dwbailey.com/images/Variables.capx

Here is the files..

its not actually adding the two variables together..its still just replacing one for the other...i have something wrong here
B
9
S
2
Posts: 272
Reputation: 1,632

Post » Sun Oct 13, 2013 9:04 am

I can't open the capx, because it has a third party plugin time manager istalled, I'm sorry.
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 Oct 13, 2013 9:21 am

no problem i took a screen shot of the event sheet

http://s93.photobucket.com/user/spawn85027/media/eventsheet_zpsc9a881a7.jpg.html
B
9
S
2
Posts: 272
Reputation: 1,632

Post » Sun Oct 13, 2013 10:24 am

I don't see where you change the AcornReturned variable?

So it seems that stays at 0.
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 Oct 13, 2013 10:38 am

i thought that is what line 33 is doing...since the value is 0 for acornreturn at the start...when the player collides the new value becomes whatever the acorn counter is at the time of collision...and if acorn return has a value it will also add itself..atleast that was my thinking?

B
9
S
2
Posts: 272
Reputation: 1,632

Post » Sun Oct 13, 2013 10:39 am

acorn return set text "Acorn:" &(AcornReturned+AcornCount)snake850272013-10-13 10:40:44
B
9
S
2
Posts: 272
Reputation: 1,632

Next

Return to How do I....?

Who is online

Users browsing this forum: divsyntax, pmerineau and 10 guests