User Tag List

Results 1 to 4 of 4

Thread: Setting a Flag to an array value

  1. #1
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export ModuleXNA Export ModuleUnicode Add-on
    mobichan's Avatar
    Join Date
    Oct 2007
    Location
    Buffalo, NY
    Posts
    3,281
    Mentioned
    26 Post(s)
    Tagged
    0 Thread(s)

    Setting a Flag to an array value

    Is it possible to Set a Flag to a value in an array (0 or 1)? I basically am storing the Flag values of objects (when the game saves) so they can be loaded back into the objects at a later time (when the game loads). From what I can tell, there is no way to set a flag to an expression value. Also, this needs to be for all runtimes, so no crazy extensions.

  2. #2
    Clicker Fusion 2.5iOS Export Module
    lootercuster's Avatar
    Join Date
    Jan 2015
    Posts
    52
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You can use an alterable value instead of a flag. But since you may already be using different alterable values in different objects, you can use an alterable string that can either be "0" or "2". In this case, you should use a text array instead of a numeric array.

    But if that isn't possible, all you can do is do a for each loop for each flag# you need to save and have a condition that tests to see if the flag is on > store '1' to the array position. If you have a ton of flags, you're going to need to have multiple fastloops/foreach loops depending the # of flags for the objects. I think its totally ok to have a bunch of inefficient loops for saving since you only do it once right? Hope this helps!

  3. #3
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export ModuleXNA Export ModuleUnicode Add-on
    mobichan's Avatar
    Join Date
    Oct 2007
    Location
    Buffalo, NY
    Posts
    3,281
    Mentioned
    26 Post(s)
    Tagged
    0 Thread(s)
    The problem isn't the storing of the ON or OFF, since F2.5 already lets you retreive a Flag as a 0 or 1. The problem was setting a Flag to an integer (0 or 1).

    My current solution is to assume all Flags are OFF by default (since this only loads at the Start of Frame) and do a comparison for each flag like so:

    +Start of Frame
    --Set String Parser string to Array string (each array entry holds all flag values for one object)
    --Start Loop "check" (# of objects) times

    +On loop "check"
    +ID (object) = LoopIndex("check")
    +ListGetAt$ (1)= "1"
    --Set (object)Flag (LoopIndex("check") to ON

    +On loop "check"
    +ID (object) = LoopIndex("check")
    +ListGetAt$ (2)= "1"
    --Set (object)Flag (LoopIndex("check") to ON

    etc... incrementing the element index of the string parser comparison for each additional flag. I only have 7 Flags to compare for each object, but it still feels like bloat.

  4. #4
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export Module
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)

    Join Date
    Apr 2007
    Location
    Australia
    Posts
    1,151
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    This is the only way to do it at the moment unfortunately

Similar Threads

  1. Flag limit / flag values looping
    By butterfingers in forum Multimedia Fusion 2 - Technical Support
    Replies: 5
    Last Post: 2nd October 2014, 11:03 PM
  2. Add values to Array without setting X and Y
    By Boba Fonts in forum Multimedia Fusion 2 - Technical Support
    Replies: 7
    Last Post: 12th March 2012, 11:58 PM
  3. I need more flag
    By MEHRDAD in forum Multimedia Fusion 2 - Technical Support
    Replies: 24
    Last Post: 23rd January 2012, 06:37 PM
  4. What is flag?
    By Nyc in forum Multimedia Fusion 2 - Technical Support
    Replies: 4
    Last Post: 9th June 2011, 02:49 PM
  5. (Dynamic Array) Setting Keys & Bricks & Lighting
    By Doc4 in forum Multimedia Fusion 2 - Technical Support
    Replies: 11
    Last Post: 24th November 2007, 04:12 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •