dop2000's Forum Posts

  • You need to add debug messages to all events. You will be able to see which events are firing and when, monitor variable values etc.

    Simply add Browser Log to critical events, then run the game, open browser console (F12) and check the logs.

    For example, add this to all AJAX On Completed:

    Browser Log "Tag: " & AJAX.Tag & ", Data: " & AJAX.LastData

    Create AJAX On Error event and also add:

    Browser Log AJAX.Tag & " FAILED!"

    Add this to the beginning of the function:

    Browser Log Browser.URL ", " & URL_GameVersion

    .

    You will find the problem in no time.

  • Why would you do this?? Two very experienced users told you that was not a good idea. C2 has basically no support, ad plugins may not get updates.. And MobileAdvert works perfectly fine in C3!

    .

    With C2 all I can suggest is to try Enhance:

    enhance.co/documentation/construct/setup

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • dropbox.com/s/ns3kdjflz5dkc83/you%20can%20do%20it%20bug%20fixed.c3p

    Loading the game on start can load a saved state from previous version, where the camera sprite was still on layout 0 and moving with the player. So I disabled event 14 too.

  • I don't see any mistakes on that second screenshot where you save all those values. So the problem must be somewhere else.

    Are you sure this event is executed? Do you hear the "winnn" sound playing?

  • I just removed "on start of layout" after level check and it works (for now)

    So these events now running on every tick? This is not a good solution..

    You need to post your project file, because the problem is with how you save the values. The problem is likely with the order of events in your project.

    Local Storage events need time to complete! This means that you need to wait for them to finish before doing anything else. For example, if you are saving data to local storage, you cannot immediately switch to another layout and try to load the same data, it won't work.

  • Try increasing Max Spritesheet Size in project parameters under Advanced tab.

  • That's what I keep telling you - you need to wait until the data is read from local storage. This doesn't happen immediately, like with Webstorage. You can't compare Level variable in "On start of layout", because this value has not been retrieved yet.

    What you can do to fix this is move this Level check into a function. And call this function from both "On item Level exists" and "On item Level is missing" events.

    This is another reason why it's better to save all values at once in a dictionary. This way they will all be loaded at once and you won't need a hundred of different "On item exists" events.

  • savvito123 "Item get" and "On item get" steps are not required, this just adds many unnecessary events. From the documentation:

  • Yes it's true there is no global variables on this Event Sheet.

    This is not what I said! It doesn't matter in which event sheet your global variables are defined.

    I meant you need to run the game in Debug Mode and check your global variables - Levels, Experience etc. You should be able to see if they contain default values, or if the values loaded from Local Storage.

    .

    I think the values are loaded correctly, but you are checking them too soon. It takes some time to load data from Local Storage.

    If you can't figure out the issue, please post your project file.

  • When do you get that error? When you are adding LiteTween behavior to a sprite? Can you try in a blank new project? Create a sprite and try to add LiteTween behavior to it.

    If this doesn't work, try a different browser.

  • Run the project in Debug Mode and check the variables. I'm guessing the values are loaded from Local Storage just fine, and the problem is with other events. (You should wait for the values to load, before trying to access them)

    Also, check out this demo showing an easier way to save many values in Local Storage:

    howtoconstructdemos.com/easily-save-multiple-values-in-local-storage

  • Click "Edit" on the first comment.

  • You can edit your topic and change the title.

  • You do not have permission to view this post

  • "This upload does not exist"

    You are probably not picking the correct enemy instance, this is a very common mistake.

    There are many ways you can pick an instance, for example "Enemy pick nearest to Player", or "Player on collision with Enemy" etc.