Filtering spawns? Turret priorities?

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

Post Reply
User avatar
jangoisbaddest
Lieutenant General
Lieutenant General
Posts: 661
Joined: Mon Feb 27, 2006 12:10 am
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set
Location: All Along The Watchtower

Filtering spawns? Turret priorities?

Post by jangoisbaddest »

I went into the LUA files and saw that you could customize how many of each class you wanted on the battlefield, but I was wondering if you could actually control which classes spawn on which command posts (ex. snipers can spawn on cp_3, but not cp_1). It wouldn't have to be for human players, just for the AI. Just a thought.
A second thought is having engineers repair or build a turret as their highest priority, in a certain area or overall. These aren't biggies, I was just wondering, because these kinds of control options would be really nice.
User avatar
[RDH]Zerted
Gametoast Staff
Gametoast Staff
Posts: 2982
Joined: Sun Feb 26, 2006 7:36 am
Projects :: Bos Wars AI - a RTS game
Games I'm Playing :: SWBF2 and Bos Wars
xbox live or psn: No gamertag set
Location: USA
Contact:

RE: Filtering spawns? Turret priorities?

Post by [RDH]Zerted »

I'm not sure how you could get direct control over which units spawned at which CP, however, I know a way around it. In the lua, you can kill/respawn a certain type of unit spawning at a certain CP. If you kill a unit, you can add one to the renforcment count so it doesn't go down. As far as I know, the AI spawns randomly, so it a unit may go through a bunch of killings before it spawns where you want it. Make sure you set the respawn time to 0 or you will randomly get bunches of units waiting 15 seconds to spawn. This would work or on smaller maps, but the script would most likely slow the game down on maps with large amounts of units.

You might be able to just switch a unit class using SetProperty, but I haven't tried this yet.
User avatar
jangoisbaddest
Lieutenant General
Lieutenant General
Posts: 661
Joined: Mon Feb 27, 2006 12:10 am
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set
Location: All Along The Watchtower

RE: Filtering spawns? Turret priorities?

Post by jangoisbaddest »

But what about forcing the engineers to repair/build turrets? In my custom map, they don't do that, presumably because they are engaged in combat. Is there any way to tell them to disregard the flying lasers and just go straight for the turret?
User avatar
jangoisbaddest
Lieutenant General
Lieutenant General
Posts: 661
Joined: Mon Feb 27, 2006 12:10 am
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set
Location: All Along The Watchtower

Post by jangoisbaddest »

I have determined that indeed the engineers' build/repair behavior is overwritten when in combat. So how does one change that? I'm so angry because the AI doesn't care about the most important things in the battle (such as mantaining the turrets and staying behind barracades).
Post Reply