Writing functions for the fake consoles code Console

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
baumerindustries
Lance Corporal
Posts: 96
Joined: Mon Apr 11, 2011 8:24 am
Games I'm Playing :: Bf2 EAW EAWFOC[SI]
xbox live or psn: No gamertag set
Location: In front of my english vocab and translating my confused thinkings into English....

Writing functions for the fake consoles code Console

Post by baumerindustries »

In the fake Console is a code Console included, which allows you to run lua functions during the game.
How can I make functions for this Console? I'd like to turn all shields of the crusiers off.
User avatar
DarthD.U.C.K.
Master of the Force
Master of the Force
Posts: 6027
Joined: Wed Sep 27, 2006 11:05 am
Location: Duckburg, Germany

Re: writeing functions for the fake consoles code Console

Post by DarthD.U.C.K. »

you can write any luacode into the codeconsole. you have to search for the names of the cruisershields (if they are sepearte object) and "kill" them. if they are applied to the cruisers through odf or lua, you have to set the maxshield to zero with the setproperty-command. you can find a list of luacommands in the scriptingsystemguide in the documentationfolder nd the name of the shieldssomewhere in ze or the spaceluas.
baumerindustries
Lance Corporal
Posts: 96
Joined: Mon Apr 11, 2011 8:24 am
Games I'm Playing :: Bf2 EAW EAWFOC[SI]
xbox live or psn: No gamertag set
Location: In front of my english vocab and translating my confused thinkings into English....

Re: writeing functions for the fake consoles code Console

Post by baumerindustries »

which function kills objects? And is it possible to change the location of an existing object and if Yes, how?
Bob
Brigadier General
Brigadier General
Posts: 633
Joined: Thu May 27, 2010 4:28 am
Location: at home

Re: writeing functions for the fake consoles code Console

Post by Bob »

the lua command to kill an objekt is

Code: Select all

KillObject("OBJECTNAME")
to bring it back use

Code: Select all

RespawnObject("OBJECTNAME") 
(replace OBJECTNAME with the name of your object)

To move things you could animate them in ZE and play the animation with

Code: Select all

PlayAnimation("ANIMGROUPNAME")
(replace ANIMGROUPNAME with... you know what)
Play can be replaced with Pause and Rewind.

for useful lua codes check the documentation and
http://www.gametoast.com/forums/viewtop ... 3&p=440919
Post Reply