How do I fix problem character map with spriter?

Get help using Construct 2

Post » Wed Nov 09, 2016 11:59 am

hi,

I'm working on a shooter game with Spriter and I have some problem with character map that I don't understand how it works.
http://image.noelshack.com/fichiers/201 ... -titre.png

as you can see on the screen, when I click on the ennemy , I want them their faces explode by changing the character map which will change the head of the ennemy that'I ve clicked on.

but here is the problem, construct 2 change the head of all instance that has been created when I click over one instance of EnnemyFamilly.

how can a fix that?

thank you
B
9
S
3
Posts: 56
Reputation: 1,003

Post » Wed Nov 09, 2016 3:18 pm

Please provide a .capx of your whole project so we can understand the context of your code.
"We can't solve problems by using the same kind of thinking we used when we created them."
- Albert Einstein
B
27
S
11
G
8
Posts: 528
Reputation: 7,091

Post » Wed Nov 09, 2016 5:20 pm

I just wanna link a character map with just one instance of the object
And what's happend with the event on the screen is that the event use character map with all instance of the object.

I can't link a capx for now
here it is :

1= spriter
2= spriter with character map enabled

11111111
22222222

what I want

1111112111

I want just one instance character map enabled, when I click on it.
but when I click on one instance, all the others instance had character map enabled
B
9
S
3
Posts: 56
Reputation: 1,003

Post » Wed Nov 09, 2016 5:35 pm

@frayt - The answer is quite simple actually. Remove the "for each" condition. And then you are done. The character map will only change to the EnemyCharacter that is selected.

Hmm.... But assigning each scml, It's not that simple anymore... You need to add an instance variable for the scml... For example, ''ownerUID''. And that ownerUID instance variable set it to the enemycharacter's UID that it belongs to. I suggest using 'For Each' on that process.

I believe this will be easier with a .capx . I'll do it for you if you want but i will still need a .capx . You can PM me or if it's too confidential you can contact @lucid (Spriter Developer) here: spriter-c2-update-11-2-bug-fix-for-performance-mode_t75748 . He can be trusted with your .capx .
The Things you can create is only limited by your imagination. If you don't have the skills then use your motivation as a natural force to exceed all expectations. Chadori RebornXD
B
65
S
21
G
90
Posts: 1,124
Reputation: 59,862

Post » Wed Nov 09, 2016 6:54 pm

okay now I have an instance variable with the UID of each object
how can I associate a left click on the instance with his UID to enable character map for this one?
B
9
S
3
Posts: 56
Reputation: 1,003

Post » Wed Nov 09, 2016 6:58 pm

With this event:

*On Mouse left click on EnemyFamily
*Pick noeliste.OwnerUID is equal to EnemyFamily.UID
. ----------> noeliste .... Append character map to "tete2"
The Things you can create is only limited by your imagination. If you don't have the skills then use your motivation as a natural force to exceed all expectations. Chadori RebornXD
B
65
S
21
G
90
Posts: 1,124
Reputation: 59,862

Post » Wed Nov 09, 2016 7:09 pm

is that what you meant?
http://image.noelshack.com/fichiers/201 ... -titre.png

that give me an error of loop anyway :lol:
B
9
S
3
Posts: 56
Reputation: 1,003

Post » Wed Nov 09, 2016 7:17 pm

frayt wrote:is that what you meant?
http://image.noelshack.com/fichiers/201 ... -titre.png

that give me an error of loop anyway :lol:




No never put triggers under loops. That will give an error.

Follow my events below:

Assuming on creation of Enemycharacter, we also create the "noeliste"(scml) so that we can mark them each...


*On EnemyFamily created
. -------------------> Create Object (noeliste) at (EnemyFamily.X, EnemyFamily.Y)
. -------------------> noeliste set OwnerUID to (EnemyFamily.UID)


*On Mouse left click on EnemyFamily
*Pick noeliste.OwnerUID is equal to EnemyFamily.UID
. --------------------> noeliste .... Append character map to "tete2"[/b]
The Things you can create is only limited by your imagination. If you don't have the skills then use your motivation as a natural force to exceed all expectations. Chadori RebornXD
B
65
S
21
G
90
Posts: 1,124
Reputation: 59,862

Post » Wed Nov 09, 2016 7:44 pm

B
9
S
3
Posts: 56
Reputation: 1,003

Post » Wed Nov 09, 2016 7:49 pm



Wait... What are you trying to achieve? That's different from what i gave.

I'll just make a sample .capx...

What version of C2 are you using?
The Things you can create is only limited by your imagination. If you don't have the skills then use your motivation as a natural force to exceed all expectations. Chadori RebornXD
B
65
S
21
G
90
Posts: 1,124
Reputation: 59,862

Next

Return to How do I....?

Who is online

Users browsing this forum: No registered users and 22 guests