Alon's Recent Forum Activity

  • The way you are trying to do it will also work, but you need to include the slider's x position as well as the width.

    the lower clamp value should just be Slider.X

    the upper clamp value will be Slider.X + Slider.Width

    so the full clamp expression will be:

    Knob - set X to clamp(self.X, Slider.X, Slider.X + Slider.Width)

    Thanks for the reply AllanR it seems like you understand what I'm trying to do which is simply trying to emulate the default C3 slider (I even use the same instance variables) but with my own sprites.

    Dop's example is kind of cool with image points as the limiters and I should play more to understand how it works since it's new to me.

    What happens when I use the code you shared is that it's not "sitting" on the correct position but more to the right so I can always play with the numbers manually I guess but maybe it's not very efficient, all I know it works (on the specific example):

    BTW I tried slider.width /2 but because of the slider graphics it need the less 10 pixels anyway so I can add -10 at the end, but... it's the same result. that's where dop's image point is kind of nice! I just need to have a deeper look of how it works with the values.

    I will have to explore Dop's example to try understand how I can CONNECT the current Value (using the actual instance variables) without the slider size and it's limits on the Dragging code.

    In other words, the slider limiters should ONLY stay visual, that's probably where I should somehow also connect the STEPS variable.

    After all my goal is to connect the INSTANCE variables to effects properties or other variables.

    So I'll better keep the experiments using your examples, thank you for sharing and explaining! :)

  • Please see the file I posted earlier.

    Yes I just saw your edit post after I post mine :)

    Thanks! I'll explore this example asap.

  • Object Is Dragging -> Object set X to clamp(self.x, 100, 200)

    Object On Drop -> Object set X to clamp(self.x, 100, 200)

    The good news is that the CLAMP is working, it is limiting the width which is great!

    The problem I have is that the Knob jumps to the screen's X location instead from it's self current X position.

    I want the knob to clamp the values in general and not based on where it sits on the screen because I will probably move the slider around within a dragable panel later on.

  • Hi All,

    I've created a slider from scratch (sprites) using the Drag and Drop behavior.

    I'm trying to limit the Dragable Knob on the X position based on Minimum/Maximum values.

    I have never used Clamp before but I'm guessing that this may be the most efficient way to limit the slider on the X, I'm guessing.

    CLAMP IT:

    So, I get the idea in general: clamp(x, lower, upper)

    But... how do I implement it to the drag and drop object?

    I didn't find any example on the manual. most of the forum results have dead links so I cannot explore and learn how to use it.

    After clueless attempts which made of guesses all I have is what I described, trying to guess how it works is impossible for a non-programmer like me, any help will be appreciated I'll be happy to learn how to use this tool: "CLAMP" if you can explain it to me with examples / screenshots / or anything visual for a newbie. THANKS Ahead! :)

    DOWNLOAD - Base C3 File I messed with while guessing how to CLAMP

    Tagged:

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

    I guarantee to you that I'm not afraid of trying new things, This is how I became a professional animator, by trying and tasting new things and I'm still learning new things every day, but I also make sure to teach my way-of-thinking to the animators on our studio, some of them have only 3-5 years of experience in animation and they're afraid to ask, I always encourage them to ask in order to learn new techniques that will sure be more efficient and not just speed-up their workflow but also give them ANOTHER ways to accomplish their sessions.

    Animation isn't the best comparison, it was just an example. :)

    In programming if I don't KNOW what to test or what is the most efficient way to even test something, or even some basic programming terms, you must ask in order to learn, there are many things I try myself and then I get stuck... if you'll read the very first post here for example, you'll see that I tried until I got stuck, these blocks are not simple to guess how or what to do for a none-programmer.

    I just think that you don't agree with my way of asking in order to learn new things even before trying to get a much better attitude, but it is fine and I respect your opinion. :)

    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.

    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.

    That's something I would NEVER KNOW if you wouldn't tell me about, what you just explained is TOTALLY NEW TO ME, and it's pure gold which seems like a very helpful tool!

    Now I'm super curious about googling a JSON Viewer and examine my .alon files!

    it seems like a very good way to find hidden useless things that I can cleanup THANK YOU SO MUCH! I'm learning so much and I must say that this is inspiring to me.

  • > 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? :)

    I just explained above why I'm asking before I even test and I did say that I will test.

    I think other users are much more experience and may already have a clue about this because it's not specific to my project, if C3 extra values in general may change the size of a file or not really unlike sprites size for example.

    As I explained above, I ask questions before I test for better understanding and learning a better approach and workflow in order to improve, it doesn't mean I won't test things. Learning from others and their experience may not just direct me but also open new, better, efficient ways than my basic-thinking, this is why I'm asking. :)

    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.

    Thanks! this is VERY helpful I'm so happy that you told me about the console and the browser log, now I use it A LOT!

    I tested to see if "Bound to Layout" would work, but there is no way to disable that when you want to hide the panel. So that means you would have to destroy it and recreate it every time.

    I'm not sure if it's efficient, but I really like to put other panels and all the instances in their own dedicated Layouts because it is cleaner and more organized.

    What I don't know is if Create/Destroy is slower, taking more memory or just not that critical at all even for older machines, I cannot test on other machines for now so I'm trying my best to avoid anything that may be a wrong way to do things. it make sense that just changing position to something will be faster but I still like the idea of Create/Destroy anything that is reuse a lot of times on the current layout but again... what do I know. :)

    I suspect that you could add a couple thousand objects before size will become a problem. but that is just a guess.

    That's very helpful in my opinion, yes! even for a rough guess it's much better than having no idea how it works in general, there will be testing! and a lot of them hehe :)

    Thanks once again you guys are truly amazing!

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Thanks Everyone! for helping in this learning experience, I appreciate your time and patience with me.

    So I just downloaded the version AllanR made so I can look at the code, the comments and see if I can follow it.

    OFF TOPIC:

    I would never find out that the fullscreen have issues because in my PC (desktop build) it's not flickering, so THANK YOU for sharing this with me! I've added "Trigger Once" to the boolean events and now it's fine after I checked with the console log, no more endless loop. :)

    .

    BACK TO TOPIC:

    As I'm reading the comments and also the detailed explanation of the code it helps a lot but I must be honest, I couldn't solve this by myself based on my current experience. some things that you guys are having a quick solution in seconds or HOW to actually code it inside C3 so thanks for sharing your experience with me!

    I'll try to play with the code a bit and see if I can replicate something like that in my bigger project which is going to be challenging for sure, I do have some theoretical questions before I even start because I'm always curious:

    In my bigger project, I use "GUI" layer to put Panels, buttons, sliders, anything that is ABOVE everything else mostly the actual instances.

    One thing I noticed about the set position of the Panel when clicking on instances.

    1 - Is there a simple solution: if the instance is REALLY close to one of the edges?

    is it simple as: "If Panel position is OUT of layout -/+ Panel.width (for x) and -/+ Panel.height (for y) I have never tried these things and it's very interesting because when the panel is not active I guess

    2 - 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, or since it's just "numeric values" the size will barely grow and I don't need to worry about it?

    I will try some things while re-creating the basic code idea to my project so please try to understand me for asking questions mostly because out curiosity: if I even "THINK" in the correct way or my solution may be a total stupid and waste of time compare to YOUR way of thinking. this is how I can learn and understand things better as I go via discussion and not just jumping to code without thinking about it first.

    I'm sorry about my bad English and I want to thank you all once again for your patience with me, it is not something I take for granted! all of you are amazing for helping me learn new things, THANK YOU!

  • Hi All,

    I've created these:

    - Dragable Panel with sliders to change HSL / Brightness / Contrast

    - Family of instances called: "Created_Objects"

    I'm trying to do these tasks but I got confused during the process:

    Whenever I click one of the instances, it is "Selected" (I've created an instance variable for the Family).

    1. The Sliders should control ONLY that specific "Selected" instance.

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

    3. Click outside the Panel should change position (out of the layout) instead of destroy it, so the Panel always come back when I click on any instance.

    I'm not sure how to explain what I'm trying to do exactly so if you don't understand my explanation steps above let me know and I will try to explain it better.

    I've attached the messy C3 project that I'm doing my tests on so you can actually see what I've described above (minus the steps I didn't solve yet) so feel free to have a look:

    Download C3 Project

    It's the first time I'm messing around with effects and sliders and I'm still excited but a bit confused with how to connect them with the instances and control each one as I tried to describe above.

    Thanks ahead for any help, tips, and visual-screenshots or example to help me explore and learn from it!

    Tagged:

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

    Thanks I will keep it, no crashes is the highest priority for now that's for sure.

    Weird extra UNDO saves for the the Z-Order using the wheel only is better than extra delays.

    I wish I could just have a way to add "SaveStep" for every Z-Order change of this family instances.

    My brain is already on other much more interesting missions I can barely track this myself anymore hehe

    but... as I said, no crashes is first, UNDO is the core of the system so I can't just ignore it.

    I'll play around with some delays or just get back to the Release CTRL if I'll have no choice...

    Thanks again for everything! :)

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

    I just added the "isUndoSave is NOT set" to the "SaveStep" function:

    but to be honest, I got confused now... if I disable the Group: "MOUSE WHEEL - Cooldown" where the code.

    and ADD back again the "SaveStep" function to "On mouse wheel up" and "On mouse wheel down" (where the first ORIGINAL crashes used to be) still creates zillions of saves which make sense.

    But... it's NOT crashing (so it does what you're saying 1 save per time) which sounds pretty much SAFE to me.

    But there are ZILLION of undo saves since it's not saving ONLY AFTER the Wheel Scroll is finished but on every tiny scroll which is not functioning very well when I undo (too many undo's saved created to go back with no actual change between the Z-Order).

    MAYBE: the ALTERNATIVE approach should be based on the action itself and not the input?

    I don't know how to accomplish such thing (I tried), is it possible to call "SaveStep" AFTER every Z-Order change INSTEAD messing with the Scroll Wheel?

    It's probably a bad idea, but in my simple logical brain it seems like a nice alternative, I just have no clue how to do such thing in C3, I didn't find any option similar to: "On Every Z-Order change" or anything like 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.

    Wait, before I ruin anything... I don't understand what do you suggest:

    SHOULD I do what you just suggested (edit the function)? or I rather not do that? what option is LESS risky and most efficient?

    I'm asking because I really don't want to screw the way the all UNDO system currently works.

    because so far everything works GREAT... but again, tested only on my personal machine as I develop it so that's not the best indication.

  • And I think, you need to start learning something new, something useful and indeed extremely powerful... Arrays! They will improve undo/redo system so much. Just sit down and start learning. I mean really, nowadays there thousand of books/videos/tutorials on the internet, arrays is not something that is very complicated (although it might look like that at the start) compared to some other "programming stuff".

    Totally agree with this advice, I'm always RUNNING AWAY from Arrays, not because it's hard to understand.

    It's actually very logical, data based on Rows and Columns... blah blah blah, this has NEVER been the issues for me.

    The real issues was how to actually USE Arrays in C3... when it start the confusing: JSON (thinggy) AJAX (thinggy) things that doesn't make sense to me and so many properties for them that I can never GUESS because I don't know the programmers-terms, while in general it's just inserting data to the specific Array, change it, remove it, and other stuff that my non-programmer noobish brain can understand. but as always as soon as I get to C3 I'm scratching my head and don't know what or how to accomplish what's on "the paper".

    So I tried so many times to use arrays (from scratch on simple projects) in order to learn it specific in C3 since that's what I'm using... I always run away screaming and try to avoid this powerful tool (I just know how POWERFUL arrays can be) this is sad but... oh well.

    BTW - The UNDO/SYSTEM by dop2000 is based on a simple Array object. :)

    For now, I'm learning a lot (slowly, but learning a thing or two) while working on my current project with a HUGE thanks to this awesome community.

Alon's avatar

Alon

Member since 20 Feb, 2014

None one is following Alon yet!

Trophy Case

  • 10-Year Club
  • Email Verified

Progress

11/44
How to earn trophies