Doctor, Who can help me see ?

Get help using Construct 2

Post » Thu Jan 09, 2014 12:34 pm

not too sure about the title - amused me when I thought of it but now I'm not too sure...

Been playing around with line of sight and trying (unsuccessfully) to get multiple instances of the same sprite to be able to see if they can see the other copies of themselves, see ?

I've come up with one way which works but I've done it by pinning a line of sight sprite (eyes) to each of my copies and using these "eyes" to see the other copies. What I wanted to do was use the "line of site" behaviour directly on my copies.

This is all @RapidTom s fault - he started me off with his question

Here's hoping that someone can come up with a more elegant solution

almost forgot the capx

and a screen grab.

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
33
G
47
Posts: 1,194
Reputation: 30,832

Post » Thu Jan 09, 2014 1:25 pm

Could you use families for this?

so put the spplayerpiece in a family called spfamily.

and check for each spplayerpiece if they have line of sight to the family.

I know it works in other cases to compare instances with eachother, maybe it will work here too.
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 » Thu Jan 09, 2014 2:19 pm

I did this a while ago for someone asking a similar question, i've modified it to be more relevant here. hope it helps..

it uses the family method of picking separate instances of the same object at once

https://dl.dropboxusercontent.com/u/53374990/Forum/LOS%2Bteams/01/LOS.capx
B
28
S
8
G
1
Posts: 469
Reputation: 4,683

Post » Thu Jan 09, 2014 2:51 pm

Thankyou for your replies.

@LittleStain - your push sent me in the right direction - and I managed to get there !

@Keepee - you went about it a different way I think (sorry I've not had a proper look at your capx yet but first glace says differently (and probably better)

Thanks again

edit -
capx

edit 2 - Updated the Capx with correct (possibly not politically correct) comments.RamPackWobble2014-01-09 15:18:26
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
33
G
47
Posts: 1,194
Reputation: 30,832

Post » Thu Jan 09, 2014 4:27 pm

it's basically the same actually, mine only adds a few things that you probably don't need

it counts the amount of body's it sees, and it excludes 'allies' on the same team. (the enemy count is shown with the animation frame, and the teams are done with the coloured animations themselves)
B
28
S
8
G
1
Posts: 469
Reputation: 4,683

Post » Thu Jan 09, 2014 8:52 pm

yes, of course, you are correct.

I like the use of colours/shades. A good idea - prepare to be plagiarised !

Thanks 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
33
G
47
Posts: 1,194
Reputation: 30,832


Return to How do I....?

Who is online

Users browsing this forum: evillair and 12 guests