Help with Civilization trait & UU

Crocius777

Chieftain
Joined
Jun 12, 2015
Messages
1
I'm extremely new to LUA and looking for general help in how I might go about doing two things:

First, make a civ's trait that any unit they kill is converted into their unique unit, a worker class unit.

Secondly, make this worker unit lose health whenever it spends a turn building, and be able to sacrifice itself to give production to a nearby city.

Also, as a sidenote, how can you give a worker unit combat strength without causing the game to crash when it engages in combat? Thanks.
 
I did something very similar with the Lua I wrote for this Shakugan no Shana Civilization, so you may find that helpful for what you are trying to do.

The main things are the functions tied to UnitPreKill and the function to spawn units upon a specific unit's death. You can probably try to change the conditions to what you need.

One of her units (called a Torch) also is set to lose health every single turn, although you can potentially restrict that to only when someone is building something via pUnit:GetBuildType().

As far as the crashing problem, it's likely because the Worker model doesn't have any animations set for attacks, or something similar. I know I had some issues when I tried to mix some combat unit models into a Civilian unit a while back, and had similar crashing issues.

You can try to look into Rome's Legions instead.
 
Back
Top Bottom