My problem is that I want my AI to go after different objectives at different times during my campaign map. Somehow, they always manage to go the opposite direction leaving me facing hordes of blood-thirsty droids. Is there a way to either 1. Activate/deactivate barriers, 2. Do the same for planning hubs or connection or 3. Inexorably force the AI to attack a certain region?
Thanks.
Dynamic AI Planning
Moderator: Moderators
- KnightsFan
- Second Lance Corporal

- Posts: 108
- Joined: Fri Mar 06, 2009 9:34 pm
-
Xavious
- Sith Master

- Posts: 2783
- Joined: Mon Jun 12, 2006 3:46 pm
Re: Dynamic AI Planning
Try these:
They're in the shipped Mustafar map; it's how they make sure the AI don't try to run across the bridge when it's out.
Code: Select all
BlockPlanningGraphArcs("ConnectionName");
DisableBarriers("BarrierName");
UnblockPlanningGraphArcs("ConnectionName");
EnableBarriers("BarrierName");- KnightsFan
- Second Lance Corporal

- Posts: 108
- Joined: Fri Mar 06, 2009 9:34 pm
Re: Dynamic AI Planning
Yay! Thanks! But why do you have ";" at the end of each one? Does that actually do anything in LUA?
Edit: The AI are walking straight through the barrier now... and I didn't disable it yet
Edit: The AI are walking straight through the barrier now... and I didn't disable it yet
-
RepSharpshooter
- Gametoast Staff

- Posts: 1351
- Joined: Tue Jul 10, 2007 4:10 pm
Re: Dynamic AI Planning
Are they following a path through the barrier? if so, disable that connection with lua as well.
-
FragMe!
- Gametoast Staff

- Posts: 2244
- Joined: Sat May 13, 2006 12:34 am
- Projects :: Not sure keep changing my mind.
- xbox live or psn: No gamertag set
- Location: Origin name GT_FragMe
- Contact:
Re: Dynamic AI Planning
Here is something from PsychoFred's site (which is a good source of information the link can be found in the FAQ)
Hidden/Spoiler:
- KnightsFan
- Second Lance Corporal

- Posts: 108
- Joined: Fri Mar 06, 2009 9:34 pm
Re: Dynamic AI Planning
I already knew about most of those, FragMe. They don't seem to work very well.
...And about 4/80 AI head the opposite direction of CP4.
...And I find myself fighting fighting the entire CIS force (ATT) yet my buddies (DEF) only occasionally try to support me.
Code: Select all
AddAIGoal(ATT, "Conquest", 100, "cp4")Code: Select all
AddAIGoal(DEF, "Defend", 100, "cp4")
AddAIGoal(ATT, "Conquest", 50, "cp4")- Frisbeetarian
- Jedi

- Posts: 1233
- Joined: Wed Sep 12, 2007 3:13 pm
Re: Dynamic AI Planning
Keep in mind that the number you use doesn't matter, as long as the AI only have one objective per team.
- [RDH]Zerted
- Gametoast Staff

- Posts: 2982
- Joined: Sun Feb 26, 2006 7:36 am
- Projects :: Bos Wars AI - a RTS game
- xbox live or psn: No gamertag set
- Location: USA
- Contact:
Re: Dynamic AI Planning
; are optional in Lua. I believe you can use them to put more than one command on the a single line (but I didn't look that up to be sure). Example:KnightsFan wrote:...why do you have ";" at the end of each one? Does that actually do anything in LUA?...
Code: Select all
x=5; why=7; y="no reason"