dop2000's Forum Posts

  • WackyToaster Thanks! This can actually be quite useful for making an Undo feature. Can it restore destroyed objects? :)

  • Alon

    It just feels like you are afraid of trying new things. You prefer to ask on the forum "what would happen if I do this or that", instead of simply testing yourself.

    Worst case scenario - something will not work, undo the changes and move on.

    .

    About the save size - have you tried viewing your ".alon" files? Create one object instance, save to .alon file. Then rename the file to .json and open it - you can upload it to any online JSON viewer website, or simply open with Firefox. You will see that there is nothing scary there, just some information about your layout, layers and object instances. You can actually find object's instance variables and their values, and will see how much space each variable is using.

    This can help you to get better understanding of how things work in Construct. Besides, you may find something in the file which will help you to optimize and decrease the save size, for example some objects that don't need to be saved.

  • WackyToaster Can't you do the same with AsJSON expression and Set from JSON action?

  • Is the system saving going to grow REALLY HUGE in size if I'll have MANY instances on the screen with the extra effect values changes per each that needs to be saved

    Why don't you simply test this? And why do you think other people should know this? :)

    Run the project, create 10-50-100-200 instances, see how big the save size is (you can check it in Browser log). Write it down.

    Add a bunch of instance variables, repeat the test, compare values.

  • Probably a stupid question, but did you put music into Music folder or into Sounds? Audio files in these folders are processed differently.

  • If you use "System Snapshot canvas" action, you should be able to use it again without any issues. If the second time you press the button it doesn't work, there must be some mistake in your events.

  • I see this question here a lot.. You can try zooming in to the textbox when keyboard opens, then zoom out.

    Or make your own keyboard and text box:

    construct.net/en/tutorials/mobile-keyboard-and-hall-of-fame-for-all-mobile-devices-738

    construct.net/en/tutorials/your-own-textbox-459

  • Clicking on ANY instance should "Remember" their current sliders values (if I changed any)

    You can set effect parameters, but you can't read them back from the sprite. So you need to store them somewhere in instance variables.

    When an instance is clicked, set sliders to values in these instance variables.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Sorry, I didn't notice you shared the capx in your earlier comment and made lots of wrong assumptions..

    Here is the fixed version:

    dropbox.com/s/46ck8jhsxsiuvwx/problem_fixed.capx

  • Yeah, that condition prevents crashing. That's why you should absolutely definitely keep it.

    But you should also try to minimize the number of unnecessary saves, it's up to you how you do it. To tell you the truth, I've lost track of your changes a long time ago.. :) You can add a cooldown period, wait for a pause in mouse wheel scrolling, or require holding Ctrl or some other keyboard button and save undo step when it's released. Or there may be other methods, I don't know.

    You can invent a system that monitors z-order of all objects and signals when it changes, but I don't think it will worth the effort.

  • Why don't you just add and test? You could have done it in time you spent typing your comment..

    I was telling you many-many times - you need to prevent multiple saves from running at the same time! Adding this condition to the function will do exactly that.

  • Add a condition "isUndoSave is NOT set" to the "SaveStep" function. This will guarantee that another save will not start until previous save has finished. If you are saving too often, or the save size is too big, some undo steps may be skipped, but this is a minor issue comparing to all the bugs you can have from multiple simultaneously running saves.

  • And I'm saying that even 0.3s is not enough, especially if you anticipate users will be adding lots of objects. I've seen save/load actions taking more than 5 seconds.

    You need to make a proper system that doesn't allow two or more saves running at the same time.

  • Why did you make the delay even smaller? This means saving lots of unnecessary undo steps. Not only it can cause bugs, but also will make it more difficult for user to undo.

    Sure it works great on your PC, but on an older machine with a slow HDD saving a big project may take much longer time.

    Regarding the number of steps - it depends on the average size of each save. Add some objects, open browser console, it should tell you the amount of data saved, in bytes. Multiply by the number of steps - that's how much memory the array will take.

    I doubt you will run out of memory even with 256 undo steps, but a very big array may be slow.

  • Note that this method waits for a pause in scrolling, which is not an ideal solution in your case. If you keep this timeout at 0.3s, for users who scroll slowly (when they want to precisely adjust object size), undo will be saved every 0.3 seconds, which is still too frequent.

    If you set a larger timeout like 1-2 seconds, undo step will be saved with a big delay, during which user may do something else, for example delete the object. And this again can cause the situation when two undo steps are saved at the same time.