How to Retrieve Number of Alterable Values inside an Object?

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.
  • Hi I'm working on implementing a save system into my game using the INI object.

    In my frame I have dozens of objects that I've classified into specific qualifiers that will help categorize how each object's information is dealt with.


    So for one group of objects under a specific qualifier, I intend to loop over each alterable value/string/flag in that group and save it to a file.

    However, each object has a different number of alterable values, strings, and flags. Some have no flags or strings, but many alterable values, and others only have some flags, etc..

    So is it possible for clickteam to retrieve the number of said alterable values/strings/flags on an object through the event-action editor? I'm trying to determine how many times I should loop through and save each individual object's information inside a group.

  • For non-plus 2.5, you can have 26 named alterable values & 10 named alterable strings, usually it's enough to loop those times.
    If you are using the hidden unlimited alterable values (set & get by index, fusion will extend the array automatically), as the index is given by you in events so it's already known.

    You can also use this extension to save & restore alterable value & strings to & from base64.

    Please login to see this link.

  • Doesn't the INI object (and/or INI++ object) have a feature that basically does this for you? I'm pretty sure I remember a feature where you tell it to save an Active Object and it will store all its information in the ini, including position, scale, and the current values of all its Alterable Values. All you'd need to do is tell it which objects to save, and it would do the rest for you.

    Regardless of that, as defisym suggests, you can just run the loop 26 times, or 50 times, or whatever will cover all your bases, and it should be ok. Any unused altVals will just get saved as 0, and the process might add some unnecessary milliseconds to the save routine, but that shouldn't matter as long as you're not frequently saving during gameplay, which you probably aren't.

    Please login to see this link.
    My Fusion Tools: Please login to see this link. | Please login to see this link. | Please login to see this link.

    Edited once, last by Volnaiskra (June 28, 2023 at 7:04 AM).

  • Doesn't the INI object (and/or INI++ object) have a feature that basically does this for you? I'm pretty sure I remember a feature where you tell it to save an Active Object and it will store all its information in the ini, including position, scale, and the current values of all its Alterable Values. All you'd need to do is tell it which objects to save, and it would do the rest for you.

    Regardless of that, as defisym suggests, you can just run the loop 26 times, or 50 times, or whatever will cover all your bases, and it should be ok. Any unused altVals will just get saved as 0, and the process might add some unnecessary milliseconds to the save routine, but that shouldn't matter as long as you're not frequently saving during gameplay, which you probably aren't.

    Thanks guys for the help, I'm using the INI++ object now and you're correct that it has the option to save all the info regarding the object.

    I didn't know if saving and loading all possible alterable values of an object (even if they are not created) would bloat the frame info and lead to runtime issues, but apparently it's not an issue.

    I managed to get object info, counter values, and global values into a save file, now I just need to figure out how to save the active/inactive state of Event Groups in the event editor. Is there a built-in way to do that?

    Or should I use some external counters that save the state of these event groups as a workaround?

  • I don't think there's any way to record that information all in one go. I believe the Special Object has an 'is group activated?" condition though (not at a computer at the moment so can't check it, but I'm pretty sure) , so you could use that to record your groups' states one by one.

    Please login to see this link.
    My Fusion Tools: Please login to see this link. | Please login to see this link. | Please login to see this link.

  • I don't think there's any way to record that information all in one go. I believe the Special Object has an 'is group activated?" condition though (not at a computer at the moment so can't check it, but I'm pretty sure) , so you could use that to record your groups' states one by one.

    Okay, I think I'll make an object with an alterable value to record each event group that changes activation, and I'll save that info during the game's checkpoints, and when the frame is loaded in, I'll set each affected event group's status to be active/inactive based on it's corresponding alterable value.

    Thanks again

Participate now!

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