System-wide object comparisons by instance variabl

Get help using Construct 2

Post » Wed Jan 18, 2012 10:48 pm

How could I go about writing an event that queries whether object_A has collided with *any* object that contains a certain instance variable that is equal to a particular value?

The only way I can think of right now is to write a bunch of individual events each one comparing against a specific type of object (which would result in a massive event comparison) and than doing a sub-event condition querying for the variable value.

Is there another way to do this? I couldn't find a global "parent" object class. Is this something that I could only do with the premium version which supports 'Families'?

Thanks,
cacotigon
B
30
S
6
G
8
Posts: 232
Reputation: 6,119

Post » Wed Jan 18, 2012 11:22 pm

It will be possible indeed.

Atm you can check in a single event about the collision with object types belonging with the family.
For the instance variable filtering, it's not yet implemented, it will be in the next releases.

If this is something you're going to need, I'd stronlgy advise you to take an early adopter license today (it is the last day at the discount price).
It is a matter of time/releases before the feature is implemented and stable.Kyatric2012-01-19 00:08:42
New to Construct ? Where to start

Image Image
Image Image

Please attach a capx to any help request or bug report !
Moderator
B
247
S
85
G
40
Posts: 6,999
Reputation: 57,793

Post » Wed Jan 18, 2012 11:44 pm

Awesome! This is a really excellent program to tinker around with. After spending a few hours with it, I've already been able to mock up some simple platformer gameplay. In fact, so far, the majority of my time goes into using Paint Shop Pro and hand-editing my animated sprites to make sure that the walking/movement animations are smooth. I was experimenting with adding some enemies and I thought, why not set them to Platform behavior and use Simulate control events and invisible information sprites to trigger certain things within the level such as boundaries, etc. Works SOOOO WELL. I've got a pretty aged computer, and the framerate is actually not half-bad, which is amazing for a web app (Of course I'm not doing any rotations or anything fancy at the moment, so that could change).) though I also can't wait for other types of output such as standard windows executables.

also thanks for the heads up about the early adopter license!
B
30
S
6
G
8
Posts: 232
Reputation: 6,119

Post » Wed Jan 18, 2012 11:49 pm

Good luck and welcome to C2. Also the rotation shouldn't do anything to your fps, I'm using interpolation on mine and it works nicely :)
B
29
S
12
G
7
Posts: 740
Reputation: 7,849

Post » Wed Jan 18, 2012 11:56 pm

Thanks! That's good to know about rotations. I'm so worried about performance that rather than doing opacity/transparency/etc in real-time for example for particle type effects, I was considering just creating individual frames in Paint Shop Pro using various effect filters and exporting as a tile-set. :)
B
30
S
6
G
8
Posts: 232
Reputation: 6,119

Post » Thu Jan 19, 2012 12:14 am

For the performances check this article out at "Canvas renderers" section. (the whole read is usefull as usual though ^^)

As long as your browser can handle webgl and that graphic card drivers are up to date, you should be fine.
In the case of rotations of sprites and stuff, all this should be handled by the GC and so free the UC for more computations.

You just have to figure out where you at in the "technology map".
New to Construct ? Where to start

Image Image
Image Image

Please attach a capx to any help request or bug report !
Moderator
B
247
S
85
G
40
Posts: 6,999
Reputation: 57,793

Post » Thu Jan 19, 2012 2:32 am

Kyatric thanks for that link; just finished reading it. I didn't realize that the Javascript garbage collection could be such a performance killer, provided I followed proper disposal practices, I never really had to worry about something like that before in C#.
B
30
S
6
G
8
Posts: 232
Reputation: 6,119


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 16 guests