Some LUA Questions

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
Filipinio
Master Sergeant
Master Sergeant
Posts: 178
Joined: Fri Jan 22, 2010 3:29 pm
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set
Location: Mygeeto's Bridge Battle's

Some LUA Questions

Post by Filipinio »

I have been looking in Fred's site and i found some interesting thngs to add into my LUA i was wondering if anybody could tell me how to use:

EnableAIAutoBalance()

i understand what it does but i dont know how to enable it and i dont know when it enables
User avatar
lucasfart
Sith
Sith
Posts: 1440
Joined: Tue Feb 24, 2009 5:32 am
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set
Location: Australia

Re: Some LUA Questions

Post by lucasfart »

Just type exactly that in

Code: Select all

EnableAIAutoBalance()
It just makes it automatically adjust so no need to add in any specific numbers. it is enabled as soon as the game starts, but it might be useable halfway through if you set up a certain condition for its use...
User avatar
Filipinio
Master Sergeant
Master Sergeant
Posts: 178
Joined: Fri Jan 22, 2010 3:29 pm
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set
Location: Mygeeto's Bridge Battle's

Re: Some LUA Questions

Post by Filipinio »

Oh, i have another question in the LUA is there sutch thing as:

SetMinFlyHeight(120)
SetMinPlayerFlyHeight(120)

???

Or is thier any way to make a barrier to stop Flyers from flying to low? (Mygeeto has a kind of 'DeathRegion' and i dont want the Flyers to die)
myers73
Lieutenant General
Lieutenant General
Posts: 690
Joined: Fri Apr 03, 2009 11:04 pm
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set
Location: Atlanta, GA xfire=myers73 IngameName=mYers

Re: Some LUA Questions

Post by myers73 »

check the hoth LUA
User avatar
Filipinio
Master Sergeant
Master Sergeant
Posts: 178
Joined: Fri Jan 22, 2010 3:29 pm
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set
Location: Mygeeto's Bridge Battle's

Re: Some LUA Questions

Post by Filipinio »

um, which line am i meant to be looking at?

somelines look like it but im not so sure...
User avatar
lucasfart
Sith
Sith
Posts: 1440
Joined: Tue Feb 24, 2009 5:32 am
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set
Location: Australia

Re: Some LUA Questions

Post by lucasfart »

search for the word "flyer" in your lua, its a command with that. and yes, the other two exist in all lua's by default i think...
User avatar
Filipinio
Master Sergeant
Master Sergeant
Posts: 178
Joined: Fri Jan 22, 2010 3:29 pm
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set
Location: Mygeeto's Bridge Battle's

Re: Some LUA Questions

Post by Filipinio »

i have another question, what is the LUA code to stop AI capturing CP's?
User avatar
Teancum
Jedi Admin
Jedi Admin
Posts: 11080
Joined: Wed Sep 07, 2005 11:42 pm
Projects :: No Mod project currently.
Games I'm Playing :: Destiny
xbox live or psn: No gamertag set
Location: Indiana

Re: Some LUA Questions

Post by Teancum »

From the FAQ/Everything You Need 2.0 thread --> LUA Section --> LUA Callback reference link.

http://www.secretsociety.com/forum/down ... erence.txt

AICanCaptureCP()
User avatar
Filipinio
Master Sergeant
Master Sergeant
Posts: 178
Joined: Fri Jan 22, 2010 3:29 pm
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set
Location: Mygeeto's Bridge Battle's

Re: Some LUA Questions

Post by Filipinio »

so that STOPS AI from capturing cp's if i just put that line in my LUA?
Last edited by Filipinio on Thu Apr 01, 2010 3:11 pm, edited 1 time in total.
User avatar
Teancum
Jedi Admin
Jedi Admin
Posts: 11080
Joined: Wed Sep 07, 2005 11:42 pm
Projects :: No Mod project currently.
Games I'm Playing :: Destiny
xbox live or psn: No gamertag set
Location: Indiana

Re: Some LUA Questions

Post by Teancum »

It should. I've never used it but it's pretty clear cut :thumbs: Try using AICanCaptureCP(False)
User avatar
Filipinio
Master Sergeant
Master Sergeant
Posts: 178
Joined: Fri Jan 22, 2010 3:29 pm
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set
Location: Mygeeto's Bridge Battle's

Re: Some LUA Questions

Post by Filipinio »

Thanks Tean, I have another question is there anyway to make a cp non-capturable for humans too? I no you can get rid of the Capture Region in ZeroEditor but is there a way to do it through the LUA?
User avatar
lucasfart
Sith
Sith
Posts: 1440
Joined: Tue Feb 24, 2009 5:32 am
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set
Location: Australia

Re: Some LUA Questions

Post by lucasfart »

I'm guessing you want to use this so that you can add/remove the capture region at certain times, probably in a campaign?

If that is so, just use the following 2 functions to add/remove the capture region:
To add a capture region, type the following:
SetProperty("cpnamehere", CaptureRegion, "cpcaptureregionhere")
To remove it, add this:
SetProperty("cpnamehere", CaptureRegion, "")
If you leave the capture region's name empty, it means that there is no capture region, hence no-one can capture it.

I hope thats what you were looking for....
User avatar
Fiodis
Master of the Force
Master of the Force
Posts: 4145
Joined: Wed Nov 12, 2008 9:27 pm
Projects :: Rannoch + Tientia + Tools Programming

Re: Some LUA Questions

Post by Fiodis »

What if you used DeactivateRegion?
User avatar
Filipinio
Master Sergeant
Master Sergeant
Posts: 178
Joined: Fri Jan 22, 2010 3:29 pm
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set
Location: Mygeeto's Bridge Battle's

Re: Some LUA Questions

Post by Filipinio »

thanks, how do i use it?

is it like: DeactivateRegionCP ("CP1_CON")
User avatar
Teancum
Jedi Admin
Jedi Admin
Posts: 11080
Joined: Wed Sep 07, 2005 11:42 pm
Projects :: No Mod project currently.
Games I'm Playing :: Destiny
xbox live or psn: No gamertag set
Location: Indiana

Re: Some LUA Questions

Post by Teancum »

Filipinio wrote:thanks, how do i use it?

is it like: DeactivateRegionCP ("CP1_CON")
It's just DeactivateRegion("insert name of region here"), not DeactivateRegionCP()
Post Reply