How to pick a member of a family

Get help using Construct 2

Post » Sat Feb 22, 2014 11:08 am

Image
(dropbox link is here: https://www.dropbox.com/s/5zl3iwbj0lwbd ... tabase.png if you can't see the pic)

please look at event no 68

In that screenshot CharactersDatabase is a family of dictionary of characters status to be used in battle. What I want is to pick data of character's stats once I know the name (from playerbattle scml family).
When CharactersDatabase only consists of one dictionary, my code works just fine. The problem arise when I have more than one character to fight in a battle scene. The enemy is only able to hurt / damage the character which is the member index #0 from CharactersDatabase family (I check this from debug view)

So what I want to ask is, is there any way of like, iterating the members of a family? or something like that? thanks

(I want to attach the capx but it have more than 500 events, and only this one that bugs me, so I think I'd rather not)
B
45
S
13
G
2
Posts: 173
Reputation: 5,331

Post » Sat Feb 22, 2014 11:12 am

System => Pick

event
Pick by evaluate famobject : famobject.name = "thenameyouneed"
action
do something with famobject
B
57
S
17
G
21
Posts: 1,878
Reputation: 19,572

Post » Sat Feb 22, 2014 11:57 am

thank you lennaert, that works :D
B
45
S
13
G
2
Posts: 173
Reputation: 5,331


Return to How do I....?

Who is online

Users browsing this forum: brunopalermo, dand, tinhofiel and 31 guests