User Tag List

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

Thread: Save more object in array with loop function part2

  1. #1
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleXNA Export Module
    daniele's Avatar
    Join Date
    Nov 2007
    Location
    italy
    Posts
    413
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)

    Smile Save more object in array with loop function part2

    sorry for double post, but on the old one did not give me any answer for second problem. also sorry for my bad english.

    hello, sorry for my insistence, but for me this is very important because I need to insert an 'other object in my save file. I have done several tests, but I believe that the solution is different. I'm also able to save the 'other object in my array with an' other loop, and it works well, but happen this bug:
    when I load the values​​, the objects are placed in their positions and also their animations, but the objects in total, are double.
    please, I can not continue without that save and only you, can you help me in this forum. I am attaching the file where no save of the second part, some expert can help me, it would be a great help for me. otherwise, I can not continue my program because saving is the most important thing.
    regards
    Attached files Attached files

  2. #2
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleXNA Export Module
    daniele's Avatar
    Join Date
    Nov 2007
    Location
    italy
    Posts
    413
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)

    Unhappy

    Quote Originally Posted by daniele View Post
    sorry for double post, but on the old one did not give me any answer for second problem. also sorry for my bad english.

    hello, sorry for my insistence, but for me this is very important because I need to insert an 'other object in my save file. I have done several tests, but I believe that the solution is different. I'm also able to save the 'other object in my array with an' other loop, and it works well, but happen this bug:
    when I load the values​​, the objects are placed in their positions and also their animations, but the objects in total, are double.
    please, I can not continue without that save and only you, can you help me in this forum. I am attaching the file where no save of the second part, some expert can help me, it would be a great help for me. otherwise, I can not continue my program because saving is the most important thing.
    regards
    Help me please???

    I tried it for two days, but I always find a bug. I can not even save the 'other active objects and their clones. I pray you, for you I think it's simple, I do not know very well array, but I have understand how save with fastloop. My problem is to add a 'different object. I had 45 visits and no one gave me advice. If you do not want to complete my example it is good, you can at least tell me how to do? I'm desperate :-(

  3. #3
    Forum Moderator

    Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleUniversal Windows Platform Export ModuleSWF Export ModuleXNA Export ModuleInstall Creator Pro
    nivram's Avatar
    Join Date
    Jul 2006
    Location
    Bandon, Oregon
    Posts
    6,773
    Mentioned
    12 Post(s)
    Tagged
    0 Thread(s)
    Would my open source World Edit example help? It is on my website.

    Marv
    ​458 TGF to CTF 2.5+ Examples and games
    http://www.castles-of-britain.com/mmf2examples.htm

  4. #4
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleXNA Export Module
    daniele's Avatar
    Join Date
    Nov 2007
    Location
    italy
    Posts
    413
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by nivram View Post
    Would my open source World Edit example help? It is on my website.

    Marv

    I know all your tutorial , I downloaded them all and have been of great help to me , but I have not found something similar to mine.

  5. #5
    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
    904
    Mentioned
    6 Post(s)
    Tagged
    0 Thread(s)
    I hope this is what you're after:

    load and save array object2.mfa


    More info in the mfa.

  6. #6
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleXNA Export Module
    daniele's Avatar
    Join Date
    Nov 2007
    Location
    italy
    Posts
    413
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by SolarB View Post
    I hope this is what you're after:

    load and save array object2.mfa


    More info in the mfa.
    Thanks for your example, but not work.
    I save the object, but not load and position. "0" object create after load...why?
    Why you have used Z in array? I need only bidimentional array (x and y)
    x1 to x20 write all variable switch x21...x40 write all string switch x41 write all object switch x42...x80 write all variabile global and other parameters (pathway photo and more) x81 to x100 write all variable SQUARE x101...x120 write all string SQUARE x121 write all object SQUARE
    Y1 X1 FOR object id1
    y2 X1 FOR Object id2 ectc..ù
    Z Not important...

  7. #7
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleiOS Export Module
    rubes's Avatar
    Join Date
    May 2011
    Posts
    367
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I didn't see anything in code that would write the information for the boxes to the array. I've attempted to fix this, but there is a slight bug in my code, and i'm not sure where. If you just add boxes, no switches, it will save and load them. If you add switches, the boxes don't load, but I'm not sure why.

    I am writing to column 10 a 1 if it is a switch and a 2 if it is a box, so that when you load the array, based on that value, it will know what type of object to create.

    I'm stuck troubleshooting my own issues with my app now, and I can't determine why this isn't working with both, but hopefully this will give you an approach you can take to do this
    Attached files Attached files

  8. #8
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleXNA Export Module
    daniele's Avatar
    Join Date
    Nov 2007
    Location
    italy
    Posts
    413
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    Thanks Rubes
    I created a modifcation to last mfa that I have created where the saving was working only for the switch.
    I also created the saving of square, but if I have 3 switches and 3 squares at the end of the load, I have a total of 9 items. it seems that all is well because the copies are overlapping to 'last object created, and at the first sight, it seems that the save went well. I think we have to use a variable on the switches and their square that identifies who they are. the variable is not id, because that value is the number of objects. you have to create a variable that defines the switch and the square.

  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
    904
    Mentioned
    6 Post(s)
    Tagged
    0 Thread(s)
    Rubes I'm afraid your method doesn't work because you are overwriting X,10 with value 2 directly after writing value 1 to the same X.

    Since it seems that Array does not like to mix and match XY and XYZ so I have stored the number of objects in Array(99,ObjectType,0) and now it will load properly.

    Daniele I have used XYZ since you are using more than one active. Using one active with directions/animation frames set to switch/box would be much easier since you would only have to run a fastloop that would create one object and then you could set it to switch or box, etc. and you would not need the Z dimension. However since I see you have already used directions for different sized models (of course you could use the 'scale' function if you wanted to resize) it was necessary to designate DimX as the type of object ie. switch/box (set in its variable 'ObjectType' upon creation as you point out in your last post - see near top of mfa), then the ID of the object as DimY (to be loaded by LoopIndex in the relevant fastloop), and DimZ (2, 3 and 4, as you have in your values) as Xpos (2), Ypos (3) and MODEL_SWITCH (4).

    The 3D array:

    X(Type) Y(ID) Z(xpos=1, ypos=2, colour/direction/variable=3) VALUE that is written to this position
    0 0 2 Xpos of first Switch
    0 0 3 Ypos of first Switch
    0 0 4 Colour of first Switch
    0 1 2 Xpos of second Switch
    0 1 3 Ypos of second Switch
    0 1 4 Colour of second Switch
    etc.
    1 0 2 Xpos of first Box
    1 0 3 Ypos of first Box
    1 0 4 Colour of first Box
    ...and so on.


    This way it will be easy for you (if you want) to have as many types of actives as you want AND as many of each type as you need AND as many variables and other values for each active as MMF can handle. You would just need to add more loops of similar nature to the LOAD group.

    Of course there may still be a more efficient way of doing this, if so, please chime in y'all!


    working MFA:

    load and save array object3.mfa

  10. #10
    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
    904
    Mentioned
    6 Post(s)
    Tagged
    0 Thread(s)
    PS. I read your post again and tried what you said and it works but it's still buggy and very fiddly. It won't load anything if you try and load without closing the app but it will once you restart it, I don't know why. If you really don't need the expandability offered by the above method then this solution may be a possibility, but I personally wouldn't recommend it.

    Also unfortunately Array does not support writing values and strings at the same time, you would need to use another array set to strings, or store all values in one string array, eg. Write (str$(alt value x(active))) to Array(x,y), then retrieve them using Set Alt Val X("active") to Val(StrAtXY( "Array", X, Y)).


    load and save array object yindex.mfa

Page 1 of 2 1 2 LastLast

Similar Threads

  1. Replace a function with a loop!
    By ogrgkyle in forum Android Export Module Version 2.0
    Replies: 2
    Last Post: 28th October 2013, 09:05 PM
  2. Help with save all variables function
    By SevenSails in forum Multimedia Fusion 2 - Technical Support
    Replies: 7
    Last Post: 20th December 2012, 10:39 PM
  3. [Question] Array object/recommended to save a game?
    By kusa in forum Android Export Module Version 2.0
    Replies: 5
    Last Post: 14th September 2012, 10:59 PM
  4. Super Function vs Fast Loop
    By ASD in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 28th June 2010, 06:47 PM
  5. Start loop as an object's action, like a function?
    By RedHades in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 14th April 2007, 03:26 PM

Posting Permissions

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