Can you make AI not use a unit?

Started by Troop, July 26, 2016, 05:16:50 AM

Previous topic - Next topic
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.
Should you turn to the dark side, you may see nothing...

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.
Also, check out my total conversion for BF1: Ferocious Battlefront
http://www.moddb.com/mods/ferocious-battlefront

RELEASE INCOMING

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.
Never let a person named AnthonyBF2 touch your BF2.

Quote from: Anthony_b on July 26, 2016, 10: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.
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.

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?
Should you turn to the dark side, you may see nothing...

Quote from: Sith-Trooper on July 26, 2016, 11:48:33 AM
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.
Quote from: Sith-Trooper on July 26, 2016, 11:48:33 AM
How can you modify the stock map luas?
By using the mission.lvl builder.

Quote from: Commander Awesome on July 26, 2016, 11:53:44 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?
Should you turn to the dark side, you may see nothing...

Quote from: Sith-Trooper on July 27, 2016, 02:55:52 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. 

Quote from: Abraham Lincoln. on November 04, 1971, 12:34:40 PM
Don't believe everything you read on the internet

July 27, 2016, 10:16:57 PM #8 Last Edit: July 27, 2016, 10:21:30 PM by Phobos
Quote from: Sith-Trooper on July 27, 2016, 02:55:52 AM
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.

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.
Also, check out my total conversion for BF1: Ferocious Battlefront
http://www.moddb.com/mods/ferocious-battlefront

RELEASE INCOMING

August 14, 2017, 07:33:58 AM #10 Last Edit: August 14, 2017, 07:35:33 AM by Troop
Now, I don't know if it's allowed to revive about 1 year old threads here but I don't like to start a new thread now.
I didn't play SWBF1 for a year but I decided to get back into it today. So now, I'm trying to do the same thing and now I encounter another problem.
Quote from: Phobos on July 27, 2016, 10:16:57 PMSo the unit would have to be a custom ODF with classlabel "walkerdroid" instead of "soldier"
I decided to do just that but then the game crashes when I try to pick Vader. I think the game crashes because it assumes Vader to be a droid of a kind and behave like one but the animations or the behaviour or something is different so the game crashes... So whatever is the reason, I don't think it's possible to have the AI use the class while you don't and not use it while you do. However, if there is a fix for this "walkerdroid" classlabel crash, I'd be pleased to know.
Should you turn to the dark side, you may see nothing...

If it's not because the unit has a human skeleton, it's because it has more than two weapons (or more than one in the same slot).