Rable's Forum Posts

  • Hi everyone,

    Is it possible that an object who is placed on a layer above another object's layer is actually displayed below that last object?

    I'm not stating this based on the editor's placement, but on the debugger's datas. Even weirder is that I am positively sure this has been working perfectly fine for more than one year, I didn't change anything in that part of my code recently, but now some objects starts passing in front of others while being placed on lower layers.

    I should probably mention that the objects who have that problem are moved in the code from one layer to another regularly (in order to pass before or below the player object in a perspective view). But as the layer placement is correct in the debugger, I'm really scratching my head with that problem.

    I'm using C2 v.244

  • If I'm correct Game Maker Studio 2 is also using a subscription model now. It's 800$ per year for exporting to only one specific console.

    And to reply to the original question, no I didn't switch to C3 yet, but I'm planning to do so in the future. The main reason why I didn't do it yet is that as many others, my current project is dependent upon third party plugins which aren't supported at the moment. I'm also waiting for the desktop build as I have a hard time getting used to the browser based engine to be honest. I also hope performances (of the editor) will be better on the desktop version.

  • Hey guys,

    I posted a question about this particular topic a few days ago, and got fully replied. With additional search I now understand this tricky thing.

    You can read the post here :

    Though Ashley's visual explanation is probably the only thing you need. Couldn't be clearer.

    I hope it helps.

  • Problem Description

    When replacing an object (press R) in an action setting an effect parameter, we can select objects which don't have that effect on them. If we do so, the action disappears without any notification.

    Attach a Capx

    https://www.dropbox.com/s/lrzmxryqdcfpv ... .capx?dl=0

    Description of Capx

    A basic project with 2 sprites. One has the effect applied to it, the other don't. There is a single action which set Sprite1's effect parameter to a value. Just select the action, press R, select the other object --> the action disappears.

    Steps to Reproduce Bug

    • Create 2 sprite objects
    • Add a "adjust HSL" effect to one of them.
    • Create an action where you set the effect parameter to any value.
    • Select the action and press R, select the other object (which doesn't have the effect)
    • The action disappears

    Observed Result

    The action is deleted

    Expected Result

    The object which doesn't have the effect on them should not be selectable, or an error message should appear. Deleting the action without any notice is not a good idea.

    Affected Browsers

    editor bug

    Operating System and Service Pack

    Windows 10 / v10.0.14393

    Construct 2 Version ID

    244 (64 bit)

  • Oh wait...

    It's a bit tricky, but based on R0J0hound 's comment in the link you provided, there is a workaround based on the UID of the object, as "pick by UID" is an exception.

    For anyone interested, this should be learned:

    There are three lists internally:

    Instance list

    New list

    Sol list

    By default the sol list will be the instance list, which you then filter. When you create an object it's added to the new list and the sol is set to it. The pick all sets the sol to the instance list and since the new list isn't added yet those objects aren't picked. Then at the next "top level" event the new list is merged into the instance list.

    You can search the forum for "top level" for some more discussions/explanations of this. In one of the change logs had a fix where before "pick all" would pick the new ones too. This was fixed to prevent cases of infinite loops.

    Alternatively the pick by uid can pick objects from the new list. It's the exception to the rule.

    So I tried this:

    ...and it works! I can refer to the newly created object without needing a top event or a wait 0 seconds event.

    For further explanations by Ashley, refer to this post.

    [EDIT] It may be even simpler by using "function.returnvalue" instead of a global variable if there is only one object created in the function that you need to refer to.

  • Thanks for the reply. Very interesting. It means that it doesn't apply only to functions but to all created objects which should be accessed not directly below the "create" action.

    So wait 0 or put the modification in the next top event are the only solutions. It explains many things and is definitely something important to know.

    Thanks again!

  • TL;DR : when created in a function, objects need a wait 0 second event before they can be modified. Is there any better way to access an object that has just been created in a function?

    [EDIT] : Solved, see below.

    Hi everyone,

    I would like to ask you something I’ve run into multiple times and makes me scratch my head. Hopefully you can help me better understand how functions work.

    I noticed that when creating an object inside a function, you can’t access this object directly in the event which called the function.

    This will only set to scale 0.2 previously existing sprites.

    ***

    However, you can access that object by inserting a “wait 0 seconds” event just after the function.

    This will set all object to scale 0.2 including the newly created sprite.

    ***

    When the object is already created, modifying it in any way takes effect immediately.

    For example you can set an existing object instance variable in a function, then in the same event that called the function access this object based on this newly set instance variable without waiting 0 seconds.

    The object is immediately destroyed.

    ***

    It goes as far as making a function which set an object’s instance variable, then creates a new identical object with the same instance variable set to the same value –

    Then in the event which called the function, deleting all objects with that given value, will only destroy the old object, not the new one.

    Only the old objects are deleted. The newly create object is not deleted, even though its number value is correctly and immediately set to 5.

    ***

    Please note that everything behaves exactly the same in C2 and C3.

    So I have to questions:

    1) Is it normal? How do you explain that behavior?

    2) What is the most correct way to access an object which was newly created in a function

    You can find the Capx with the different tests here : https://www.dropbox.com/sh/u73o34q4a3pz ... 9VKga?dl=0

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Thanks for taking the time to explain that. It makes sense but I agree that obvious entries should be returned first, so I'll make a bug entry as you propose.

  • Hi,

    I don't post this as a bug as I'm not sure if it is intended or not. I have personally a hard time with how C3 manages the way we can type into the text field on "add action" and "add condition" dialogs.

    For example, in C2 I used to type C > enter > tr > enter

    and very quickly I added a "trigger once while true" condition to my event.

    In C3, typing "tr" after selecting system, will focus on "compare two values". (!)

    instead of "tr", the shortest string I can type to focus "trigger once while true" is "ger " which is 2 times longer, but the real problem is that we'll have to learn new fastest method to access such actions when switching to C3.

    Another example is that "compare two values" could previously be accessed by entering "co", while in C3 you have to type as much text as "compare t" for it be focus. Curiously, and as stated before, just entering "tr" selects "compare two values".

    I really have a hard time to find the logic behind the new way to select actions/condition in dialogs with the text field, which is the way I'm working 99% of the time. Would it be possible to let us know the logic behind that, or tell us if the current way is definitive or if it will be changed to be closer to the experience we had with C2?

    Thanks a lot!

  • Amazing! Thanks a lot rexrainbow , I haven't been able to reproduce the bug since the new update.

  • OddConfection

    That's a clever idea!

    I tried it (with browser orientation), and the result is sadly not what we would expect. The layout indeed rotate 90 degrees, but the window doesn't change size and doesn't rotate (I'm in letterbox scale fullscreen mode). So basically if you're holding your phone in portrait, you've got a small horizontal window in the middle , with the layout inside it rotated 90 degrees. You see a part of the rotated layout in the middle and large white borders on the left and right of the small window.

  • Both are working for me too, as well as fullscreen mode, as long as I am on desktop.

    On mobile / tablet I can't have the fullscreen to work. If you try the link I gave in the first post, are you able to play in fullscreen on both desktop and mobile?

    I personally don't.

  • FYI I still had a problem even with "Audio Effects" property set to "OFF" in the following sequence:

    On layout 1 play a music with the basic Audio plugin

    On layout 2 stop the music with basic Audio plugin

    On layout 3 stop the music with AudioHelper plugin, with 1 second fade-out (even though the music has already been stopped in layout 2)

    Go back to layout 1 before the end of the fade-out, the music has a problem similar to the one experienced in the capx I posted in my previous comment. This happens with the very last (updated today) version of the plug-in.

    I fixed it very easily be deleting the audiohelper action on layout 3 (it was useless anyway), but wanted to warn you that such error in the events could cause audio problems.

    [Edit]

    I made a capx to show you the problem.

    [Edit2]

    In the capx above, going from layout1 directly to layout3 also creates the problem. Furthermore, adding "remove all effects" from tag "music1" at the start of layout1 does not help.

    In other words, if tag "music1" is currently being faded out with audio helper, and you change layout before the end of the fade out, and the new layout wants to immediately play the tag "music1", then the tag "music1" will not play anymore.

  • Oh and it needs to be an HTML5 game playable in a browser, no export with cordova.

    Thanks for the reply, but I don't want to make an APK. The game should be playable fullscreen and horizontally in a browser. :/

  • Thanks a lot, rexrainbow !!

    I set the Audio effect property to "No" and it perfectly solves the problem in the previously attached .capx!

    Looking forward to use your plugin to its full potential!