Download Construct 2 release 27 Forum Home > Construct 2 General > Construct 2 general |
Post Reply
|
Page <123> |
| Author | |
Post Options
Quote Reply
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. |
|
![]() |
|
Post Options
Quote Reply
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. |
|
![]() |
|
Post Options
Quote Reply
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. |
|
![]() |
|
Post Options
Quote Reply
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. |
|
![]() |
|
Post Options
Quote Reply
Posted: 12 Feb 2011 at 6:08pm |
|
|
Referencing a sprite by specific variables in actions might solve a few things.
sprite.num(4)? |
|
![]() |
|
Post Options
Quote Reply
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. |
|
![]() |
|
Post Options
Quote Reply
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. |
|
![]() |
|
Post Options
Quote Reply
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. |
|
![]() |
|
Post Options
Quote Reply
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. |
|
![]() |
|
Post Options
Quote Reply
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. |
|
![]() |
|
Post Reply
|
Page <123> |
| Forum Jump | Forum Permissions ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |