Download Construct 2 release 27

Discussion and feedback on Construct 2

Post » Sat Feb 12, 2011 4:15 pm

Yes thats pretty much what I was going for, but I was more concerned that the individual variables were all being changed.
What I was expecting was that the first instance sprite(0) would keep its initial value in sprite.num.
Image Image
B
161
S
48
G
89
Posts: 7,347
Reputation: 66,249

Post » Sat Feb 12, 2011 5:15 pm

OK, that's uncovered a few bugs, but the main problem is Sprite(n) indexes to the currently picked objects, so after a 'pick nth' there's only one instance picked, so no matter what n is you always get that instance's value.

That can be worked around, but it seems inconvenient, so in the next build Sprite(n).X indexes to all instances, and ignores the SOL. That also means Sprite.X is no longer equivalent to Sprite(0).X, you'll always get the first instance's X with Sprite(0).X.
Scirra Founder
B
359
S
214
G
72
Posts: 22,946
Reputation: 178,478

Post » Sat Feb 12, 2011 5:28 pm

[quote:2xitiiar]indexes to the currently picked objects[/quote:2xitiiar]
Ahh that's where I was messing up.
I was going on the assumption it was indexed on creation.
Image Image
B
161
S
48
G
89
Posts: 7,347
Reputation: 66,249

Post » Sat Feb 12, 2011 5:47 pm

[quote="Ashley":28t0cgq5]Sprite(n) indexes to the [i]currently picked objects[/i[/quote:28t0cgq5]

Might there be a way to do both? It seems it would be helpful to have it reference only the currently picked objects with a 'sprite collides with sprite' event.
Moderator
B
87
S
32
G
33
Posts: 3,005
Reputation: 27,397

Post » Sat Feb 12, 2011 6:08 pm

Referencing a sprite by specific variables in actions might solve a few things.
sprite.num(4)?
Image Image
B
161
S
48
G
89
Posts: 7,347
Reputation: 66,249

Post » Sat Feb 12, 2011 6:37 pm

I'm finding a problem with useing loops with subevents. I used for each and added a subevent to compare 1=5 (which should be never true). For some reason the subevent's actions are being run for all of the objects but one.

ex: [url:1slovrzp]http://dl.dropbox.com/u/5426011/c2/bug.capx[/url:1slovrzp]

It seems to occur with any subevent condition.
B
79
S
24
G
52
Posts: 4,725
Reputation: 39,713

Post » Sat Feb 12, 2011 10:01 pm

There's a thing I've been wondering about. Is there a specific reason to why the keyboard and mouse objects aren't automatically added to a project? I think most people would want to use both objects while working on it and likely in the end project too.

I'm guessing it's that way because it was like that in 0.x as well, and I thought the same then. Seems like it just adds an unnecessary step for C2 users, so I thought I'd ask.
B
73
S
20
G
10
Posts: 524
Reputation: 9,896

Post » Sat Feb 12, 2011 11:25 pm

A game might be mouse-only or keyboard-only, and adding both would be overkill. In either case the other isn't needed.

Also what if you want to make a simulation or an example that doesn't need input? Or a banner thing for the top of your web page? There are a few reasons why you wouldn't need mouse or keyboard.
Moderator
B
5
S
2
G
6
Posts: 4,348
Reputation: 10,971

Post » Sun Feb 13, 2011 2:19 am

[quote="Arima":1td4zt4d]Might there be a way to do both? It seems it would be helpful to have it reference only the currently picked objects with a 'sprite collides with sprite' event.[/quote:1td4zt4d]
You don't need expression indexing for the sprite collides with sprite events - just the 'pick nth instance' conditions.

[quote="R0J0Hound":1td4zt4d]I'm finding a problem with useing loops with subevents[/quote:1td4zt4d]
I think I see the problem in the runtime, should have it fixed next build.

[quote="inkBot":1td4zt4d]There's a thing I've been wondering about. Is there a specific reason to why the keyboard and mouse objects aren't automatically added to a project?[/quote:1td4zt4d]
It's the principle of don't-pay-for-what-you-don't use: if you're not using mouse input (as someone says, like on a banner advert) then you shouldn't pay for the extra weight of carrying all the mouse javascript around, or having it take up space in the event wizard when it's not used, and so on. It's only a couple of clicks to drop in when you are using it so I don't think it's a big deal - if we get round to adding templates, that would effectively solve it too.
Scirra Founder
B
359
S
214
G
72
Posts: 22,946
Reputation: 178,478

Post » Sun Feb 13, 2011 2:52 pm

Ok, that answers my question then. Was simply wondering.

I think I found a problem with either the text object or variables.

I have an object named "player" with the variable "health" and wanted to have the text show the variables value so I set the text to: player.health, each tick. However the text object displays nothing when I do this. However, if I instead set the text to: "Health:" & player.health, then it displays both the text and the value. I added it to the tracker with the capx.
B
73
S
20
G
10
Posts: 524
Reputation: 9,896

PreviousNext

Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 8 guests