0 Favourites

How do I fix problem character map with spriter?

  • 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.

    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

  • Please provide a .capx of your whole project so we can understand the context of your code.

  • 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

  • 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: . He can be trusted with your .capx .

  • 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?

  • Construct 3

    Buy Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Buy Now Construct 3 users don't see these ads
  • With this event:

    *On Mouse left click on EnemyFamily

    *Pick noeliste.OwnerUID is equal to EnemyFamily.UID

    . ----------> noeliste .... Append character map to "tete2"

  • is that what you meant?

    that give me an error of loop anyway

  • is that what you meant?

    that give me an error of loop anyway

    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"

  • here is what I have

  • here is what I have

    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?

  • okay thanks.

    release 239

  • frayt - Here :

    There are no images or character maps on the scml file. It's only there to show the events. So don't expect an output but that should work.

  • I will check it, thanks you much for your work

  • hi, I was busy so I take time to check it. so here is the problem

    I still have the same problem, all the instance have the character's map enabled

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)