Page 1 of 1

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

Posted: Mon Jul 13, 2015 3:43 pm
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?

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

Posted: Tue Jul 14, 2015 10:15 pm
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?

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

Posted: Tue Jul 14, 2015 10:18 pm
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.

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

Posted: Wed Jul 15, 2015 10:05 am
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.

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

Posted: Wed Jul 15, 2015 1:34 pm
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.

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

Posted: Wed Jul 15, 2015 1:57 pm
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.

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

Posted: Wed Jul 15, 2015 2:12 pm
by Noobasaurus
Yep, taking those out of mission.req worked. Thanks!

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

Posted: Wed Jul 15, 2015 9:14 pm
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.

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

Posted: Wed Jul 15, 2015 9:45 pm
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.