I am not a coder, so I am not sure if this IS easy, but I think it might be.

Anyway, back to the point.

What I want is that time in-game stops when the player opens the BUY menu.It'd be useful, because one would be able to choose what he wants to buy without having to stress out over the AI landingit's troops just next to your brain.

That's all, thank you for reading this.

Tue Feb 09, 2016 3:55 pm

4zK

Joined: Mon Oct 11, 2010 1:15 pmPosts: 592Location: Finlandia

Re: Seemingly Easy and Useful request

I read on the wiki that there is a pause function for the ActivityManager. Alas, upon testing it, it appeared to work just as desired (freezing all MOs but allowing player controls such as switching between actors and using the buy menu), but I noticed that all MOs still retained their spent LifeTime, which caused them to dissapear/gib/do whatever they were coded to do in X amount of time.

I really liked your idea, but I can't think of any means to properly achieve it as of now, unless you don't mind your game being broken.

I suggest that you turn down the difficulty setting or something if you feel like you're being overpowered by the AI. Remember also to save your deliveries as presets so that you can quickly re-order them.

Tue Feb 09, 2016 8:28 pm

Bad Boy

Joined: Fri Sep 10, 2010 1:48 amPosts: 657Location: Halifax, Canada

Re: Seemingly Easy and Useful request

4zK wrote:

I read on the wiki that there is a pause function for the ActivityManager. Alas, upon testing it, it appeared to work just as desired (freezing all MOs but allowing player controls such as switching between actors and using the buy menu), but I noticed that all MOs still retained their spent LifeTime, which caused them to dissapear/gib/do whatever they were coded to do in X amount of time.

Why not put it in a global script or whatever and just have it track everything's age when it's activated, then reset everything's age each frame until the effect is stopped?

Wed Feb 10, 2016 3:57 am

4zK

Joined: Mon Oct 11, 2010 1:15 pmPosts: 592Location: Finlandia

Re: Seemingly Easy and Useful request

That could work, but you'd still need a way to pause lua-based timers, as they are affected too.

Wed Feb 10, 2016 7:48 pm

Bad Boy

Joined: Fri Sep 10, 2010 1:48 amPosts: 657Location: Halifax, Canada

Re: Seemingly Easy and Useful request

Hmm, that might be trickier. TimerMan has a function PauseSim that might do it without issues, but I don't know since I've never tried it.

If that doesn't work, there may be some collection of all timers (like MovableMan.Actors) you can iterate through (maybe TimerMan.Timers?). Unfortunately the timer class doesn't seem to have a pause or stop function, but you can probably fake it by saving every timer's ElapsedSimTimeMS and doing one of two things with it depending on whether or not ElapsedSimTimeMS is readonly:1. If ElapsedSimTimeMS is not readonly you can just reset it to the saved value every frame2. If it is readonly, you'd have to do things a little more convolutedly by setting the timer's StartSimTimeMS to the saved elapsed time, then calling Reset() on the timer every frame until the game is unpaused. After it's unpaused you'd also want to reset the timer's StartSimTimeMS (so you'd have to save that too, though you could just save the ones that don't have a start time of zero) so it doesn't screw up timers that don't start at zero.

Who is online

Users browsing this forum: No registered users

You cannot post new topics in this forumYou cannot reply to topics in this forumYou cannot edit your posts in this forumYou cannot delete your posts in this forumYou cannot post attachments in this forum