Spock's Recent Forum Activity

  • In the proccess of trying to convert from C2runtime to C3runtime. Ran into an issue.

    My project requires:

    1. Fullscreen mode: Off

    2. Changing canvas size during runtime.

    Issue:

    After canvas size is changed:

    - [Object] "Text" ignores "Position"

    - [Object] "obj" Drag & Drop no longer working. Hit target is offset not the same position as sprite..

    All the above works correctly in C2runtime not C3runtime. See example files below:

    C2runtime (working)

    .c3p: 1drv.ms/u/s!AnjqkTqN7Tavh-k6K-Q3vliMjpR-ZA

    C3runtime (broken)

    .c3p: 1drv.ms/u/s!AnjqkTqN7Tavh-k7gKxidLVfXw_7gw

    CLOSED TICKET: github.com/Scirra/Construct-3-bugs/issues/2141

  • That makes sense, I will do that. Thanks once again :)

  • The issue isn't with LocalStorage it is with "System Save Game State" Or are you saying we need to create an additional LocalStorage key for each "System Save Slot"?

  • The example scripts I posted previously are all intended to be used in "Actions" within C3 or C2Runtime not from your html. If the "iframe" or "Object" is in a different directory that's where the "window.parent" plays in. As well your Javascript should be called from a ".js" file rather than inline scripts.

    Also, I found that Construct games work better in an "embedded object" and not an "iFrame". However of course use whatever works best for your project. Just something to try.

     <object>
     <embed src="index.html" width="100%" height="100%"></embed>
     </object>
    
    
  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I agree, it is unfortunately a hack. As well, of course I am open to doing this properly. However I could not find the proper solution at the time.

    I used this hack to clear all saved data stored to the local machine from the "System Save Slot". It acted as a simple one line function to globally clear everything in the project itself. Unlike the browser clear cache, which isn't practical for this project.

    Unlike "localStorage" which has (Clear Storage, Remove Item) the "System Save" doesn't seem to have a clear function. It only has (load, load from Json, save) I am open to suggestions and appreciate any feedback you may have.

    Many Construct users have had this question and have also resulted to deleting the database.

  • Before I switched to C3 Runtime I was able to delete the Save State Database "_C2SaveStates" located in the c2runtime.js This simply clears all save states.

    	"window.indexedDB.deleteDatabase('_C2SaveStates');"
    

    however, I am unable to find the name of the indexed DB in "scripts/c3runtime.js". One would assume it would be "_C3SaveStates" but it is not the case.

    Anyone know what the database ID changed to?

  • 	ACTION > Browser > Execute JavaScript > "yourfunction();"
    

    If you are calling a JS string as a C3 value.

    	Browser.ExecJS("yourvar;")
    
    	Browser.ExecJS("yourvar='newvalue';")
    

    If it is in an iframe or object one directory deep use:

    	ACTION > Browser > Execute JavaScript > window.parent.yourfunction();
    
  • I know this is an old post, but since C3 Runtime is now the default and not C2 I think this still applies.

    When I switched to C3 a lot of my project broke, so I am trying to get things working under C3 Runtiume.

    For some time now I have been successfully deleting the database by:

    	window.indexeddb.deletedatabase('_c2savestates');
    

    However, I can no longer find the name of the database in the scripts/c3runtime.js so I am unable to delete it like I have in the past.

    (Started a new topic here: https://www.construct.net/en/forum/construct-3/how-do-i-8/how-to-delete-indexeddb-in-c3-138497)

  • Turns out it is an Edge bug and the ticket is now closed.

    I did find some working examples in Edge using Javascript to capture the Canvas Element in Edge. However I am struggling to get this to work with Construct 3's Canvas Element. Main issue is I cant seem to reference the Construct 3 Canvas properly.

    var canvas = document.querySelector( 'canvas' ), c = canvas.getContext( '2d' ),

    Please see working Edge examples below:

    Working example in Edge with download prompt: eligrey.com/demos/FileSaver.js

    Another example with plain JS but requires right click save: jsfiddle.net/codepo8/V6ufG/2

    So, this is still possible just not with the Invoke Download from within Construct 3. Need to use 3rd party JavaScript.

  • Thanks,

    I added a ticket for the bug: github.com/Scirra/Construct-3-bugs/issues/2016

  • Not sure where the Construct (3) Bug Reports should be sent to? I only see Construct (2) Bug Forum.

    Attached Project File C3p: 1drv.ms/u/s!AnjqkTqN7TavhOY61wBt05G0Zu4yYg

    File only contains, 2 buttons 1 sprite and the actions in the screenshot above.

  • I created a new blank project. Simply added both Invoke Downloads. These work correctly in Chrome/FireFox but fail to open in Microsfot Edge.

    EDGE ONLY:

    1. Screenshot PNG

    - Result: HTML1300: Navigation occurred. PNG data in console

    - Fails to download

    2. Download Json

    - Page reloads

    - Fails to download

    C3 Events/Actions: s22.postimg.cc/agghi4tcx/C3_Save.jpg

    Looks like Download from Construct 3 is NOT supported in edge. If that is the case I will have to completely redirect users to use chrome/firefox and block IE/Edge completely. My app requires download/screenshot.

Spock's avatar

Spock

Early Adopter

Member since 28 Mar, 2013

None one is following Spock yet!

Trophy Case

  • 11-Year Club
  • Email Verified

Progress

12/44
How to earn trophies