Saving Unique File... But only few times? - (project bug)

0 favourites
From the Asset Store
Convert multiple Excel files into JSON files and import them into construct3.
  • Like I said, you need to disable the Undo system completely and test saving feature. If it works correctly without the Undo, then you will know where to look for the problem.

    And of course, if you are not calling "SaveStep" function, then undo won't work.

    So I don't need to mess with anything like the "Set isUndoSave=false" if I want to shut-it down for who knows what events I'll need to SKIP/IGNORE the undo and bring it back?

    That's where I'm confused, I better won't touch it... but I would like to know if that's it's purpose, Enable/Disable the Undo/Redo system? because if it is, it's pretty useful!

    .

    Try clicking anywhere on an empty space, hold the mouse button, move cursor to your sprite button and release. It will work as if the button was clicked.

    It's not, it was before I added the event that it must be overlapping the button and released.

    So it works exactly like if you'll click and hold on a button on any application then move around to another space and release, it's like canceling or more like decided to NOT click it.

    that's what I tried to show on the animated gif, but it's impossible hehe.

  • try this:

  • I know what you mean LOL! but I'm telling you it's not working if I'll drag out and click...

    I don't know how to explain it, let me try:

    Click on your Browser "FILE" and DON'T release, now drag your mouse to another place THEN Release it... it won't execute the button! that's exactly how it works for me, not sure how to explain it better.

    There is no issue with it (yet), it works perfect (not from empty space like you show on the image)

    It's hard to show it on video but this is EXACTLY what I'm doing I'm clicking and then moving aside and releasing the left mouse button:

    I know what you mean, FROM empty space to BUTTON it execute, but it's no issue.

    Should it make issues?? maybe for overlapping the objects if that's what you mean, I'm not sure if I understood but I think you're on an upcoming issue ahead of me! oh no... any suggestions for efficiency beside just CLICK the object?

    because that way it won't let me have the current "effect" of overlapping while holding the mouse button, it will execute immediately.

  • Well, if you are saying your buttons work correctly, it's good :)

  • I run into a weird bug that I cannot understand why it's even happening.

    Describing the issue:

    1. When the mouse cursor is over an instance, when I scroll the mouse wheel UP or DOWN "here and there" everything is fine. on the console (F12) I can see it saves the undo on every scroll:

    2. Scrolling over an instance REAL FAST UP or DOWN will do something strange:

    it opens the "SAVE dialog" emulating the same as I press the button "Btn_Save" which have NOTHING to do with over instance or the mouse wheel at all... Where is that coming from?!

    In this example, I scroll fast over an instance, after few seconds doing that, it creates 2 saves and open the save dialog:

    3. When I scroll over an instance REAL FAST (about the same speed of scrolling a long website) for more than few seconds it saves so many times so the UNDO probably can't handle it and it cause crashing (issue #2)

    Note: The above are ALL THE EVENTS related to Mouse Cursor over an instance while scrolling wheel up/down on my project.

    Everything works fine if I just scroll mouse wheel up/down on other objects than the "Created_Object" instances. I do have other actions for scroll wheel combine with other keyboard buttons but none of these creating the bug I described.

    In order to understand and learn a something, I have some questions:

    1. How in the world, the wheel up/down over an instance even related to the SAVE event?

    2. How do I... BLOCK / IMMUNE from this weird thing to happen? or make it "SAFE" from not happening?

    3. How do I FORCE the Undo function: SaveStep to slow-down or happens less times per action?

    I'm VERY curious about this bug and hopefully I can learn something new, if anyone can please answer my questions above and explain it to me (don't forget I'm a noob... please be gentle).

  • Like I mentioned many times, you should avoid saving undo steps too often. Multiple saves are triggered too fast, one finishes and resets the boolean flag, another finished a moment later when the flag is already false and that's why it triggers your "Save as file" event.

    You can add some kind of cooldown period after each undo save, during which you ignore "SaveStep" function calls.

  • Thanks for the reply, yes I do understand that but how it trigger specifically the SAVE (out of any other events that are before it) still doesn't make any sense to me, BUT! I don't care as long as I can solve the speed issue so it doesn't matter anyway.

    What I need is faster speed (if not as normal as other softwares):

    For example, if you press any key in the fastest possible way in any average Windows Software, you won't get such errors or crashes, right? Yes, I'm guess it's probably because of a different way it works and since I'm not a programmer, I'm not even trying to understand this.

    But THIS is what I'm trying to achieve a normal functioning action and still save it to the undo/redo.

    It is good to understand the the limitation of the Save too often in Construct 3, it seems like I need a good solution to this problem because it can't serve anyone if it's too slow, nobody will wait.. to the next action of whatever they do on a creative software it's not possible to create in slow rate.

    THE QUESTION IS:

    How do I cool it down so the saves won't clash but at least... cool down for few milliseconds?

    And will cool-down be enough to solve it or 50/50 solution? if Construct 3 project just can't handle a normal-speed UNDO/REDO I just failed big time working on my project... which is very sad for me.

    Of course I would like to know the limits of the engine I'm using after all.

    As you can see on the screenshots above: I tried "wait for previous actions to complete" because I thought maybe if it will FINISH the "task" then the undo will be saved without put a specific amount of milliseconds so it won't be RISKY for other machines. and as you understand it this try failed. (I tried to put it BEFORE and AFTER the SaveStep)

    Will "WAIT" action do the job or it will still work differently on every machine and be risky?

    If so... WHERE do I put these to test if it works?

    With all the understanding of slowing saves to slot, What is the most efficient (and SAFE) solution to the current UNDO/REDO system if there is any at all?

    Thanks ahead for the help, I'm very curious about this all thing! :)

  • One thing I definitely don't recommend using with Undo system is WAIT action, it will add more bugs and problems.

    Saving/loading time depends on the amount of data. If you are saving lots of objects, it can take several seconds on slow machines.

    The correct solution is to not save a new undo step until previous save has completed.

    Also, save only one undo step after user finished resizing the object. Saving dozens of steps for one resizing operation is a bad idea anyway, because users will have to press Ctrl-Z many times to undo them, and the total number of steps is limited.

    Of course other software are using different methods for undo, you are welcome to try some other system if this doesn't work for you.

  • The correct solution is to not save a new undo step until previous save has completed.

    From my tries, it didn't work with the "Wait for previous actions to complete" so what's the alternative way to do it?

    Of course other software are using different methods for undo, you are welcome to try some other system if this doesn't work for you.

    Unfortunately, I don't even know what are the alternative systems to emulate a safer or more efficient undo/redo system so I don't think it's an option I can go for.

    Beside that, I must be honest: not only that I LOVE the current UNDO/REDO system thanks to you of course (I appreciate it A LOT!) so far EVERYTHING I tested works GREAT! but ONLY THIS specific annoying fast-wheel issue which make things go nuts... users will have so many crashes and random SAVE appears from nowhere.

    Also, save only one undo step after user finished resizing the object. Saving dozens of steps for one resizing operation is a bad idea anyway

    This is how most of my other actions works, on release key it calls: "SaveStep" function so it's very safe.

    But the Mouse Wheel actions have no "on release" or something close because it's not a keyboard of course.. I wish it has after or per one-sliding or something... that could solve the issue EASY! (I can only dream for such features hehe)

    The only Temporary Fix which is not an actual solution is to hold a key while scrolling so it will call the "SaveStep" function only when releasing it. the reason it's the ideal a solution is because I need to add another key instead of just using the scroll freely without holding any any extra key (waste of use).

    Isn't there a other way to somehow LIMIT or Slowing-Down the current code on the wheel up/down over instances?

    Thanks ahead! any help is more than welcome and very appreciated! :)

  • You can change the controls you use to scale objects. Make it Ctrl+Wheel for example, and save undo step on Ctrl released.

  • You can change the controls you use to scale objects. Make it Ctrl+Wheel for example, and save undo step on Ctrl released.

    Yeah, I it's the only temporary fix I had in mind and it's a waste of use for the wheel alone, but I'll just have to hold a key and use the wheel for something that doesn't need an undo.

    Also, it will create an Undo if I'll just release the CTRL by itself which is not ideal.

    I wish we had an extra addon or plugin or a feature for extra action such as: "on Finish Wheel Scroll UP" (or Down) I could use that for so many other things on my software not even related to this specific issue that's for sure but oh well... WE DON'T have such feature! lol :)

  • It hard to say whats wrong without an example project, but in case you still didn't solve a problem I suggest you to start from scratch (I mean not from a complete scratch of course). Backup your original project first, just_in_case, then delete all save/load events, buttons and probably undo/redo related events.

    Start from buttons (do not implement button hover animation, forget about it for a while) events, then save/load system and at the end undo/redo. Then try to use normal events like "On click"/"On object clicked" (instead of mouse release and overlap/hover combo), remove all "wait for previous" actions and replace them with triggers (for example, when Ajax requests file, create Ajax "on complete" trigger event and etc). Next thing I personally don't like (and never ever use events like that) is that you have trigger events inside continuous events (like you did in "OBJECT CONTROL" group with "on scroll" inside hover event), let triggers be always on top of continuous events. And make sure that every new set of events works as expected before moving to the next one, its easier to catch one bug in one place, instead of thousands of hundreds in multiple at the same time.

  • Thanks rokstars322 you sure gave some good advice, I'll explore a bit more what I can do or improve.

    At this point I'm using the CTRL + Scroll so the Undo/Redo save to slot once I release the CTRL.

    The problem here is if I just press and RELEASE CTRL by itself... it will create an UNDO which doesn't make any sense, and I tried other combinations such as SHIFT or other letters on the keyboard, even Spacebar... nothing make sense in the specific workflow of my software only CTRL or NONE, but Scrolling without any EXTRA key to release will make the UNDO go nuts...

    As I said, if I had some action for something like "When Scroll UP (or Down) finished" I could use it not only to FIX this annoying issue, but also for many other features! but once again... there is no such action so it doesn't matter.

    Thanks for sharing your advice and experience, I appreciate it! :)

  • The problem here is if I just press and RELEASE CTRL by itself... it will create an UNDO which doesn't make any sense

    Sigh... We've been through this many times.

    You need to use a boolean flag IsUndoSaveRequired (or something like this). Set this flag to true when the object is resized. Check this flag when Ctrl is released and call SaveStep function only when the flag is true. If user just pressed and released Ctrl, the flag will remain false, and the undo step will not be saved.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • > The problem here is if I just press and RELEASE CTRL by itself... it will create an UNDO which doesn't make any sense

    Sigh... We've been through this many times.

    You need to use a boolean flag IsUndoSaveRequired (or something like this). Set this flag to true when the object is resized. Check this flag when Ctrl is released and call SaveStep function only when the flag is true. If user just pressed and released Ctrl, the flag will false, and the undo step will not be saved.

    I don't understand what this is have to do with the issue I have mentioned with the issue at all?

    I'm afraid you didn't understand my issue with Releasing CTRL (by itself) since I must save after changing the Z-Order, so why should I not save it or using the isUndoSave boolean? it's nothing to do with the SaveStep or resizing since they work perfectly fine.

    The all point is that I have to hold another key with the middle mouse while scrolling Up or Down and I can't find another solution for this to work as scroll middle mouse (by iself) since it cause the issue, as you explained it is not a good idea to save so often or fast and it's totally make sense so I either NOT saving it to the undo history (which is not an option for me) or MUST hold a key so the SaveStep will execute ONLY once I RELEASE the CTRL (or any other key I choose) in order to slow-down the Undo/Redo so it won't cause the original issue. so yes, I do understand it you (Sensei dop2000) explained it very well from the moment you explained it saving too fast but what unfortunately I think there is no solution to scrolling middle mouse button WITHOUT releasing a key if I want a slowdown functioning Undo save.

    Just to be clear: I'm not complaining or anything, my limited English may seem like I do sometimes, it's because I'm trying my best to explain myself or the issue. but I'm always VERY thankful for any help. I must say HUGE THANKS especially to you dop2000 for your many tips, helps and solutions,  Thanks to YOU I have an AMAZING dynamic Undo/Redo system, I hope that you understand how thankful I am. :)

    Sorry for making you extremely tired from my posts, it is NOT that I do it on purpose I really try hard and if you'll read my posts and see the screenshots you will see that I'm not just asking things without trying first.

    Anyway, I'll continue to my next mission it's not that I didn't solve the current issue, it's just that it's not a very efficient solution to my use as I explained earlier why, once again: it works! (but it's a waste a really good use of the mouse wheel scroll by itself without extra keys because I have no other choice if I want the undo to work while not crashing or saving randomly.

    In Overall: it works (but not the way I want it to work, it's a "walk around") so I'll just move on for my next mission. :)

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)