How would I use fake console to lower AI on my side?

Talk and share anything related to Star Wars Battlefront 2. No maps or mod announcements here. Use Work in Progress forum.

Moderator: Moderators

Post Reply
User avatar
hypshadowthehedgehog
Private First Class
Posts: 88
Joined: Wed Mar 11, 2009 5:38 pm

How would I use fake console to lower AI on my side?

Post by hypshadowthehedgehog »

How would I use fake console to lower AI on my side? I don't see any option for that (other than reinforcements). Currently, both sides have 32 AI. Let's say I want to give my side, say, 8 AI. Is there any way I could do this with fake console, or would I have to make a full out mod? (I also wouldn't mind making a way for this to happen automatically so I don't have to do this at the beginning of every map)
Darth_Squoobus
General
General
Posts: 760
Joined: Mon Aug 03, 2009 3:21 am
Projects :: No Mod project currently.
Location: over the hills and far away

Re: How would I use fake console to lower AI on my side?

Post by Darth_Squoobus »

Didn't you ever notice the "add reinforcements team 1/2" button?
CressAlbane
Master Bounty Hunter
Master Bounty Hunter
Posts: 1519
Joined: Fri Dec 18, 2009 8:02 am
Projects :: CTF Arenas
Games I'm Playing :: Steam- cressalbane2
Location: ¿uoıʇɐɔoן ʎɯ sıɥʇ sı

Re: How would I use fake console to lower AI on my side?

Post by CressAlbane »

Dath_Squoobus, that seems a little rude, and he was even asking that. He wants to change the number of units on the field not the reinforcements.
Darth_Squoobus
General
General
Posts: 760
Joined: Mon Aug 03, 2009 3:21 am
Projects :: No Mod project currently.
Location: over the hills and far away

Re: How would I use fake console to lower AI on my side?

Post by Darth_Squoobus »

CressAlbane wrote:Dath_Squoobus, that seems a little rude, and he was even asking that. He wants to change the number of units on the field not the reinforcements.
Well there's no way to do that ingame, not even with fake console. You need a full-out mod for that.
User avatar
Maveritchell
Jedi Admin
Jedi Admin
Posts: 7366
Joined: Mon Aug 21, 2006 11:03 pm

Re: How would I use fake console to lower AI on my side?

Post by Maveritchell »

Darth_Squoobus wrote:Well there's no way to do that ingame, not even with fake console. You need a full-out mod for that.
It is one thing to dodge a mistake when you have a legitimate and correct answer. It is another to dodge a mistake and then be incorrect as well. It's okay to say "my mistake" and then "I think... etc."

In this case you are mistaken in saying that you can't "do that ingame...even with fake console." I don't know if there is a specific console command for doing that directly, but since "SetUnitCount" is a valid LUA callback, you can use Zerted's code console to directly set the unit count of a particular team. Use "code console," type:

Code: Select all

SetUnitCount(team#, unitcount)
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: How would I use fake console to lower AI on my side?

Post by fasty »

What I do is I click "kill all ai on team 1 & 2" then I click "number of bots" and type in whatever number I want. The number of bots will spawn in. Of course it only works for both teams. Hope it helps.
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: How would I use fake console to lower AI on my side?

Post by myers73 »

If you want it to happen every map write a custom user_script (direction in the 1.3 documentation, so please dont ask how) and use the code Maveritchell posted
User avatar
hypshadowthehedgehog
Private First Class
Posts: 88
Joined: Wed Mar 11, 2009 5:38 pm

Re: How would I use fake console to lower AI on my side?

Post by hypshadowthehedgehog »

I'm having trouble getting the fake console command to work
I've tried several different variations (as in spacing) of:
SetUnitCount(1, 8)
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: How would I use fake console to lower AI on my side?

Post by myers73 »

Code: Select all

SetUnitCount(1, 8)
SetUnitCount(2, 8)
User avatar
Maveritchell
Jedi Admin
Jedi Admin
Posts: 7366
Joined: Mon Aug 21, 2006 11:03 pm

Re: How would I use fake console to lower AI on my side?

Post by Maveritchell »

hypshadowthehedgehog wrote:I'm having trouble getting the fake console command to work
I've tried several different variations (as in spacing) of:
SetUnitCount(1, 8)
I honestly don't know if that'll work anywhere besides the ScriptInit section - so I may have been wrong in suggesting that. In any case, it looks like Zerted built that in to the fake console anyway (Add Units to Team X). If you're trying to set up an unbalanced game, you can always disallow AI spawn on your side - that I know will work.
User avatar
hypshadowthehedgehog
Private First Class
Posts: 88
Joined: Wed Mar 11, 2009 5:38 pm

Re: How would I use fake console to lower AI on my side?

Post by hypshadowthehedgehog »

well, i guess i'll just have to disallow ai spawn. Great. My two brothers, my sister, and I vs. computers. sweet
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: How would I use fake console to lower AI on my side?

Post by [RDH]Zerted »

Yes, use the Add Units to Team 1 and/or the Add Units to Team 2 fake console commands. They accept negative numbers, so if you want to reduce the AI by 5 bots, type in -5 when it prompts you for the amount of units to add. Afterwards, you will need to kill all the bots for it to take effect. In testing, I think it mostly worked... It should work in SP, it may work in MP if you're the host, and it won't work in MP if you're not the game's host. I don't know what happens if you set the amount of units on a team below zero.
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: How would I use fake console to lower AI on my side?

Post by myers73 »

no bots will spawn, or it will revert to default
Post Reply