Page 1 of 1
AI that cant spawn at CP
Posted: Sun Jul 07, 2013 5:51 pm
by Lorul1
Is there any posible way how to make a certain class not spawn at a command post. For example the jedi class cant spawn at CP3 (because CP3 is a mothership, and i dont want jedi flying planes). Maybe there is something that I need to put in a jedi lua to make them not spawn at a certain CP. and lastly im guessing that if you could do this it would only apply to AI and im fine with that.

is there any way this can be done ?
Re: AI that cant spawn at CP
Posted: Mon Jul 08, 2013 2:13 am
by Dreadnot9
You could create a third team with solely the jedi units on it, and then give them unique spawn paths (or their own command posts for that matter). This would allow you to easily control where they spawn, while still maintaining the units you desire.
The only issue with this is that you would not be able to spawn as the jedi. If you want to be able to play as your jedi units, then you can't prevent them from spawning at a team-owned cp (to the best of my knowledge). Hope this helped.
Re: AI that cant spawn at CP
Posted: Mon Jul 08, 2013 6:38 am
by Locutus
I think you can do it via Lua, too.
Place a region around your spawn path at the CP and add sth. like this:
OnCharacterSpawn(
function(character)
if GetCharacterClass(character) == "YOURJEDICLASS" then
checkJediRegion()
end
end
end
)
checkJediRegion()
OnEnterRegion(
function(region, player)
if IsCharacterHuman(player) then
print("Do nothing because jedi is human")
elseif GetCharacterClass(player) == "YOURJEDICLASS" then
KillObject (player)
end
end,
"YOURREGIONNAME"
)
end
This code kills a Jedi as soon as it's spawned and not controlled by a player.
Everything untested.
Re: AI that cant spawn at CP
Posted: Mon Jul 08, 2013 9:27 am
by THEWULFMAN
That could work. Another option is to make the Jedi class unplayable by the player, and put them on a local team, spawning on their own CPs which are everywhere but the mothership CP.
Re: AI that cant spawn at CP
Posted: Mon Jul 08, 2013 3:00 pm
by Lorul1
thanks for the ideas. :greeny: Ill see if that script works first, then try the other ideas.