Hello,
I've finished my game (The Abandoned Planet), and I want to put in a New Game Plus mode before I launch it.
The idea is this; once you finish the game the first time, you can unlock a new mode "Escape Mode". In this mode, you have to finish the game before the planet explodes. You are given 3 or 4 hours to complete the game, and a global timer counts down. This timer is always displayed on the screen in "Escape Mode". Once the time is up (if you haven't beaten the game in time), the counter stops and plays a cutscene that shows that the planet has exploded... "You Lose".
I was first really excited because I found this thread:
https://adventurecreator.org/forum/discussion/5019/global-timer
Seems easy enough, but there are some issues that I foresee, most of them have to do with the looping actionlist that runs in the background when the game starts. It's easy enough to just have it start when the game starts, and then, when you play a new game, you reset the Global Integer to 0. So, you have something like this in that actionlist that runs in the background when the game starts:
Wait 1 second > Global Integer minus 1 > Check if Global Integer is 0 and check if playing "Escape Mode" (Global Bool) > if both, then play a "You lose" cutscene > if not just keep looping.
Not a bad Idea. But....
Those are my concerns at the moment. If it's all too much work, maybe a custom global timer? Maybe something else off of the asset store?
Let me know. I appreciate it. Thanks!
Jeremy
It looks like you're new here. If you want to get involved, click one of these buttons!
Comments
It's an old post - Global Timers are now an official feature. They are defined in the top toolbar's Timers Editor, and controlled using the Variable: Set Timer Action.
A bug currently exists whereby a completed Timer cannot be restarted. The bug report for it - along with a fix - can be found here.
Yes, you'd need a script to handle the conversion. Something along these lines:
https://stackoverflow.com/questions/463642/how-can-i-convert-seconds-into-hourminutessecondsmilliseconds-time
To have it display in a Menu, you can set the result to a Global String variable and display that in the Menu instead. This can be done with:
Chris, thanks for letting me know. Rats -- I'm on AC 1.73.7, and I haven't updated because I have all that custom navigation stuff, and I don't want to mess it up.
What scripts would I need to update/import just to get the timer features? Can I just import the "New" scripts, when you import from the Package Manager? Or are there other scripts that those new scripts depend upon?
Thanks!
OK. I just bit the bullet and updated AC. I figured I could revert to a previous Git branch if everything broke.
So far so good. The Global Timer feature is amazing. Great work with it. Even the "Only on Gameplay" is awesome. That's exactly what I wanted.
One thing though -- I was using this snippet of code that you previously gave me:
https://adventurecreator.org/forum/discussion/12452/camera-follow-cursor-global-toggle#latest
That no longer works. Bunch of errors. Any updates I missed? Maybe this is no a feature. I look forward to hearing back. Thanks!
One more thing. I've tried implementing your suggestion on how to convert the GlobalTimer int into a GlobalTimerString, like 00:00:00. Here is the code:
The problem here is that it only decrements the for the first second and then that's it. You can see it in the video here:
https://www.loom.com/share/5366c1e0785e46cb9b9b1bbc57b649c6?sid=3224427c-b1bd-414b-944a-c543b6d60136
Any help with that would be hugely appreciated.
The formatting isn't correct. I'm not sure exactly what, but use this to set the answer string instead:
What are the errors, exactly?
Oh my. Once again, I'm embarrassed. I just ended up putting that influence camera stuff right after if (followCursor). That solved it. For some reason, my brain didn't work, and I put it above it. My bad.
As for the code suggestion, I have no idea why, but that works! Chris, you rock!
And for anyone coming to this in the future, if you want to have a Global Timer displayed as 00:00:00, here's what you can do (thanks to Chris!):
Summary: You will be creating a Global Timer in the Timer window. That Global Timer will actually be a global int variable. And then that int variable will be converted into a string that looks like 00:00:00. Here's how to do that:
That's it. Here is the script:
Again, you can call it what you want. Just change where it says "EscapeModeTimer" to the name of your script.
Thanks to Chris for helping out with this!