Free cam and FC buttons disappear in certain maps [Solved]

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
Noobasaurus
Droid Pilot Assassin
Droid Pilot Assassin
Posts: 2006
Joined: Tue Aug 17, 2010 5:56 pm

Free cam and FC buttons disappear in certain maps [Solved]

Post by Noobasaurus »

I've been making a mod where I don't want people to be able to use the free cam, so I used this code from LRKfm946 to redefine the free cam function.

Code: Select all

      RealFreeCamFn = ScriptCB_Freecamera
      ScriptCB_Freecamera = function(arg)
		 return false
      end
This code works fine in the debugger, which makes it so when I click in the free cam button nothing happens. However, in the normal game, both the free cam and fake console buttons disappear. This only happens on maps of my mod, and all other maps have the free cam and fake console buttons. I've tried disabling the function and doing a bunch of stuff with it but the buttons do not want to appear. Anyone have any ideas?
Last edited by Noobasaurus on Wed Jul 15, 2015 2:12 pm, edited 1 time in total.
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: Free cam and fake console buttons disappear in certain m

Post by [RDH]Zerted »

That's odd. Redefining ScriptCB_Freecamera shouldn't break anything. Try it like this:

Code: Select all

ScriptCB_Freecamera = function()  end
"arg" is a special variable in Lua so there's a tiny chance that's what the issue is, but then it should break in debug mode too...

If you comment out only those lines is everything fixed?
Noobasaurus
Droid Pilot Assassin
Droid Pilot Assassin
Posts: 2006
Joined: Tue Aug 17, 2010 5:56 pm

Re: Free cam and fake console buttons disappear in certain m

Post by Noobasaurus »

I tried that and nothing new happened. I've also tried commenting out those lines multiple times and nothing has happened. Ir's odd that the buttons would disappear in the main game but not in the debugger. In the debugger the function works as it should and disables the free cam (when you hit the button). It's as if the buttons disappearing is permanent.
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: Free cam and fake console buttons disappear in certain m

Post by [RDH]Zerted »

If you commented out the lines you posted and nothing changed then the problem isn't with that code. It's something else you changed. If you can, use a diff tool to compare your version of the files with their normal versions and double check all your changes. You can post them here if you want.
Noobasaurus
Droid Pilot Assassin
Droid Pilot Assassin
Posts: 2006
Joined: Tue Aug 17, 2010 5:56 pm

Re: Free cam and fake console buttons disappear in certain m

Post by Noobasaurus »

I created a separate script for this gamemode, so that in each map I only have to put a few lines and when I make a change it applies to all maps. I've also tried not running the gamemode, but that hasn't yielded any results either. In each map, the lines that I've inserted are:

Code: Select all

ScriptCB_DoFile("HideAndSeek")
	 hideandseek = HideAndSeek:New()
	hideandseek:Start()
The weird part is, none of the things that I've done have tampered with the buttons, only the function of one of the buttons. I've also tried many cleans and manual cleans.
jedimoose32
Field Commander
Field Commander
Posts: 938
Joined: Thu Jan 24, 2008 12:41 am
Projects :: Engineering Degree
Location: The Flatlands of Canada

Re: Free cam and fake console buttons disappear in certain m

Post by jedimoose32 »

Try getting rid of the interface changes I suggested (since you aren't using the ifs anymore anyway). Take "ifs_pausemenu" out of mission.req, then clean and munge common. See if that works.
Noobasaurus
Droid Pilot Assassin
Droid Pilot Assassin
Posts: 2006
Joined: Tue Aug 17, 2010 5:56 pm

Re: Free cam and fake console buttons disappear in certain m

Post by Noobasaurus »

Yep, taking those out of mission.req worked. Thanks!
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: Free cam and FC buttons disappear in certain maps [Solve

Post by [RDH]Zerted »

Oh, yeah, v1.3 makes changes to ifs_pausemenu.lua. If you include a custom version of that file it'll override v1.3's changes. It sounds like you never made the change to enable those buttons in the non-debug version of the game. Remember, they aren't enabled in the retail version of SWBF2.

Your RealFreeCamFn didn't need to be in ifs_pausemenu.lua. You can put that code anywhere.
jedimoose32
Field Commander
Field Commander
Posts: 938
Joined: Thu Jan 24, 2008 12:41 am
Projects :: Engineering Degree
Location: The Flatlands of Canada

Re: Free cam and FC buttons disappear in certain maps [Solve

Post by jedimoose32 »

I think his custom freecam function is elsewhere. The reason I knew his pausemenu script was overriding yours is because I had given him some advice on making changes to the interface for a different aspect of his project.
Post Reply