Spawning

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
woner11
Sith
Sith
Posts: 1361
Joined: Tue Sep 18, 2007 10:17 pm
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set
Location: The lost world of pickels
Contact:

Spawning

Post by woner11 »

Is it possible to have the AI spawn after the player spawns?
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: Spawning

Post by [RDH]Zerted »

Yes
woner11
Sith
Sith
Posts: 1361
Joined: Tue Sep 18, 2007 10:17 pm
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set
Location: The lost world of pickels
Contact:

Re: Spawning

Post by woner11 »

Could you tell me how?
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: Spawning

Post by [RDH]Zerted »

There are a couple of ways to do it. Do you want the AI spawn to be delayed only for the first human spawn? If so, when your map starts to load, disable AI spawning:

Code: Select all

AllowAISpawn( ATT, false )
AllowAISpawn( DEF, false )
Only on the first human character spawn (many campaign maps do this, look at their scripts), reenable AI spawning:

Code: Select all

AllowAISpawn( ATT, true )
AllowAISpawn( DEF, true )
I should point out that a server running this map will be stuck on it until a human player joins the game.
woner11
Sith
Sith
Posts: 1361
Joined: Tue Sep 18, 2007 10:17 pm
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set
Location: The lost world of pickels
Contact:

Re: Spawning

Post by woner11 »

Does this go in my lua, and if so, where?
User avatar
Teancum
Jedi Admin
Jedi Admin
Posts: 11080
Joined: Wed Sep 07, 2005 11:42 pm
Projects :: No Mod project currently.
Games I'm Playing :: Destiny
xbox live or psn: No gamertag set
Location: Indiana

Re: Spawning

Post by Teancum »

This is probably over your head to be honest. You need to understand lua scripting to do what you're wanting to do. Again, this is going back to keeping it simple.
Post Reply