Alon's Forum Posts

  • Hi All,

    How can I make when I pass the Last Frame it will go back to the First frame?

    And when I move back from the first frame it will go to the Last frame?

    I tried to play with the Sprite.AnimationFrameCount +1 but had no luck

    Frame 0 is empty just to make it easy for me to follow.

  • Thank you so much everyone for your advice, I'm glad that it is possible to do! :)

    I didn't try what brunopalermo suggested yet, as I'm not sure if this is the best way or not yet, but thank you for the example, I may try it if everything else will fail! (there gonna be lots of head-scratching for me).

    Since I'm a C3 noob, all the Array and Save data in general still seems very complicated to do (for me), but your explanations made lots of sense to me because my brain can understand basic logic easily but nothing more advanced from my experience...

    Both: local save or array seems to work as most of what I will do is tweak objects and their instances, MANY OF THEM.

    Thanks to dop2000 help from my previous thread I already have a working Save As (naming file) and Load buttons that works great, to be honest I couldn't understand it completely with the JSON, AJAX and how to code it, so I copy past what dop2000 suggested to make it work, and it did!

    I already excluded what shouldn't be saved, things like the UI for example.

    Just like AllanR said, I will do many changes and tweaks to many instances that appears on the screen so I don't really need to save the UNDO / REDO for future sessions, so I either need the slots to be deleted when EXIT the software.

    Also limit the UNDO so it will work on lower-end old machines will be a good advantage for the software and the users, I think 20 max UNDO will do the job, if not I can go for 10 max.

    BTW - I'm not using Chrome to for C3, I'm using the Desktop build. my goal is to make it work for PC Windows / Mac / Linux hopefully it will be possible I have no idea...

    Again, I have no clue how to even start code such thing technically, I wonder if it is very complex to achieve or around the same idea of the "Save As" system which without copy past I couldn't make it work to be honest because I don't understand all the JSON, AJAX, and all data related code in general it's still confusing to me.

    Any help, guide, tutorial will be VERY helpful thank you so much everyone!

  • Hi All,

    As I keep working on my software/application I was wondering if there is a way to make an UNDO and REDO?

    For example:

    When I deleted an instance, or change it's position, can I code that when I press 'CTRL+Z' it will undo the last action?

    I'm not sure how to do that or if I'm on the right direction at all but I'm guessing that it could be done using the System save/load local action? based on a specific slot? ...it's just a rough guess I don't really know.

    But hopefully it's not something that will clash with my current Save/Load system.

    or maybe there is a different way to do it?

    If it's too complicated to accomplish I'll probably skip that feature but I'm very curious if it's doable, and how exactly.

    Thanks ahead!

    Tagged:

  • That's very encouraging AllanR! I hope to understand C3 better, but for now I'm on the very basics it also may be my "brain" limit, when things get complex I'm lost... this is one of the reasons I really appreciate GROUPS and comments, it helps me a lot!

    So, I'm thinking to make my software/tool to be MUCH MORE primitive than I originally wanted it to be.

    It will be easier to solve issues for me, but I can already hear the users complain about some VERY BASIC tasks that I will probably get rid of...

    I will probably keep asking how to do specific stuff, but if they're too complex for me to follow I prefer not copy/past but find an alternative solution if possible, if not... oh well, PRIMITIVE-MODE = ON! :D

  • Thank you AllanR for the detailed explanation, it is true that it's a great way learn at least for me.

    I strongly believe that what I'm trying to do could be a simple task, but whenever I'm trying to look for that ACTION that could just allow me to make ALL the SELECTED OBJECTS to follow once I drag the 'Core_Selector' ...there is no such action to do that exactly, but only the Drag option or a more manually way that I couldn't make work using set position that will make the object to FOLLOW the core... and it failed because I couldn't do it right obviously.

    So, I tried to do that without the 'DRAG n DROP' using set position but once again, I get to the point where I can't find the right ACTION to follow using the mouse movement, What I mean is when I tested it with something like:

    When holding the 'RIGHT' arrow key (while SELECTED OBJECTS = TRUE) - Set the position to SELF.X + 5 pixels works SMOOTH! for Right, Left, Up, Down and rotate... but it wasn't possible to just make these rules work when I want it to follow the mouse position (I tried the mouse cursor x and y as well).

    So it worked also manually (without drag n drop behavior), a bit different but did the job... that what makes me believe that there is a way to do it in a clean way.

    I understand what you explained that it is impossible! but the more I play with it the more I believe there must be a simple way to code it, something that I can actually understand.

    I'll probably have to copy/past your original code for this as it just works, but I can't say that it bothers me that it's not possible for me to accomplish even manually with a more simplistic way.

    Programming is not for everyone, even that my brain is VERY logical, I actually drew the logic of how it should work and it looked SOOO simple on the paper... but once I got to C3 I'm missing the actions that I really want to do probably because I'm not in the C3-Think-Mode or something like that, I'm not THAAAT smart after all hehe.

    Anyway, Thanks for the kind help I truly appreciated it Allan! :)

  • First of all thank you so much AllanR for the detailed explanation and the recreation of the file, I appreciate you're taking the time to help!

    So before I saw your file, I messed around with the code again... trying to make it as simple as possible.

    And I almost got it work but... I got lost when it comes to DeSelect! as you can see (file attached) the code is VERY SIMPLISTIC and I feel that there must be a simple solution to FIX what I'm doing wrong here.

    Basically, I created another object that supposed to be followed by the SELECTED OBJECTS (family) only.

    After I had a look on your code, I realized how complex it must be (very confusing for somebody like myself to be honest, BUT! it works). As you already understand I'm not just trying to Copy/Past code that's why I'm still trying other solutions to different problems I'm having and probably will run in to more of them...

    I'm guessing that what happens is something like you described, there must be a CLASH between the selected and unselected objects which cause the mess.

    I still feel that with this creative yet simplistic way, maybe it can be fixed and I just don't see it like many other issues miss, even when I think "logical" first on paper, I can't see the solutions to the most simple things when I get back to C3 code... there is no doubt, I much more to learn.

    Of course I tried to play with 'Is Selected' because it made sense to me that ONLY the SELECTED objects should follow the 'Core_Selector' Object, but after I tried different ways to 'CLICK' to not just deselect after drop the mouse button, but also get rid of the 'Core_Selector' as it's job is temporary.

    My different tests are not on the code to keep it clean as possible for you to see, but I did try to play with INVISIBLE (enable disable) also dedicated layer and even change it's position and such.

    The goal is to make the 'Core_Selector' invisible at the end (once it will work) for now it's visible so we can see it while playing with the code.

    ANYWAY!

    Maybe if you'll have a look on the file you can see a simple solution in the spirit of what I started?

    Because once again, IT WORKS! but not complete, and I would love to learn if there is a simple way to go with this creative solution I tried so far.

    As I'm very hyped now that it works (almost) with the current 'CODE' I'm still playing with it but still, I have a strong feeling that you'll find a simple solution within 5 seconds and LOL as hard as it gets...

    I hope that the upload file works this time:

    https://gofile.io/?c=xIYNeK

    Current Code:

    Thanks ahead for any help!

  • Sorry about that, I just upload to whatever google suggested me, I didn't see the option to attach via the forums when replying, I've updated the link above to another free file host.

    If still not working please try this link:

    https://gofile.io/?c=2ZgNlB

  • I almost got it...

    I've made a clean file to start fresh just to try to work on the multiple selection + tweak selected only.

    As you can see on the attached file I managed to toggle the selection ON/OFF using CTRL.

    But when trying to drag all at once, this is where I got confused... it works only when I select a specific object the rest won't drag.

    I want to drag all of them no matter which one is selected. (like in your example AllanR)

    C3 File:

    https://srv-file7.gofile.io/download/2ZgNlB/Selection%20-%20001a.c3p

  • Thanks again AllanR you're awesome, I truly appreciate your kind help!

    After reading your explanations, I tried to follow your instructions and what I showed on the last screenshot was just where I started to try recreate your code and stopped this is why it's not complete and obviously doesn't work.

    So, I got rid of the SetColor on start of event and set it via the Family like your suggested.

    Now when I start the application and create a ROCK (or more) they are all RED (default color, I can always change it later).

    Here is what I got so far after cleaning, but how do I proceed from here to make the CTRL+CLICK to select instance or more? where I got confused was the other set variable / values or something like that.

    I believe I have a looong way before I get to the actual POP-UP menu to control the selected instances but it worth it, I'm learning a lot this way! :)

  • Thanks AllanR! I'm trying to follow and recreate the part of your "Selected" system that will allow me to select with CTRL either 1 or more instances. (not the part with the touch selection) for now.

    The first problem I ran in to (as a C3 noob) is that my layout starts with no instances on it

    So I couldn't choose a color using the "SetColor" effect.

    I guess I will have to set it on the layout sheet but I'm not sure about how or the order, I will check it out maybe it's simple just like the Disable action, I believe the all code is a bit different because I'm creating the instances by clicking a button first, than the are placed on the center of the layout.

    Also, I'm not using the Touch but the mouse so there are things I'm scratching my head how to do, and I don't know what part to copy what part to skip in order to make it work. (trying to skip the SELECTION SQUARE code but I'm not sure because it's complicated for my level).

    I'm trying to recreate the code but the other part of the selection is a bit confusing me in the code and I'm trying to avoid it as I mention, I want to focus on the CTRL CLICK to select / add 1 or more instances.

    Once I'll do that (if I'll be able to do it), I will try to add the POP-UP menu for selected which sound like a great idea as you describe it so I can control either 1 or more using the same button! (very useful!)

    EDIT:

    I thought it would be simple but so far I got lost really fast with the Touch and rest of the code.

    I'm not even sure how to actually set the specific color "Blue" for example, if the instance isn't created yet... and that's before I got confused with the rest of the code.

  • You can add NoSave behavior to things you don't want to save.

    Thank you so much! :)

  • I have another question somehow related to the original issue.

    So far when the mouse cursor is OVER any of the instances, I made it where I press a key it will affect the top layer instance, for example:

    If the mouse cursor is over one of the Rock instances and I Press the "DEL" key it will delete it,

    If I press X it will rotate it, and so on... as long as the cursor is OVER that top-layer instance.

    So far so good, BUT!

    Since I have so many hotkeys, I want to make another way more User-Friendly using a graphic-GUI Menu Pop-UP with all the options as buttons. (I'm not asking about how to make the UI Menu)

    How do I solve this?

    Let's say I put the mouse cursor on one of the instances, and RIGHT-CLICK will bring the POP-UP MENU with all the buttons, once I'll move the mouse cursor to that menu to push a button, C3 won't know which instance to affect because my code is related on the mouse-cursor OVER the top-layer instance.

    I'm a bit confused, because I probably need to code it in a different way but, I don't want to cancel the current cursor-mouse OVER instance, I want to ADD the POP-UP MENU as extra option.

    Can anyone please help me out here? (scratching my head)

    I already see how complicated it may become... File examples are more than welcome as I can explore and learn from it!

    Thanks ahead guys for all the help! :)

  • Look at your AJAX request action, why are you requesting "icon-128.png"? You need to request URL NWJS.ChosenPath

    Thanks! I knew it was something I mixed up, IT WORKS GREAT NOW!

    Thank you so much dop2000

    Question:

    I'm guessing this save system saves EVERYTHING (as I wanted) but, after testing it now I'm wondering Can I exclude or decide what will NOT be saved? because there are some things I don't want to be save.

  • Thanks for the example dop2000 No way I could understand how to do this complex AJAX / NWJS actions by myself...

    I can save and name the file "whatever.alon" and I can also Load and choose it.

    So the dialog boxes for both save and load works, but when I LOAD nothing happens...

    Can you please point where I had a mistake?

    I tried to follow your example but I guess I missed something.

    Thanks ahead! :)

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Thank you for the quick detailed reply dop2000 Nepeo

    It seems like it is possible which is VERY encouraging!

    I'm aiming for a Desktop version, so I guess the NWJS is the answer.

    I have no idea how to code such thing, I can try messing around of course (a nice way to learn) but with the all JSON file and how to deal with it sounds confusing to me.

    It's very cool that I'm not limited to the 3 letter extensions, sounds like I'll have lots of freedom with any name I would like to use as extension! :)

    If there any chance any of you guys can make a most basic C3 file example to SAVE & LOAD with unique file extension for Desktop (NWJS) so I can explore how it's done and learn from it, it will be extremely helpful!

    I hope it's not confusing as it sounds to me (noob), but you guys really encouraged me with the solutions! thank you so much and thanks ahead for any file example that may show me the way.

    BTW - Since my goal is to make NWJS (.exe) for Windows, will it also work for MAC and Linux with no problem?