Family problem?

Get help using Construct 2

Post » Mon Jul 22, 2013 2:13 pm

Hi there!

I was "coding" a system to make NPC's talk to you in a platformer. I though that it would be time saving putting all NPC's in a family and using family variables to retrieve the desired text from a dictionary object. The problem I'm having in the little prototype I did, is that for some reason only one of the two objects in the family is working.
What needs to happen is:

>on up arrow pressed
>player is overlaping (Family) = (Family) add 1 to (Value)

So every time the player presses UP a new line of dialog is displayed thanks to this next line of code:

Every Tick = Set Dialog(text) to (Dictionary)key(""&Family(value))


One of the Objects works perfectly, but the other does nothing. I checked every line of code 100 times and I cant find a mistake, I think is a limitation on how Family Instance Variables work.

Could someone check the .capx and tell me if there is a way to solve this?

Link: https://copy.com/f87MP4L2LWoJ

Thanks.
B
10
S
4
Posts: 133
Reputation: 1,543

Post » Mon Jul 22, 2013 2:27 pm

Hey there, not sure if this is the desired effect you want but here ya go:
https://dl.dropboxusercontent.com/u/7765312/C2/Dialog%20Prototype.capx
B
51
S
20
G
10
Posts: 571
Reputation: 9,819

Post » Mon Jul 22, 2013 3:07 pm

Thank you sooooo much!!! You did exactly what I was going to do (use the name and line values to set the dialogs) and it works perfectly!!!
B
10
S
4
Posts: 133
Reputation: 1,543

Post » Mon Jul 22, 2013 4:05 pm

No problem :D
B
51
S
20
G
10
Posts: 571
Reputation: 9,819


Return to How do I....?

Who is online

Users browsing this forum: tetuan and 10 guests