CrK's Forum Posts

  • 12 posts
  • It deleted my dropbox link after posting, lets try this way:

    h t t p s:// wwwDOTdropboxDOTcom/s/0abdtipxj8096sb/mouseaim_wmouselock_debug.capx?dl=1

  • I'm using the great plugin (by TheRealDannyyy and Armaldio) Simple Mouselock to improve the controls in a game project I'm currently working on, but after changing the events to use this plugin instead of C2 native mouse control the cursor is bound to the origin of the window resolution (that is from 0 to 1920 horizontally and from 0 to 1080 vertically).

    I've done a lot of research and seems like it can be solved using CanvasToLayer to transform the coordinates but everything I tried has somewhat solved the bounding completely messing up the positioning at the same time...

    The mouse control logic I use is pretty much from C2 Ghost Shooter Demo (but adapted to an orthogonal game) and I think the angles calculations are what complicate things in my case.

    Here is a basic capx that shows the issue:

    plugin: https://www.construct.net/en/forum/extending-construct-2/addons-29/plugin-simple-native-like-131418

    Tagged:

  • I know :/. I have no idea why it takes so long. I already wrote an email to Scirra support. Hope they'll approve the files soon. Sorry for the delay, nothing much I can do except "rushing" Scirra guys withan email.

    Yeah I know it's not up to you don't worry. Funny thing is it took much less for you to do all the stuff and fix it than them to approve the file

    But hey I'm not complaining just wanted to let you know I hadn't the chance to try it yet.

  • I've investigated the capx from the JS level step by step and indeed there was an issue in detecting if an object was already preloaded or not in certain cases.

    I've already submitted a fixed version (v1.4) to the Scirra Store. I expect the files to be approved and available to download by tomorrow.

    Great, I'm glad you managed to find and fix the issue. I would love to give it a try too but still no v1.4 on the store..

  • Hmm... then my guess is that gvr_NextLayout variable is either empty or it's not a valid layout name (a typo maybe?).

    But in that case it shouldn't work at all since I point to that variable to switch layout and If I run the thing as you see in the image everything works perfectly. The problem happens only disabling that highlighted action referred to stabilizer (and only after going back to first layout at least 1 time).

    EDIT: capx sent!

    EDIT 2: I was thinking that maybe the assets aren't purged from memory after leaving Layout 2 and this is why the first time works but the second time since it has all assets already loaded the preload list remains empty?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Hi CrK

    I suspect that you try to start the preloader while nothing has been added to the preloader's list (stabilizer is counted as an item). The preloader will not start if nothing is added because it simply has nothing to preload.

    If I'm right you should see "[Preloader]: Cannot start Preloader, the list is empty." message in console log. Can you check if you see such message in the console or any other message in the moment when it does not start?

    Hey thanks for the assistance.

    You are right I just did a quick check and I see that message in the console, so now I wonder why it doesn't get the assets..

    the weird thing is on the first preload it works, its the second time that hangs.. maybe there's something wrong in my logic.

    I tried adding the items check and stabilizer off, same working ok on first cicle layout 1 > preload > layout 2, then on second try the preloader doesn't start cause the list is empty

    Here's a quick screen of the original event sheet

    EDIT: almost forgot, yes I know the global var in the image is empty, that's because I set it with the layout name on the first layout event sheet and I made sure in debug mode the variable still get corretly set every time it goes back to the first layout.

    If you still need a capx let me know, I'll try to make one asap.

  • Hi

    I've successfully made a preloader with the global layer approach, everything fine, but recently I'm having a problem the very moment I tried to not use the stabilizer.

    If I disable (or delete) the event turning on the stabilizer (stabilizer is off in properties) so that the preloader doesn't use it the first time I switch from Layer 1 to Layer 2 everything works as intended, then if I go back to Layer 1 and switch back to Layer 2 the project hangs without showing progress and it never switches to Layer 2.

    Loader animations keep working though so it doesn't seem a complete "freeze" but just the preloader not starting.

    More info:

    • I have a title layout with just a tap to start function and on that layout is included the preloader "empty" layer and preloader event sheet. The preloader is called by a function with the "tap to start" action.
    • The actual preloader global layer is in a separate layout.
    • The project is lowres very light as for now since I still have to add the majority of the content, so that without preloader switching from title screen to layout is a blink even on mobiles*.
    • Audio is preloaded by C2 on start of the first layout (default C2 option).
    • I've tried disabling the events that show progress, hide layers, wait xx secs, but the only difference is the stabylizer being activated or not.
    • Please note if the stabilizer is on everything works flawlessly even switching repeatedly from one layout to another.

    *Another thing I'm wondering about is indeed the fact that when I use no preload of sorts being the assets very light switching layout is an instant while with the preloader it still gets a couple seconds to reach 100% and move on. While C2 initial preload is so fast you almost can't see in such case. So I thought it could be the stabilizer taking his time but when I tried.. Well nothing worked anymore.

    Any idea on what could cause this?

    EDIT: corrected some typos.

  • Yes it is absolutely possible and recommended. There's an action "Add all objects from layout (by name)" which can take a string variable (layout name) as a parameter. With this one you can make a generic preloader layout as you described above.

    Perfect!

    Actually there are two ways of achieving such generic preloader. One is by making a separate preloader layout. And the second approach is by making a layer dedicated for preloader global. With such layer you just need to set the visuals only once.

    I'd recommend the approach with global layer, it will work faster in certain cases. Note that separate layout for preloader will work, but it's a double layout transition so C2 will release assets of Layout1 from the memory and then load all assets from Layout2 with preloader. While with global layer approach common assets for Layout1 and Layout2 will not be released/re-loaded.

    Mhhh I didn't think it could work as a global layer and it sounds indeed the best way, I just have to play with it a bit to see how to set it this way as I thought it would need a layout with some logic (like: on start of layout > add all objects etc) to make it work.

    Seems like this plugin has all pros and no cons at all, so great job!

  • Lazy preloading works best with many yet small assets, then there's no lag at all. If there are some big assets then the lag can occur indeed. Still there are some workarounds.

    ...

    I see, interesting workaround and I guess you have to take in account the device memory since if the current layout is still running this means C2 hasn't unloaded the assets in use so both need to fit into memory before switching, right?

    One last thing, idk if I'm overthinking but is making a sort of "global" preloader possible? Kind of one preloader layout using MM_Preloader that works dynamically for whatever layout you switch to after it.

    So let's say you run "layout 1" > then go to "preloader layout" > it preloads the next "layout 2" and switch to it, then you go again to "preloader layout" this time preloading "layout 3" and so on. Hope it makes sense

    What I'm wondering is if it's meant to be used making many loader layouts between every regular layouts (like LAYOUT 1 > LOADER 1 > LAYOUT 2 > LOADER 2) that needs to be preloaded or it can be reused in some way.

  • Sounds great

    And even more flexible with the lazy preloading functionality, but couldn't show some lag on the current layout while preloading and running events at the same time?

    Thanks for your time, I'll buy the plugin very soon

  • Hi, I have a couple questions if you don't mind.

    First, I've noticed for your other plugins you specify in the warranty

    [quote:dfflmswm]This plugin does not rely on any third party libraries (not even jQuery) so it will never get outdated or broken. Lifetime warranty.

    Same thing with this preloader?

    Publishing on mobile would it need to be added to the wrapper plugins (Cocoon, Intel XDK) as well to get the extra functionality or it works internally so it isn't needed?

    Thanks and.. Awesome plugin

  • Hi there, I was around the forum for months reading and learning but I've never been active on it. I think the time has come

  • 12 posts