play time counter

  • #1, by dror-ben-hurWednesday, 23. May 2018, 11:54 6 years ago
    Hi,
    I am trying  to implement some play time counter.

    As a reference I am using this tutorial by AFRLme:
    The downloaded resource example is not stable, some times on load it's crushed.

    Any one know why?
    It's also heppned in my game, I thinging somthing is wrong in the 'update_playtime' loop.

    10X

    Newbie

    27 Posts


  • #2, by afrlmeWednesday, 23. May 2018, 12:18 6 years ago
    Have you checked the messages.log file to see what's happening?

    On another note, how long is the pause that you are using between loops? Visionaire doesn't like it when the loops are really fast between each other & can cause the engine to crash - especially if you remove the pause entirely. There needs to be at least a 20ms pause between loops, but 100ms or higher would be safer.

    Anyway, I would recommend using the display object text & linking it to an interface, that way you only need 1 action block for that. Technically you don't even need the update text action block as you could combine it inside of the update timer action block.

    display object text "<vs=playtime>" (link the object text to an interface assigned to your character)
    pause for 1000ms
    values "playtime" + 1
    jump to action part #1

    Imperator

    7278 Posts

  • #3, by dror-ben-hurWednesday, 23. May 2018, 13:04 6 years ago
    Thank you AFRLme.

    For the first part of your replay: 
    The probloam I talking about is happens in the example of the tutorial, I didn't change the pause time and they are on 140 and 150 ms.
    In the messages.log file there is noting spacial except the line:
    Error: Abnormal program termination. 

    For the secound part of your replay:
    It is a butter and more comfortable why but it didn't solved the crushing issue. I using a pusee time of 1 sec to be sure.

    Is the example of the tutorial crused only for me? 
    Thanks again.

    Newbie

    27 Posts

  • #4, by afrlmeWednesday, 23. May 2018, 13:17 6 years ago
    Can you make sure you have the log level set to "info" in the options for the Visionaire Studio editor please? Extras > options... > player: log level. More information should get posted into the log with the level set to "info".

    P.S: feel free to zip/rar/7zip up your project & send it to me so I can take a look at what's wrong or consider posting some screenshots or a video to show us how you have set it all up as screenshots can often tell a lot more than words alone.

    Imperator

    7278 Posts

  • #5, by dror-ben-hurWednesday, 23. May 2018, 14:13 6 years ago
    Yes my log level is on "info".

    I am sorry that I insist but if we will undersend the problem that cause  the cruse on the example of the tutorial we will solved the problem.

    I appreciate your help so much and don't have problem to send you my project but I don't wants to burden you especially when the problem happens on the example of the tutorial.

    Thank you.

    Newbie

    27 Posts

  • #6, by dror-ben-hurWednesday, 23. May 2018, 15:01 6 years ago
    Ok I think I solved it by replace the usage of 'update_playtime' loop with:
    registerEventHandler("mainLoop", "update_playtime").

    Thanks again.

    Newbie

    27 Posts