ScriptCB for pausing the game?

In this forum you will find and post information regarding the modding of Star Wars Battlefront 2. DO NOT POST MOD IDEAS/REQUESTS.

Moderator: Moderators

Post Reply
jedimoose32
Field Commander
Field Commander
Posts: 938
Joined: Thu Jan 24, 2008 12:41 am
Projects :: Engineering Degree
Location: The Flatlands of Canada

ScriptCB for pausing the game?

Post by jedimoose32 »

Hi everyone.

The title says it all. I'm wondering if there's any way I can pause the game. There's a ScriptCB_Unpause() but there's no ScriptCB_Pause() that I can find. Is there another method I can use?

Thanks.
razac920
2nd Lieutenant
2nd Lieutenant
Posts: 365
Joined: Sun Jan 16, 2011 12:42 am

Re: ScriptCB for pausing the game?

Post by razac920 »

Well, nothing that I know of, but of course pausing only works in singleplayer and so a simple workaround is to use a campaign popup to pause the game.
jedimoose32
Field Commander
Field Commander
Posts: 938
Joined: Thu Jan 24, 2008 12:41 am
Projects :: Engineering Degree
Location: The Flatlands of Canada

Re: ScriptCB for pausing the game?

Post by jedimoose32 »

That's not a bad idea. I'll consider using that as a workaround. (And yeah, this is only required for single player, so that's great.)
User avatar
[RDH]Zerted
Gametoast Staff
Gametoast Staff
Posts: 2982
Joined: Sun Feb 26, 2006 7:36 am
Projects :: Bos Wars AI - a RTS game
Games I'm Playing :: SWBF2 and Bos Wars
xbox live or psn: No gamertag set
Location: USA
Contact:

Re: ScriptCB for pausing the game?

Post by [RDH]Zerted »

I don't know of a pausing method, but ScriptCB_Unpause takes a viewpoint, so for the PC you'd use: ScriptCB_Unpause(0)
jedimoose32
Field Commander
Field Commander
Posts: 938
Joined: Thu Jan 24, 2008 12:41 am
Projects :: Engineering Degree
Location: The Flatlands of Canada

Re: ScriptCB for pausing the game?

Post by jedimoose32 »

Yeah, I noticed that about Unpause. It's too bad that there's no clean way to pause. I'll try to come up with something hackish I guess. Thanks anyway.
Marth8880
Resistance Leader
Posts: 5042
Joined: Tue Feb 09, 2010 8:43 pm
Projects :: DI2 + Psychosis
Games I'm Playing :: Silent Hill 2
xbox live or psn: Marth8880
Location: Edinburgh, UK
Contact:

Re: ScriptCB for pausing the game?

Post by Marth8880 »

Right?

And what else sucks is that there's no sort of Update() function that's called every frame.
jedimoose32
Field Commander
Field Commander
Posts: 938
Joined: Thu Jan 24, 2008 12:41 am
Projects :: Engineering Degree
Location: The Flatlands of Canada

Re: ScriptCB for pausing the game?

Post by jedimoose32 »

So, the objective popup screen appears over top of the interface, apparently. Which means that option won't work. I also tried pushing the pause menu first and then pushing my menu, but that didn't work. There must be something hard-coded into the game that causes the game to pause when you press Esc/Start. :(
It's not vital that the game be totally frozen while the player is in this menu, it's just that whenever the player moves the cursor around the character's view moves as well, and when the player clicks on a button the character's weapon fires. :|
So I guess I'll either try and put this screen into the Class Selection screen so it comes up before they first spawn, or I'll have to rig up an invisible, weaponless turret that the player is forced into while the screen is open. :o
User avatar
TWINKEYRUNAWAY
Lieutenant General
Lieutenant General
Posts: 730
Joined: Fri Aug 17, 2012 3:13 pm
Projects :: Empire Rising
Games I'm Playing :: SWBF Doom FONV
xbox live or psn: No gamertag set
Location: 411Remnant
Contact:

Re: ScriptCB for pausing the game?

Post by TWINKEYRUNAWAY »

Good luck on this bro. What I do is use xpadder and assign the esc button to the start button in my controller. It would be nice to not have to use that method everytime I start battlefront.
User avatar
[RDH]Zerted
Gametoast Staff
Gametoast Staff
Posts: 2982
Joined: Sun Feb 26, 2006 7:36 am
Projects :: Bos Wars AI - a RTS game
Games I'm Playing :: SWBF2 and Bos Wars
xbox live or psn: No gamertag set
Location: USA
Contact:

Re: ScriptCB for pausing the game?

Post by [RDH]Zerted »

jedimoose32 wrote:I also tried pushing the pause menu first and then pushing my menu, but that didn't work. There must be something hard-coded into the game that causes the game to pause when you press Esc/Start. :(

So I guess I'll either try and put this screen into the Class Selection screen so it comes up before they first spawn
Are you saying if you directly push an IScreen from an ingame script it doesn't unlink the input to the player? Does that also happen when only pushing the pause menu? You can rewrite the pause menu to only show your data the first time it's displayed.

There should be a way to intercepts event messages (such as button clicks) and halt the message from going further. Does your screen try that?

I think v1.3 makes a couple minor changes to the team select page. If you add your content there you should do it by injecting it as a function wrapper instead of replacing the whole file.
Post Reply