Gift a unit based on action - is it possible?

ShaneFarrell

Chieftain
Joined
Aug 6, 2007
Messages
35
Location
Dublin, Ireland
I'm trying a simple hunter-gatherer type mod to help me learn the basics. So far I have just got rid of the starting settler and the free tech, and also set the start year to 8000 BC.

Now, I want a way to gift a settler upon completing some task. Is this possible?

I'll start simple and gift it upon defeating one barbarian encampment. How will I go about this?
 
This is all Lua logic, of course (I can't give you a Lua tutorial but you will need this: wiki).

player:InitUnit() is what you need to spawn a settler.

The triggering condition you need is, unfortunately, somewhat complicated to code. Not impossible. But complicated. I suspect it would involve Events.RunCombatSim().
 
This is all Lua logic, of course (I can't give you a Lua tutorial but you will need this: wiki).

player:InitUnit() is what you need to spawn a settler.

The triggering condition you need is, unfortunately, somewhat complicated to code. Not impossible. But complicated. I suspect it would involve Events.RunCombatSim().

I had a feeling it would require Lua. I'll give it a go.

I'm starting a Computer Science degree in September, so it's something that I should get stuck into anyway.

Thanks for the pointer.
 
Back
Top Bottom