Fixed values are not unique

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.
  • I've got a project where the player can walk back and forth between areas (frames), just like Zelda or Metroid.
    Now I want to store the enemies that have been killed, so that the player won't have to fight them again each time they walk back and forth between areas.
    I do this by giving each enemy an ID and adding that ID to a list or array. Then I destroy that enemy when the frame loads and its ID is present in the list or array.

    The enemy ID is set from its "fixed value". I thought this value would always be unique, but I guess it is not when I load different areas from external files into the same frame.

    Are there any tricks to keep the fixed value unique in this case?
    I could add a second set of numbers to the enemy ID based on the different areas, but this would add another layer of complexity I would like to avoid if possible.

  • Hmm.. I don' really get the scenario you described but, as far as I know/guess, the FixeValue is indeed unique, as long you don't load a new frame, which will wipe out all the objects and variables of the previous one.

    The global variables are persistent when you load other frames thought.

    I would use Layers instead of frames. This way all the Fixed Values are retained and unique because the frame does not change.

    An alternative to Fixed Values would be the use of a timestamp. An ID like yyMMddhhmmss ( yy= year, MM = month, etc. ) would be certainly unique.

    I'm confident tgat an ID made of Day,hour,minute,second and milliseconds would also work.

  • Yeah I guess that is the problem, I do reload the frame when I load a new map. The fixed values are then not possible without adding another set of numbers.

    Each map has a name/string. So I could try to turn each letter of that string into a number, then add it to the fixed value. It could work, but would add a lot more complexity.

  • IIRC fixed value is combination of object offset in object list and creinion id, so it will loop and not always unique.

    I forget if objects in frame (aka not created during runtime)'s fixed is unique or not, but those are usually much smaller than runtime created as the creation id is low at that time.

Participate now!

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