dop2000's Recent Forum Activity

  • 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.

  • 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.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • It's very hard to read the unformatted code you posted..

    Since you don't need a clean solution, the easiest one is to add all 20 characters to the layout and do this:

    System For each Character Order by random(1)
    Loopindex>9	: Character destroy
    

    This will remove all but 10 random characters. If they are different sprites, add them to a family.

    You can also add all character numbers to an array, pick a random index and remove it from the array:

    Repeat 10 times
    	Set r to int(random(array.width))
    	Create character with animation frame r
    	array delete element r
    
  • If the undo needs to be saved, and it is saved, then why did you wrote that it is a problem and that it doesn't make sense? (your words, not mine) :)

    English is not my first language either, so there may be a misunderstanding on my part. Anyway, I hope you'll get everything working exactly as you want.

  • You wrote "if I just press and RELEASE CTRL by itself... it will create an UNDO"

    If you are using the flag correctly, this should not happen. When you press and release Ctrl or any other button, without actually changing any objects, undo step will not be saved. Only when anything about the object has been modified (scaled, moved on z-axis etc.), then you set the flag and undo step will be saved.

  • I'm not sure.. This is "On create" event, so initial AnglesToRotate values will always be the same for all newly created instanced, and will probably be an empty string.

    Try adding Browser Log to each event, for example:

    Browser Log "RedLight UID=" & Spr_RedLight.UID & " AnglesToRotate=" & Spr_RedLight.AnglesToRotate

    Run the game in debug mode, open browser console and try debugging.

dop2000's avatar

dop2000

Member since 26 May, 2016

Twitter
dop2000 has 261 followers

Connect with dop2000

Trophy Case

  • 8-Year Club
  • Entrepreneur Sold something in the asset store
  • Jupiter Mission Supports Gordon's mission to Jupiter
  • Forum Contributor Made 100 posts in the forums
  • Forum Patron Made 500 posts in the forums
  • Forum Hero Made 1,000 posts in the forums
  • Forum Wizard Made 5,000 posts in the forums
  • Forum Unicorn Made 10,000 posts in the forums
  • x5
    Popular Game One of your games has over 1,000 players
  • x2
    Coach One of your tutorials has over 1,000 readers
  • Educator One of your tutorials has over 10,000 readers
  • Regular Visitor Visited Construct.net 7 days in a row
  • Steady Visitor Visited Construct.net 30 days in a row
  • Enduring Visitor Visited Construct.net 90 days in a row
  • Unrelenting Visitor Visited Construct.net 180 days in a row
  • Continuous Visitor Visited Construct.net 365 days in a row
  • RTFM Read the fabulous manual
  • x3
    Quick Draw First 5 people to up-vote a new Construct 3 release
  • x13
    Great Comment One of your comments gets 3 upvotes
  • Delicious Comment One of your comments gets 10 upvotes
  • Email Verified

Progress

28/44
How to earn trophies