Timer / Menu dont pause - Zeitmesser / Menü soll nicht pausieren

  • #1, by PanSWednesday, 25. April 2018, 17:49 2 years ago
    I create an "action" which plays an animation every minute. This timer should run for the hole game. My problem is menus pause this timer, but i create 2 important scenes (multiple-choice-test) as menu. Is there a way to deactivate this pause-function or do you have other ideas?

    Thx
    ----

    Hallo, war lange nicht mehr hier, hab aber endlich wieder VS5 ausgepackt grin

    Ich habe mir eine "Aktion" erstellt, die jede Minute eine Animation abspielt. Dieser Timer soll im ganzen Spiel jederzeit laufen. Natürlich pausieren Menüs diesen Timer, was ich ganz vergessen habe. Schlimmer noch, ich habe zwei wichtige Hintergründe (Schultest zum Ankreuzen) als Menü definiert aus praktischen Gründen. Unpraktisch wiederum, weil dadurch der Timer weiterläuft. Kann man die Pausierung in bestimmten Menüs aufheben?
    Oder sonst einen Vorschlag?

    Danke

    Newbie

    56 Posts


  • #2, by afrlmeWednesday, 25. April 2018, 19:06 2 years ago
    I don't understand why it would pause it. Do the animations that are being played belong to an interface? If they do then it's likely that the interfaces are just being hidden when you change to a menu type scene. Try going into the properties of the relevant interface & enabling the "show interface permanently" option. Also check the main settings for your game & see if you happen to have the "auto hide interfaces in menu" option enabled as that hides interfaces automatically whenever a menu scene is shown. Turn that off. Alternatively you can use Lua to toggle if interfaces should be auto hidden in menu type scenes with this line of code...
    game.AutoHideInterfacesInMenu = true -- change true to false to disable auto hiding
    1

    Imperator

    6842 Posts

  • #3, by PanSWednesday, 25. April 2018, 19:34 2 years ago
    Sry, maybe you missunderstand the word "action". I dont mean an interface action. Look at the first picture. I would like to create an operation / command-chain (? I dont know the correct word) working like a timer or a clock. And I defined 2 gamescreen (second picture) as menus but of course the timer paused on this screens and it shouldnt.

    Sry for my english and thank you for your efforts smile

    Newbie

    56 Posts

  • #4, by afrlmeWednesday, 25. April 2018, 23:05 2 years ago
    Ah you mean the called by other action gets cancelled when you change to the menu type scene? A looping action block would have been a much better idea - less action parts required all around.

    If I were to create a timer with action parts I would do something like this...

    pause 60000ms
    set value "timer_schoolclock" + 1
    jump to action part #1

    How you are handling the images/animations is another matter entirely. You could have 60 images/objects with the timer_schoolclock value linked to them so that it shows the correct object/image based on the current value, or you could use an animation & force it to play a specific animation frame based on the current value or if it's more of a traditional clock then you could even rotate the hand(s) with Lua script if you really wanted to. So many possibilities.

    Maybe Lua would be a better solution as you can have it always work in the background.

    Imperator

    6842 Posts

  • #5, by PanSThursday, 26. April 2018, 00:13 2 years ago
    Oh thx. I forgot there is an "jump to action part"-function.

    But thats not my real problem. Even the animation thing is working. The only problem is the timer paused in that menu type scenes. Its proceeds after changing back to the normal scene. I think because the game time stops.

    So, my possible questions are:
    - Is there a way that the game time proceeds even in menu type scenes?
    or if not:
    - Is there an easy way to change the menu type scenes to a normal game scenes without having a lot of work?

    Sry for all this misunderstandings. wink

    Newbie

    56 Posts

  • #6, by afrlmeThursday, 26. April 2018, 02:42 2 years ago
    Don't think you can change them. You could create a new scene as a regular scene & then copy/paste all of the scene objects, scene actions, conditions & values into it.

    I've just messed around seeing if I could create a 12 hour clock based on system time in a menu scene & I also added the digital time underneath which I update using a looping action block in a menu scene. I don't understand why the action block should just stop working because you change to a menu type scene. Are you willing to share some screenshots or a video of how you have set up this time system thing & anything else that is relevant to it?

    Imperator

    6842 Posts

  • #7, by PanSThursday, 26. April 2018, 10:25 2 years ago
    Pic 1: This is my timer. It is started by another action (act_introduction) at the end of an intro. The clock switchs to 8:55. Now the player has 10min to solve the game.

    Pic 2: Here you can see the animation part. The "reset_clockanimation" is only my workaround to be sure that animations not overlapping each other (its long time ago using VS, in my memory thats necessary). Every animation is simply a single frame graphic (as you can see in pic 6)  playing until it is stopped (reset_clockanimations). Ignore "anim_tickingclock" its only a test animation.

    Pic 3: Clicking on this sheet starts some actions. At the end its changing to the menu type scene "01_sheetpage1".

    Pic 4: Thats the menu type scene. The game inventory is hidden (seeable in pic 7). On that scene the timer is paused (because its only running on the classroom scene and not everywhere?). I tested it by using a stop watch. When you go back to the "01_classroom" scene the timer procceds.
    Example: 50 sec has been passed (clock shows 8:55) . You click on that sheet and change to the sheet scene. Waiting here maybe 30 sec. So realtime 80sec has been passed. You go back to the classroom. The clock show still 8:55 and not as expected 8:56. But after waiting 10 sec the clock shows 8:56.

    Pic 5: To be sure the clock has the correct animation frame there is an action (check_clockanimations) everytime you change back to the classroom scene. Works fine.

    Thx for watching my slideshow grin

    Newbie

    56 Posts

  • #8, by riffmasterThursday, 26. April 2018, 10:56 2 years ago
    Hi,

    bin mir zwar nicht ganz sicher, aber würde es nicht ausreichen, die Aktion start_timer in die Menü-Szene zu kopieren und bei Beginn der Szene aufzurufen? Diese Kopie müsste doch dann die Werte der anderen Szene bearbeiten können.
    Die Frage ist nur, ob dieser Timer dann stoppen würde, wenn Du das Menü verlässt, oder ob Du dann zwei Timer hast. Dann müsstest Du die Kopie beim Verlassen des Menüs noch über irgendeine Abfrage wieder stoppen und, falls der ursprüngliche Timer nicht von selber nach dem Wechsel weiterläuft, diesen wieder starten.
    Keine Ahnung, ob das funktioniert, aber ich denke es wäre einen Versuch wert smile

    I'm not sure about this, but wouldn't it be sufficient to copy the start_timer action into the menu scene, where this copy would edit the values of the other scene?
    One question would be if this copied timer stops automatically when you leave the menu, otherwise you would have to make some query to stop it on leaving and, if the original timer doesnt't kick in again automatically, starting that one again.
    I have no clue if this would work, but I think it's worth to give it a shot smile

    Newbie

    26 Posts

  • #9, by PanSThursday, 26. April 2018, 11:24 2 years ago
    Also ich habe "start_timer" jetzt testweise in eine Menü-Szene oder in ein Interface verschoben. Er pausiert trotzdem immer, wenn ich in die Menü-Szene wechsel.

    Ich könnte den Timer kleinteiliger mache (jede Sekunde) und dann einfach bei Szenenwechsel in der alten Szene beenden und in der neuen Szene gleich neustarten (etwas Arbeit). Bei 60sek-Schritten würde die Zeit zu sehr verzerrt, wenn der Timer immer wieder neugestartet wird.

    I tried to put "start_timer" in a menu type scene or in an interface. Its allways the same.

    My only idea is to change the count from 60sec-steps to 1sec-steps ( a little more work). So I allways could stops the time counter in the old scene and restart it immediately in the new scene when changing between scenes. Than the loss of time is not so high like restarting it in 60sec-steps. Maybe thats what AFRLme trys to explain me wink

    Newbie

    56 Posts

  • #10, by riffmasterThursday, 26. April 2018, 11:34 2 years ago
    Hm, hast Du verschoben oder kopiert und die Einzelschritte ggf. angepasst?

    Ich schaue mir das heute Abend mal an, weil ich das ggf. auch für eine Szene gebrauchen könnte, allerdings für eine Bombenentschärfung smile

    Hm, did you move the action or copy and eventually adapted the single actions?

    I will have a look at his in the evening, as I may use this also for a scene of my game, although it would be for disarming a bomb smile

    Newbie

    26 Posts

  • #11, by PanSThursday, 26. April 2018, 11:37 2 years ago
    Kopiert, aber natürlich alle Verweise angepasst wink

    Newbie

    56 Posts

Write post