Check if object exists?

Get help using Construct 2

Post » Fri Jan 24, 2014 8:11 am

Hi,

I want to check if object exists.
How do I do it?

If Bullet is X on layer"Game" doesn't work

if Bullet is X on screen doesn't work.

In debug it shows no Bullet exist.


Please help.
[size=200]1. Best Construct 2 course :HERE.10$!

2. 155 games source codes for sale on scrira store 12,86$each. PM me if interested to speed up the uploading process.
[/size
B
34
S
8
G
4
Posts: 156
Reputation: 3,779

Post » Fri Jan 24, 2014 8:31 am

Please post your capx that is not working as expected and we might be able to spot the problem.

does this help ?
August 2015 - I misplaced a lot of links - I will try to find backups and repost. If You find a post that interests please reply to post with @rampackwobble and I will get a nudge!

If you find my posts useful please consider donating something to a local charity or to the http://www.mndassociation.org/
B
64
S
34
G
47
Posts: 1,194
Reputation: 30,882

Post » Fri Jan 24, 2014 10:38 am

@RamPackWobble I'm curious, if you create a number variable and add an action "Add 1 to variable" from if On-screen event, it keeps adding 1 to infinity, isn't possible to regulate this like add 1 once time each sprite on screen?
B
99
S
35
G
29
Posts: 3,139
Reputation: 28,421

Post » Fri Jan 24, 2014 10:47 am

@joannesalfa after (is the on screen) event make a sub event with a for each bullet add 1 to variable ?
August 2015 - I misplaced a lot of links - I will try to find backups and repost. If You find a post that interests please reply to post with @rampackwobble and I will get a nudge!

If you find my posts useful please consider donating something to a local charity or to the http://www.mndassociation.org/
B
64
S
34
G
47
Posts: 1,194
Reputation: 30,882

Post » Fri Jan 24, 2014 10:54 am

Yes that works - counting how many on screen
August 2015 - I misplaced a lot of links - I will try to find backups and repost. If You find a post that interests please reply to post with @rampackwobble and I will get a nudge!

If you find my posts useful please consider donating something to a local charity or to the http://www.mndassociation.org/
B
64
S
34
G
47
Posts: 1,194
Reputation: 30,882

Post » Fri Jan 24, 2014 11:17 am

There is also the event condition under System "Object UID exists" so you can check if an object currently using that UID currently exists.
B
233
S
62
G
33
Posts: 902
Reputation: 40,398

Post » Fri Jan 24, 2014 11:21 am

And ofcourse you could use bullet.count to see how many instances of the bullet object exist on the layout.LittleStain2014-01-24 11:21:21
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 » Fri Jan 24, 2014 11:50 am

@RamPackWobble Good one! it really helps to this thread
B
99
S
35
G
29
Posts: 3,139
Reputation: 28,421

Post » Fri Jan 24, 2014 6:11 pm

aaa
edit.

Well is the 10 time I lost what i wrote...


thanks guys..

Bullet.count is not set as a graphical condition. The solution was to declare a constant 0 and to check if 0 is equal to Bullet.count. paala2014-01-24 18:13:32
[size=200]1. Best Construct 2 course :HERE.10$!

2. 155 games source codes for sale on scrira store 12,86$each. PM me if interested to speed up the uploading process.
[/size
B
34
S
8
G
4
Posts: 156
Reputation: 3,779

Post » Fri Jan 24, 2014 6:46 pm

System:Compare two values
    Bullet.Count = 0
ImageImageImage
B
71
S
22
G
242
Posts: 3,734
Reputation: 134,994

Next

Return to How do I....?

Who is online

Users browsing this forum: dop2000, Yahoo [Bot] and 28 guests