View unanswered posts | View active topics It is currently Sun Dec 01, 2024 3:48 am



Reply to topic  [ 5 posts ] 
 Seemingly Easy and Useful request 
Author Message

Joined: Sun Feb 07, 2016 2:41 pm
Posts: 2
Reply with quote
Post Seemingly Easy and Useful request
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 landing
it's troops just next to your brain.

That's all, thank you for reading this.


Tue Feb 09, 2016 3:55 pm
Profile
User avatar

Joined: Mon Oct 11, 2010 1:15 pm
Posts: 594
Location: Finlandia
Reply with quote
Post 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
Profile

Joined: Fri Sep 10, 2010 1:48 am
Posts: 666
Location: Halifax, Canada
Reply with quote
Post 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
Profile
User avatar

Joined: Mon Oct 11, 2010 1:15 pm
Posts: 594
Location: Finlandia
Reply with quote
Post 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
Profile

Joined: Fri Sep 10, 2010 1:48 am
Posts: 666
Location: Halifax, Canada
Reply with quote
Post 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 frame
2. 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.

I think that would solve your issue.


Wed Feb 10, 2016 11:32 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 5 posts ] 

Who is online

Users browsing this forum: No registered users


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

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by STSoftware for PTF.
[ Time : 0.076s | 13 Queries | GZIP : Off ]