How do I deactivate instances when in a certain range?

Get help using Construct 2

Post » Thu Aug 06, 2015 6:36 am

Trying to cut down load time in the codes....

I get huge bottlenecks... 90% CPU.. I know for simple 1000 rts test it can be improved with

If object distance > frame deactivate

GAme maker has a deactivate instance out side of view... but i cant find it here?? does it need to be called in script??
B
2
Posts: 11
Reputation: 166

Post » Thu Aug 06, 2015 8:01 am

yea there is a distance expression distance(x1, y1, x2, y2) Calculate distance between to points
Image
B
28
S
11
G
2
Posts: 139
Reputation: 3,299

Post » Sun Aug 09, 2015 8:40 am

there is also an "Is on-screen" condition.

edit - looks like I might have this condition wrong - let me test it and get back to you :oops:

edit2 -

not sure where/if I am going wrong or if this is a bug in construct - I will leave it here for 24 hours for people with bigger brains to point out my mistake before I post it in the bug section... :?

simple capx test -https://onedrive.live.com/redir?resid=18F4A9008EF2B3E!4181&authkey=!ALAdp-NcZ9amZjI&ithint=file%2ccapx

Image

i
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,892

Post » Sun Aug 09, 2015 11:34 am

@RamPackWobble
Use "Set text to spEnimies.PickedCount" instead of "spEnimies.Count"
Image Image
B
26
S
15
G
143
Posts: 881
Reputation: 74,560

Post » Sun Aug 09, 2015 11:43 am

@MadSpy - of course, many thanks.

edit

(I've updated the capx above)

I had got it into my head that the spEnimies.Count would only count the spEnimies selected in the conditions on the left and had totally forgotten ( if I had ever known ) about needing to use PickedCount rather the just Count. I wonder how many other actions "ignore" the conditions set ?

I'm off to read the manual again :)
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,892


Return to How do I....?

Who is online

Users browsing this forum: grigrizljac, NN81 and 8 guests