Download Construct 2 release 27

Forum Home Forum Home > Construct 2 General > Construct 2 general
 Post Reply Post Reply Page  <123>
Author
16,524 Rep
Post Options Post Options   Quote newt Quote  Post ReplyReply Direct Link To This Post Posted: 12 Feb 2011 at 4:15pm
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.
Back to Top

Scirra Developer
78,417 Rep
Post Options Post Options   Quote Ashley Quote  Post ReplyReply Direct Link To This Post Posted: 12 Feb 2011 at 5:15pm
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.
Back to Top
16,524 Rep
Post Options Post Options   Quote newt Quote  Post ReplyReply Direct Link To This Post Posted: 12 Feb 2011 at 5:28pm
[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.
Back to Top

Moderator
11,940 Rep
Post Options Post Options   Quote Arima Quote  Post ReplyReply Direct Link To This Post Posted: 12 Feb 2011 at 5:47pm
[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.
Back to Top
16,524 Rep
Post Options Post Options   Quote newt Quote  Post ReplyReply Direct Link To This Post Posted: 12 Feb 2011 at 6:08pm
Referencing a sprite by specific variables in actions might solve a few things.
sprite.num(4)?
Back to Top
7,061 Rep
Post Options Post Options   Quote R0J0hound Quote  Post ReplyReply Direct Link To This Post Posted: 12 Feb 2011 at 6:37pm
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.
Back to Top
6,552 Rep
Post Options Post Options   Quote inkBot Quote  Post ReplyReply Direct Link To This Post Posted: 12 Feb 2011 at 10:01pm
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.
Back to Top

Moderator
10,796 Rep
Post Options Post Options   Quote deadeye Quote  Post ReplyReply Direct Link To This Post Posted: 12 Feb 2011 at 11:25pm
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.
Back to Top

Scirra Developer
78,417 Rep
Post Options Post Options   Quote Ashley Quote  Post ReplyReply Direct Link To This Post Posted: 13 Feb 2011 at 2:19am
[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.
Back to Top
6,552 Rep
Post Options Post Options   Quote inkBot Quote  Post ReplyReply Direct Link To This Post Posted: 13 Feb 2011 at 2:52pm
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.
Back to Top
 Post Reply Post Reply Page  <123>

Forum Jump Forum Permissions View Drop Down