Destroy Multiple Instances Between Frames?

Welcome to our brand new Clickteam Community Hub! We hope you will enjoy using the new features, which we will be further expanding in the coming months.

A few features including Passport are unavailable initially whilst we monitor stability of the new platform, we hope to bring these online very soon. Small issues will crop up following the import from our old system, including some message formatting, translation accuracy and other things.

Thank you for your patience whilst we've worked on this and we look forward to more exciting community developments soon!

Clickteam.
  • Hey,
    I'm working on an RPG where I have multiple instances of enemies that drop loot, then destroy the enemy. The issue I'm having is that I can't keep the enemy destroyed between frames. I've tried global values, but that just destroys all the enemies. I just need that one instance of the enemy to be permanently destroyed between frames, without getting rid of the other instances.
    Does anyone know how to do this?
    Thanks,
    TooTinyMan

  • u cud try giving each ememy a unique alterable value id number wen u create them & then creating an array that stores which enemies have been destroyed.

    fore example

    create an array (x,y,z), where x dimension is the number of enemies u want, y & z dimensions are both 1

    so say in this example we want 4 enemies, so u set the array to (4,1,1,) (also remember to tick on base index 1 in the array properties so the first array slot wud be 1,1,1 instead of 0,0,0 )

    walk onto screen

    if array (1,1,1)=0 then create enemy - set its alterable value "enemy_id" to 1
    if array (2,1,1)=0 then create enemy - set its alterable value "enemy_id" to 2
    if array (3,1,1)=0 then create enemy - set its alterable value "enemy_id" to 3
    if array (4,1,1)=0 then create enemy - set its alterable value "enemy_id" to 4

    u kill enemies 2 & 4 in game

    wen u kill an enemy set the array ("enemy_id",1,1) to 1, thats set to 1 which means that one is dead

    walk on another screen

    wen u walk back on to the previous screen the create enemy event lines 2 & 4 will be ignored cause that enemies array value is 1 so it will just create enemies 1 & 3

    that shud work in theory . good luck dude :)

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!