login

Author Topic: Can you make AI not use a unit?  (Read 1027 times)

Sith-Trooper

  • Member
  • **
  • Posts: 8
    • View Profile
    • Awards
Can you make AI not use a unit?
« on: July 26, 2016, 06:16:50 AM »
Hi  :wave:

Quick question here.

Can you make the AI not use a unit? I mean, make only me use it. On SWBF2 you can make the unit amount only 1 and you choose it and the AI won't be able to choose it, but is it possible to make the same for SWBF1 by modding?

Thanks for any help.
Clone-Trooper: Excellent trooper.
Loads of them: kill loads of jedi.

Stormtrooper: Can't hit anything.
Loads of them: don't even shoot at Han, when he is single.

Wut? XD

Incognito

  • Imperial Gunner Survivor of the Death star incident.
  • Member
  • ***
  • Posts: 86
  • On the battlefront since 2009
  • Awards Special Award for those that play the original SWBF Special Award for those that play SWBF2
    • View Profile
    • Incog's realm
    • Awards
Re: Can you make AI not use a unit?
« Reply #1 on: July 26, 2016, 11:07:54 AM »
You see, I had the same idea for SWBF because I wanted to create a mod which would add a custom character only choosable by humans.
If memory serves it can be done by modifying a value in the team lua file.

Anthony_b

  • Battlefront 2 Tinkerer
  • Master Modder
  • Frequent Poster
  • ***
  • Posts: 155
  • 3 internet gamer friends met in reality, 10+ to go
  • Awards Recognizes someone who most generously donated funds to the site or the site
    • View Profile
    • The SWBF2 PSP Conversion Pack
    • Awards
Re: Can you make AI not use a unit?
« Reply #2 on: July 26, 2016, 11:13:56 AM »
In the SWBF map lua files you'll see the lines that look like AddUnitClass(IMP, "imp_dark_trooper",3)
The 3 is what tells the game how many bots to spawn as this class. I am guessing 0 makes AI use none. Cannot confirm as I never bothered with it.

Commander Awesome

  • SWBF 1&2 Modder
  • Moderators
  • This Man Has No Life
  • ****
  • Posts: 1339
  • Addicted to Battlefront since 2006.
  • Awards Special Award for players of the EA Reboot of SWBF Participated in the ICW6 Special Award for those that play SWBF2 Special Award for those that play the original SWBF
    • View Profile
    • Awards
  • PSN: AaTc_CmdrAwesome
  • Steam ID:
  • Origin ID: Skykiller_Legacy
Re: Can you make AI not use a unit?
« Reply #3 on: July 26, 2016, 12:20:37 PM »
In the SWBF map lua files you'll see the lines that look like AddUnitClass(IMP, "imp_dark_trooper",3)
The 3 is what tells the game how many bots to spawn as this class. I am guessing 0 makes AI use none. Cannot confirm as I never bothered with it.
In SWBF2 a value of 0 means no limit. I'm guessing it works the same way in SWBF1. A value of 1 makes it to where the AI won't use it if you're on their team. However there will be one of them controlled by the AI if you're on the opposite team. I've no clue how to get the AI to not spawn them at all, in either game. In fact, I asked the same question on GameToast.

Sith-Trooper

  • Member
  • **
  • Posts: 8
    • View Profile
    • Awards
Re: Can you make AI not use a unit?
« Reply #4 on: July 26, 2016, 12:48:33 PM »
Well, in SWBF2 you can modify map lua's to make which units be in which team and how many people can use it. Making the limit 1 would mean if a human is in a team that unit won't be used. So in that case, I assume you can do the same in SWBF1 as well but I don't know if there is a limit to that in SWBF1 luas.

How can you modify the stock map luas?
Clone-Trooper: Excellent trooper.
Loads of them: kill loads of jedi.

Stormtrooper: Can't hit anything.
Loads of them: don't even shoot at Han, when he is single.

Wut? XD

Commander Awesome

  • SWBF 1&2 Modder
  • Moderators
  • This Man Has No Life
  • ****
  • Posts: 1339
  • Addicted to Battlefront since 2006.
  • Awards Special Award for players of the EA Reboot of SWBF Participated in the ICW6 Special Award for those that play SWBF2 Special Award for those that play the original SWBF
    • View Profile
    • Awards
  • PSN: AaTc_CmdrAwesome
  • Steam ID:
  • Origin ID: Skykiller_Legacy
