SWBFGamers

Gaming for the Original SWBF1 and SWBF2/other games => Star Wars Battlefront (2004 Original) => Topic started by: Troop on July 26, 2016, 05:16:50 AM

Title: Can you make AI not use a unit?
Post by: Troop on July 26, 2016, 05: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.
Title: Re: Can you make AI not use a unit?
Post by: 1ИCΘ6И17Θ on July 26, 2016, 10: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.
Title: Re: Can you make AI not use a unit?
Post by: AnthonyBF2 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.
Title: Re: Can you make AI not use a unit?
Post by: Rayce on July 26, 2016, 11:20:37 AM
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.
Title: Re: Can you make AI not use a unit?
Post by: Troop on July 26, 2016, 11:48:33 AM
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?
Title: Re: Can you make AI not use a unit?
Post by: Rayce on July 26, 2016, 11:53:44 AM
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 (http://www.swbfgamers.com/index.php?action=downloads;sa=view;down=319).
Title: Re: Can you make AI not use a unit?
Post by: Troop on July 27, 2016, 02:55:52 AM
Quote from: Commander Awesome on July 26, 2016, 11:53:44 AM
That's what I just said.By using the mission.lvl builder (http://www.swbfgamers.com/index.php?action=downloads;sa=view;down=319).

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?
Title: Re: Can you make AI not use a unit?
Post by: Led on July 27, 2016, 07:15:25 AM
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. 

Title: Re: Can you make AI not use a unit?
Post by: Phobos on July 27, 2016, 10:16:57 PM
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.
Title: Re: Can you make AI not use a unit?
Post by: 1ИCΘ6И17Θ on August 10, 2016, 08: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.
Title: Re: Can you make AI not use a unit?
Post by: Troop on August 14, 2017, 07:33:58 AM
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.
Title: Re: Can you make AI not use a unit?
Post by: Rayce on August 14, 2017, 09:51:57 AM
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).
EhPortal 1.34 © 2024, WebDev