User Tag List

Page 1 of 2 1 2 LastLast
Results 1 to 10 of 12

Thread: comparing value of an object to a vale in an array table

  1. #1
    No Products Registered

    Join Date
    Dec 2010
    Posts
    64
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    comparing value of an object to a vale in an array table

    I have multiple objects of the same kind storing different values in an array table for convenience and since it apparently is faster than fast looping and comparing alterable values. whenever I compare a value in the array table to an object though, it will only apply it to the last created type of the object. fast loops do not seem to fix it either. is there a way I can compare a value in an array table to other objects including the last created one?

  2. #2
    Clicker Multimedia Fusion 2 DeveloperSWF Export Module
    TheSynapse's Avatar
    Join Date
    Jun 2011
    Location
    London, UK
    Posts
    100
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Have you tried using spread values in your objects so that you can pick out which one you want to compare the values in your array to?

  3. #3
    No Products Registered

    Join Date
    Dec 2010
    Posts
    64
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by TheSynapse View Post
    Have you tried using spread values in your objects so that you can pick out which one you want to compare the values in your array to?
    yes, one of the first things i did. i did that to write the proper values into the array table by looping through the specified spread value, but doing it to compare the values only applies to the last object created.

  4. #4
    Clicker Fusion 2.5iOS 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)
    SolarB's Avatar
    Join Date
    Feb 2012
    Location
    Melbourne
    Posts
    903
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)
    Have you looked at these post?

    http://community.clickteam.com/showthread.php?t=70136

    http://community.clickteam.com/showthread.php?t=70201

    The only way to compare each object's id value to its array is to fastloop through them:

    on loop
    +id = loopindex 'loop'
    +valueatxy (id, index) = value
    --> do stuff

  5. #5
    No Products Registered

    Join Date
    Dec 2010
    Posts
    64
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by SolarB View Post
    Have you looked at these post?

    http://community.clickteam.com/showthread.php?t=70136

    http://community.clickteam.com/showthread.php?t=70201

    The only way to compare each object's id value to its array is to fastloop through them:

    on loop
    +id = loopindex 'loop'
    +valueatxy (id, index) = value
    --> do stuff
    exactly what i did. based on the spread value it was writing lines towards the X with values into the array table. writing in by using a loop like that was fine, reading the value off the array with the proper conditions set or not doesn't yield a result except for the last created object.

  6. #6
    Clicker Fusion 2.5iOS 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)
    SolarB's Avatar
    Join Date
    Feb 2012
    Location
    Melbourne
    Posts
    903
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)
    have a look at this:

    arrayvalues.mfa

    works fine.

    if you're still having trouble post an example mfa and I can take a look. hope this helps.

  7. #7
    Clicker Fusion 2.5 Developer

    Join Date
    Jul 2008
    Posts
    1,295
    Mentioned
    8 Post(s)
    Tagged
    0 Thread(s)
    You need to use fastloops to save objects' values to an array, but you do NOT need to use them when reading values from an array. You can just say:

    + Whenever...
    -> Spread value 0 in ID

    + Whenever...
    -> Object: set SomeValue to ValueAtXY("Array", ID("Object"), 0 )

    + Object: SomeValue = Something
    -> Do something...

  8. #8
    No Products Registered

    Join Date
    Dec 2010
    Posts
    64
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by SolarB View Post
    have a look at this:

    arrayvalues.mfa

    works fine.

    if you're still having trouble post an example mfa and I can take a look. hope this helps.
    this helps, thanks. I was comparing two general values and I guess that doesn't work the same as doing a straight comparison of a value to the loop index.

    only issue now is that doing the fast loop through all the objects is heavily slowing the application down.

  9. #9
    Clicker Fusion 2.5iOS 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)
    SolarB's Avatar
    Join Date
    Feb 2012
    Location
    Melbourne
    Posts
    903
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)
    Did you try MuddyMole's suggestion above? This may help.

  10. #10
    Clicker Multimedia Fusion 2 DeveloperiOS 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)
    King_Cool's Avatar
    Join Date
    Aug 2008
    Posts
    2,335
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Brawltaunts22, i struggeled with the same thing a coupple of weeks ago.

    It is fully possible for multiple Instances to have their own personal data like multiple values or strings stored in an single Array.
    You can easily acomplish this, and each Instance will be able to 'read' and apply their personal data from the single Array. You do this without using loops of any kind.

    However, the Instances are unable to 'write' ( add, subtract, set ) their personal data to the Array through, lets say, a Collision event or any other kind of event without using a loop.
    ...

    But i am pretty sure there is a way around this.

    My theory is that by creating an Array whenever an Instance is created, each Instance will be able to have their own personal extended data storage ( Array ) wich they can read from and write to.
    Much like the example ( by Nifflas i think ) where a new 'Platform Movement Object' would be created whenever a new enemy or player would spawn in.

Page 1 of 2 1 2 LastLast

Similar Threads

  1. Array Lookup Table for extended Alterable Values for Actives
    By King_Cool in forum Multimedia Fusion 2 - Technical Support
    Replies: 14
    Last Post: 1st April 2012, 04:06 PM
  2. Array/Table save and load in LUA
    By zellix in forum Lua Scripting
    Replies: 12
    Last Post: 11th February 2010, 02:19 PM
  3. Which Object For Player Table Creation
    By drnebula in forum Multimedia Fusion 2 - Technical Support
    Replies: 0
    Last Post: 26th November 2009, 01:32 PM
  4. Checking and comparing values of an object.
    By DEKE15 in forum Multimedia Fusion 2 - Technical Support
    Replies: 3
    Last Post: 10th May 2009, 10:47 PM
  5. How to retrive an SQL table with ODBC object?
    By Locaz00 in forum Multimedia Fusion 2 - Technical Support
    Replies: 0
    Last Post: 11th March 2009, 11:43 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
  •