Spawn alien nest?

Wardly

Chieftain
Joined
Nov 9, 2014
Messages
39
Is it possible to write up some LUA script that would spawn a new alien nest? I couldn't seem to locate anything on it. I know they have to reside on a Xenomass tile, but i'd like to spawn a new nest on particular conditions.
 
Code:
pPlot:SetImprovementType(GameInfotypes.IMPROVEMENT_ALIEN_NEST)

There's nothing requiring an Alien Nest to be on Xenomass, it's just what the game core does.

You can check for Xenomass with
Code:
if (pPlot:GetResourceType(-1) == GameInfoTypes.RESOURCE_XENOMASS) then
  ...
end
if you want to replicate that behaviour

HOWEVER, Alien Nests suffer from the same buggy code that Barb Camps do, that is, creating a new nest does NOT hook the nest into the code that then spawns aliens from the nest. So you'll need to remember where you placed nests and then every few turns use Lua to spawn a random alien from them
 
Yep. It's in the DLL - I fixed it in my modded CivV DLL
 
This was covered a little in my thread about improvements ("Creating a new Improvement, has anyone done it?"), I pointed out that it may be possible to drop a new civ down (on the specific location) and that civ would have the same stats / appearance of aliens and could be hostile towards players and AI but friendly towards the alien faction. This is the only work around that I could see working, however would required major modding.
 
This was covered a little in my thread about improvements ("Creating a new Improvement, has anyone done it?"), I pointed out that it may be possible to drop a new civ down (on the specific location) and that civ would have the same stats / appearance of aliens and could be hostile towards players and AI but friendly towards the alien faction. This is the only work around that I could see working, however would required major modding.
But then they could capture cities so you would have to run some Lua at the end of their turn and raze cities they might own, but there was no easy way to run Lua at the beginning/end of arbitrary AIs turns without some events that were added to modified dlls.
Would be easier to remember the location of the nests you spawn and then use Lua to spawn real Aliens nearby every couple turns as whoward pointed. It might however cause issues when you save and then load the game.
Was table saver-loader ported to BE or did firaxis finally allow saving arbitrary values in the saved games?
 
I didn't think about the aliens capturing cities but the whole thing is just an idea at the moment as I am still in the early stages, you could make them favour or bias razing cities and that way to odds of them capturing a city is near zero and unlikely (not a perfect solution). I like the idea of a unit that would allow several alien units to spawn in it's vicinity as that would meet what I want to do (create a unit capable of sending in other units/aliens to attack another civ without declaring war on them yet still with the risk that those created units could come back and attack you).
 
Well, that would probably require dll modding as i think it's how whoward changed the City States behavior in a Civ5 mod so they don't raze cities as often.

Having a unit that can spawn aliens is probably easier. Spawning units is easy to do with Lua so the hard part would be to create an UI button that triggers that "mission" (game term for unit "special actions") and the really hard part would be to have the AI use it as well.
 
Top Bottom