Resource icon

Extra Human-Player Units at Game Start 1.05

gyogen2

Emperor
Joined
May 8, 2014
Messages
1,201
gyogen2 submitted a new resource:

Extra Player Units at Game Start - Spawns extra Settler, Scout, and/or Builder units at start of game.

This is a mod I had made for someone, and thought I would go ahead and post in case anyone else was interested.

It spawns extra player units at the start of a new game. The number of units can be set in the first three lines of the lua.
Code:
local numSettlers = 1  ---------------------------set number of extra starting settlers for player
local numScouts   = 1  ---------------------------set number of extra starting scouts
local numBuilders = 1 ----------------------------set number of...

Read more about this resource...
 
You made that for me, and I'm much appreciative! I added it as an optional download to the one I made that gave extra units to all players over at Nexus.

This version looks a lot more... involved... than the one you made for me. lol.

Should I update that mine with this code?

And again, not enough thanks for helping me in the first place! :D
 
Why this in a lua script? You can configure that easily according to Eras.xml, for example by sql file:
Code:
-- Starting with Builder in Ancient Era
INSERT INTO MajorStartingUnits (Era, Unit, Quantity, NotStartTile) SELECT "ERA_ANCIENT", "UNIT_BUILDER", "1", "1";
 
This is only for the human player, for those who want an extra start.
Oh okay, yeah, it's a pity there is only an AiOnly-parameter for the MajorStartingUnits table. I guess giving the player unnecessary advantages isn't in the agenda of Firaxis.
 
Maybe rename the mod title to "Extra Human-Player Units...", before every other here asks again. :)
 
If you like, The only main difference is I added the options to make it easier for people to change.
I did not know you had already uploaded or I wouldn't have posted.

Yea, I looked at it, I see where it's much easier to adjust now.

I only post on Nexus so I only have 1 place to update things as needed... Besides, the human only version wouldn't exist without you (no matter how many times I beat my head against the code :D )!
 
does this affect the AI?does this affect the AI?does this affect the AI?does this affect the AI?does this affect the AI?does this affect the AI?does this affect the AI?does this affect the AI?does this affect the AI?does this affect the AI? :sarcasm:
 
add these lines in appropriate places:
Code:
local numYourUnit = 2 ----------------------------set number of extra starting Your Units

local iYourUnit = GameInfo.Units["YOUR_UNIT"].Index

               if numYourUnit > 0 then
                     for i = 1, numYourUnit do
                        for direction = 1, DirectionTypes.NUM_DIRECTION_TYPES - 1, 1 do
                            adjacentPlot = Map.GetAdjacentPlot(lastPlot:GetX(), lastPlot:GetY(), direction);
                            if (adjacentPlot ~= nil) and not (adjacentPlot:IsWater() or adjacentPlot:IsImpassable()) then
                                break      
                            end
                        end
                        pUnit3 = playerUnits:Create(iYourUnit, lastPlot:GetX(), lastPlot:GetY())
                        lastPlot = Map.GetPlot(pUnit:GetX(), pUnit:GetY());
                    end
               end

Keeping the last block (if numYourUnit - end) above Events.PlayerTurnActivated.Remove(OnPlayerTurnActivated)
 
does this affect the AI?does this affect the AI?does this affect the AI?does this affect the AI?does this affect the AI?does this affect the AI?does this affect the AI?does this affect the AI?does this affect the AI?does this affect the AI? :sarcasm:
Spoiler :
3-Austin-Powers-quotes.gif
 
I was playing around with this yesterday (before u put up the extra code for other units) and was able to plonk warriors in as a extra unit to the other 3 and it all worked fine.

Been trying to add Legions (bc i can and i play romans a lot) and it just wont take it. Is the game hard coded not to take more modern units at the start? Or do other files need modifying to allow newer units?
 
Back
Top Bottom