roxinhojp's Forum Posts

  • Browser.ExecJS("Date.now()") will give you the system's Unix time in ms.

    To get seconds, divide by 1000 and round. You should save this value to local storage every x seconds, and compare the current Unix time with the saved time upon resuming the game.

    Thanks

  • Hello, i am trying to create a "System" in my game that captures the player idle time (time away), i already tried to use "Time Away L" plugin (using Time Away L it works really fine on the preview, but when the game its exported (android), it doesnt work). So i am trying something different, get the current date in seconds and do the calculation to get the "Idle Time", does anyone have any idea how i do this?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Hey Rex, i found the REAL problem, the game wasnt starting because i was with 2 google play games plugins (Phonegap game and Cordova Game), but it ok now, and it works fine.

  • Well crap, 30 R$ per month just to use a phonegap paid plan

  • roxinhojp

    Uh, I have no smart phone, only a (4 years old) ipad3, therefore I did not work on mobile app.

    oh, ok.

  • roxinhojp

    Sorry, I could not test on mobile app. But I think these plugins should work on mobile app.

    Well, Thanks.

    Im gonna keep trying, but if you have a time, please test the plugin on mobile. Thanks Again

  • I dont know if i did something wrong, i have been trying to solve this problem for days.

  • roxinhojp

    Sorry I don't understand your issue from your description.

    i am trying to use your plugin to get offline time.

    When i am using it on Pre-View, it works really fine, but when i use it on android (intel xdk cordova), the game doesnt even start!

    Here is a link with a screen shot of the event sheet

    http://pasteboard.co/PPGGLBngu.png

  • I am having a problem with my app, after i used any type of command, i cant open the game

  • rexrainbow.github.io/C2RexDoc/c2rexplugins.weebly.com/rex_time_awayl.html

    plugin-system-date-and-time_t63492

    With that plugin you can write 'current time' to the local storage, on the right moment.

    And retrieve it as 'away time' the next time the game starts.

    In the topic about the plugin you also find a plugin to translate the stored 'numbers' to readable dates, hours and second.

    It always comes down to that principle. Store current time somewhere, retrieve & calculate.

    You can do this with out a 3th party plugin, use local storage and some way to get the current time.

    Like : https://www.scirra.com/tutorials/940/ho ... -a-project

    Now, If you dont trust the user, they can set their clock as they wish, then you need to get the current time from another source than users device.

    You can use php to communicate with a time server, but i did not learn that yet myself.

    And, you need to store that time outside the users device, another thing that i did not yet do myself.

    do you have any example capx?

  • Hey guys, i need to know the % of battery of the device, any plugin to get it?

  • 1. Record the time the player's online

    2. 24 hours - time online = Time Offline

    But if the player stay offline more than 1 day

  • 1. Record the time the player's online

    2. 24 hours - time online = Time Offline

    How do i do that?

  • I would pay if someone help me get my game to google play and teach me how i would get my other games up there later on my own...plzz

    Well, i think i can help you with somethings. and the problem that you have happens if you Try to "Cancel" the google play login, or if you are already Logged in (atleast it happens in my app)

  • I need to know how much time the player went offline. there is any plugin that can help me with that? i need know the time in SECONDS, with the time in seconds i can multiply by a variable (Coins Per Second) and give the Result to COINS variable. There is any tutorial for this plugin too?