Making AI Repair Hardpoints? [Solved]

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

Ascertes
Private Second Class
Posts: 65
Joined: Thu Aug 18, 2016 3:42 pm
Projects :: Space Carida
xbox live or psn: No gamertag set

Re: Making AI Repair Hardpoints?

Post by Ascertes »

AQT wrote:AI will repair stuff if their UnitType is "pilot" and if one of their goals is "Conquest." This is similar to how AI will use snipe hint nodes if their UnitType is "sniper" and if one of their goals is "Conquest."
Alright, so how would it look in an LUA? Most of my modding work is BF1 so I'm not too terribly familiar with all the ins and outs of bf2 LUA scripting.

EDIT: I DID IT! I DID IT! HUZZAH!

Added this line to my LUA:

Code: Select all

    AddAIGoal(REP, "Conquest", 100)
    AddAIGoal(CIS, "Conquest", 100)
The only drawback however is that now I have a minimap for some reason. Wonder how I get rid of that?

EDIT2: They're not repairing them as much as I'd like...How do I increase their likelihood of repairing?
thelegend
Sith
Sith
Posts: 1433
Joined: Thu Jan 23, 2014 6:01 am
Projects :: Star Wars - Battlefront III Legacy
Games I'm Playing :: Swbf GTA CoD LoL KH
xbox live or psn: El_Fabricio#
Location: Right behind you :)

Re: Making AI Repair Hardpoints?

Post by thelegend »

Ascertes wrote:Alright, so how would it look in an LUA? Most of my modding work is BF1 so I'm not too terribly familiar with all the ins and outs of bf2 LUA scripting.
DisableSmallMapMiniMap() removes the small minimap from your HUD.
AQT
Gametoast Staff
Gametoast Staff
Posts: 4910
Joined: Sat Nov 03, 2007 4:55 pm
Location: SoCal, USA

Re: Making AI Repair Hardpoints?

Post by AQT »

Ascertes wrote:They're not repairing them as much as I'd like...How do I increase their likelihood of repairing?
The percentage of AI tasked with repairing things is relative to the other goals you have specified. For example, you currently have:

Code: Select all

AddAIGoal(REP, "Conquest", 100)
I don't know what other goals you are using, but let's say they are these:

Code: Select all

AddAIGoal(REP, "OtherGoal1", x)
AddAIGoal(REP, "OtherGoal2", y)
The percentage of AI tasked with repairing things (or "Conquest"-ing) would be 100 divided by the sum of 100, x, and y or 100/(100 + x+ y).
Ascertes
Private Second Class
Posts: 65
Joined: Thu Aug 18, 2016 3:42 pm
Projects :: Space Carida
xbox live or psn: No gamertag set

Re: Making AI Repair Hardpoints?

Post by Ascertes »

I have this as far as goals go:

Code: Select all

AddAIGoal(REP, "Deathmatch", 100)
AddAIGoal(REP, "Conquest", 100)
So, 100/(100 + 100) = 0.5

I'm assuming I can change those 2 numeric values?
AQT
Gametoast Staff
Gametoast Staff
Posts: 4910
Joined: Sat Nov 03, 2007 4:55 pm
Location: SoCal, USA

Re: Making AI Repair Hardpoints?

Post by AQT »

Yeah, you can change them. But make sure the goals for the CIS also add up to the same total even if they have less or more goals.
Ascertes
Private Second Class
Posts: 65
Joined: Thu Aug 18, 2016 3:42 pm
Projects :: Space Carida
xbox live or psn: No gamertag set

Re: Making AI Repair Hardpoints?

Post by Ascertes »

AQT wrote:Yeah, you can change them. But make sure the goals for the CIS also add up to the same total even if they have less or more goals.
Noted! Thank you so much for your help :)
Post Reply