Adding a Unit at a Specific Turn for a Specific Civilization (if Alive)

Genghis.Khan

Person
Joined
Jun 9, 2012
Messages
934
Location
Somewhere
Disclaimer: I have no programming experience in Lua or any other language except XML and SQL, but I am able to follow some of Lua, Visual Basic, and sometimes C++ logic. However, I would prefer to, if you have the time and you are willing to help, post whole code templates instead of giving me a function. Even if I apreciate it, I don't know how to use it :blush:;). :thanx:

My Progress

Code:
--Spawn a Unit for a Civilization if Alive
--CheckTurn Code and If Code
					 	Players[ID]:AddFreeUnit(e.g.70,5);
elseif (Players[ID]:GetNumCities() == 0) then
--Dummy Code
                                                 Player[ID]:ChangeNumGold(0);
 -- I can't understand, 70,5 means a Horseman, is there any Reference/Pattern/Logic for this?

Missing:
-Check Turn;
-if Turn >X then

Sorry for bothering :blush:
 
The example you give is from the Mongol (DLC01) scenario. 70 is the unit id and 5 is the UNITAI_ type

Better to use GameInfoTypes.UNIT_WARRIOR (etc) and UNITAI_ATTACK (etc)
 
thanks. Btw is => an acceptable syntax for over (number)

Example

Code:
if (Players[ID]:GetNumCities() =>0) then

And is the Add Free Unit Method something like this:

Code:
Players[ID]:AddFreeUnit(GameInfoTypes["UNIT_WHATEVER"])
 
Back
Top Bottom