Disable fakeconsole through scripting [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
User avatar
asleeponduty
Private First Class
Posts: 77
Joined: Tue Jul 22, 2008 3:05 pm
Games I'm Playing :: AaaaaAAaaaAAAaaAAAA
xbox live or psn: No gamertag set
Location: Illinois

Disable fakeconsole through scripting [Solved]

Post by asleeponduty »

Hey, I have a problem.
My brother is addicted to fakeconsole, and is causing trouble in my map. Without uninstalling the 1.3 patch, I want to disable the fakeconsole just for my map, or make it do stuff in the map fore me, say trigger an animation.
How could I do this?
thanks,
asleeponduty
Last edited by asleeponduty on Thu Mar 24, 2011 9:25 pm, edited 1 time in total.
CalvaryCptMike
Captain
Captain
Posts: 476
Joined: Sat Feb 19, 2011 3:10 pm
Projects :: Nothing--absolutely nothing
Location: Freed by alien robots, now living on Mars
Contact:

Re: Disable fakeconsole through scripting

Post by CalvaryCptMike »

Okay so wait...

How is your brother "causing trouble" in your map? He can only use it to change the gameplay as he uses your map, he can not permanently change anything or mess with your map FILES with the fake console.

So basically if I understand your question: your brother is using the fake console to cheat and/or have fun running around w/invuln at super high speeds and you for some reason want to put an end to it...? :? Anyways I don't know of anyway to do this.

Okay but now for the second part of your question:
Hidden/Spoiler:
"How can I make it do stuff in the map fore me, say trigger an animation?"
Well all of the fake console commands are just Lua commands that you should just add right in your mission script.

For Instance:
When you use the Fake console command "EnableAIAutoBalance Off" all that does is uses the Lua function:

Code: Select all

 	DisableAIAutoBalance()
So if you want to say Trigger an animation just tell what ever you're animating to do it right in the lua script itself. Hopefully this is want you needed.
fasty
1st Lieutenant
1st Lieutenant
Posts: 438
Joined: Thu Apr 15, 2010 4:17 am
Projects :: Server modding
Games I'm Playing :: SWBF2
Contact:

Re: Disable fakeconsole through scripting

Post by fasty »

Make a custom ingame.lvl.
Have it say:

Code: Select all

ucft
{
    REQN
    {
        "script"
        "ifs_fakeconsole"
    }
Open up ifs_fakeconsole in C:\BF2_ModTools\data_ABC\Common\scripts
Change this:

Code: Select all

fakeconsole_listbox_layout = {
	-- Height is calculated from yHeight, Spacing, showcount.
	yHeight = 22,
	ySpacing  = 0,
	showcount = 9,
	font = gListboxItemFont,

 	width = 320,
To this:

Code: Select all

fakeconsole_listbox_layout = {
	-- Height is calculated from yHeight, Spacing, showcount.
	yHeight = 0,
	ySpacing  = 0,
	showcount = 9,
	font = gListboxItemFont,

 	width = 0,
It worked for me anyway. There are probably better ways and I think this will affect all maps as long as this maps installed.
User avatar
asleeponduty
Private First Class
Posts: 77
Joined: Tue Jul 22, 2008 3:05 pm
Games I'm Playing :: AaaaaAAaaaAAAaaAAAA
xbox live or psn: No gamertag set
Location: Illinois

Re: Disable fakeconsole through scripting

Post by asleeponduty »

Okay, Ill just do that instead, because the annoyingness of teleporting every single unit to out of bounds and a million feet in the air is pretty annoying.
Thanks!
Solved.
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: Disable fakeconsole through scripting [Solved]

Post by [RDH]Zerted »

There are many other ways you could have done it too. The simplest would be adding DisableNormalFCCommands = true somewhere in your map script (such as the very top). That should disable all the commands I added and still allow all the game's commands in the debug version.
THEWULFMAN
Space Ranger
Posts: 5557
Joined: Tue Aug 17, 2010 3:30 pm
Projects :: Evolved 2
Location: Columbus, Ohio
Contact:

Re: Disable fakeconsole through scripting [Solved]

Post by THEWULFMAN »

:shock: wow folks, its that easy. :yes:

Give yourself a round of applause for making things harder on youself :funny2:
User avatar
asleeponduty
Private First Class
Posts: 77
Joined: Tue Jul 22, 2008 3:05 pm
Games I'm Playing :: AaaaaAAaaaAAAaaAAAA
xbox live or psn: No gamertag set
Location: Illinois

Re: Disable fakeconsole through scripting

Post by asleeponduty »

CalvaryCptMike wrote: So if you want to say Trigger an animation just tell what ever you're animating to do it right in the lua script itself. Hopefully this is want you needed.
Something like this?

Code: Select all

function scriptPostLoad()
blablabla
end

function Cheat()
DeactivateRegion("trigger_mapend")
PauseAnimation("freedom") 
RewindAnimation("freedom") 
PlayAnimation("freedom") 
end
And so how would i designate a button for this, or does it do it itself?
fasty
1st Lieutenant
1st Lieutenant
Posts: 438
Joined: Thu Apr 15, 2010 4:17 am
Projects :: Server modding
Games I'm Playing :: SWBF2
Contact:

Re: Disable fakeconsole through scripting [Solved]

Post by fasty »

Pardon the bump, but does anyone know of any other ways to disable FC? Zerteds method does not seem to work for me.
Post Reply