Re: Can you make AI not use a unit?
« Reply #5 on: July 26, 2016, 12:53:44 PM »
Making the limit 1 would mean if a human is in a team that unit won't be used. So in that case, I assume you can do the same in SWBF1 as well
That's what I just said.
How can you modify the stock map luas?
By using the mission.lvl builder.

Sith-Trooper

  • Member
  • **
  • Posts: 8
    • View Profile
    • Awards
Re: Can you make AI not use a unit?
« Reply #6 on: July 27, 2016, 03:55:52 AM »
That's what I just said.By using the mission.lvl builder.

Yeah. Also thanks for telling me about the mission.lvl builder.
Didn't know that.

So I edited and made only people can use it but there is one problem. There is no way to make AI not use it when I'm using it and make AI use it while I'm not using it.
You can either make it 1 which make's 1 of it appear even when you use it or make it 0 which makes AI not use it no matter what.

Can you make it use it while I don't and not use it while I do?
Clone-Trooper: Excellent trooper.
Loads of them: kill loads of jedi.

Stormtrooper: Can't hit anything.
Loads of them: don't even shoot at Han, when he is single.

Wut? XD

Led

  • Administrator
  • The Chosen One
  • *****
  • Posts: 5982
  • The 82nd Element
  • Awards Award for extensive modding contributions and/or donations to TWD Battlefront Special Award for players of the EA Reboot of SWBF Special Award for those that play the original SWBF
    • View Profile
    • Awards
  • Steam ID:
  • Tunngle ID: _PLA-Led
  • Origin ID: plaled
Re: Can you make AI not use a unit?
« Reply #7 on: July 27, 2016, 08:15:25 AM »
Yeah. Also thanks for telling me about the mission.lvl builder.
Didn't know that.

So I edited and made only people can use it but there is one problem. There is no way to make AI not use it when I'm using it and make AI use it while I'm not using it.
You can either make it 1 which make's 1 of it appear even when you use it or make it 0 which makes AI not use it no matter what.

Can you make it use it while I don't and not use it while I do?

You may find that there are single player options that are available that are not available in multiplayer.

However, I think you are wanting to make this game engine do something it was never programmed to keep track of. 


Phobos

  • =|ˇInViSˇ|= [FC]
  • Illuminated Modders
  • The Chosen One
  • ****
  • Posts: 5478
  • TWD Battlefront v0.94
  • Awards Shotgun Tournament 1st Place Award for extensive modding contributions and/or donations to TWD Battlefront Special Award for those that play the original SWBF To recognize Modders that make a most excellent contribution within the Month LeaderBoard 1 organized by GDH92 and ComSharpshot T.1 1v1 Tournament 1st Place organized by SleepKiller Releasing Multiple Mods on SWBFgamers.com Recognizes someone who most generously donated funds to the site or the site Special Award for those that play SWBF2
    • View Profile
    • Click here to download the Radar mod.
    • Awards
  • Steam ID:
Re: Can you make AI not use a unit?
« Reply #8 on: July 27, 2016, 11:16:57 PM »
There is no way to make AI not use it when I'm using it and make AI use it while I'm not using it.
You can either make it 1 which make's 1 of it appear even when you use it or make it 0 which makes AI not use it no matter what.
For this idea SWBF would need to support memorypool limitations for spawned units, which it doesn't except for Droidekas. So the unit would have to be a custom ODF with classlabel "walkerdroid" instead of "soldier" in order for AI to spawn only when players don't. Even then it would be limited to a specific number in both scenarios. 
 
Also in SWBF1, setting the number to 0 crashes the game for SP (only for primary factions). In MP it makes 0 AI spawn.
« Last Edit: July 27, 2016, 11:21:30 PM by Phobos »


Night Of The Living Dead Mod v1.11
When FC+YAK beat 1.0

SWBFSpy Admin & Founder
tiny.cc/fcrage

Incognito

  • Imperial Gunner Survivor of the Death star incident.
  • Member
  • ***
  • Posts: 86
  • On the battlefront since 2009
  • Awards Special Award for those that play the original SWBF Special Award for those that play SWBF2
    • View Profile
    • Incog's realm
    • Awards
Re: Can you make AI not use a unit?
« Reply #9 on: August 10, 2016, 09:03:23 AM »
Well, I made that for my "witness mode" mod and it works just fine, Single and Multiplayer, only the droids are spawning but the witnesses can only be played by humans.