1. We have added a Gift Upgrades feature that allows you to gift an account upgrade to another member, just in time for the holiday season. You can see the gift option when going to the Account Upgrades screen, or on any user profile screen.
    Dismiss Notice

Extra Human-Player Units at Game Start 1.05

Spawns extra Settler, Scout, and/or Builder units at start of game.

  1. gyogen2

    gyogen2 Chieftain

    Joined:
    May 8, 2014
    Messages:
    1,201
    I just replaced the builder unit with legion and it spawned fine, want to post the code you used, may be something in it.
     
  2. SIGIMUS

    SIGIMUS Chieftain

    Joined:
    Nov 21, 2016
    Messages:
    6
    Gender:
    Male
    Hmm just thought, it could be bc its a speciality unit tied to Romans.....
     
  3. SIGIMUS

    SIGIMUS Chieftain

    Joined:
    Nov 21, 2016
    Messages:
    6
    Gender:
    Male
    Really? I just started a game with tanks, so i just thought it was speciality units. Odd that the extra unit code i put in works with warriors and tanks but not legions.
     
  4. SIGIMUS

    SIGIMUS Chieftain

    Joined:
    Nov 21, 2016
    Messages:
    6
    Gender:
    Male
    local numSettlers = 3 ----------------------------set number of extra starting settlers for player
    local numScouts = 3 ----------------------------set number of extra starting scouts
    local numLegions = 3 ----------------------------set number of extra starting legions
    local numBuilders = 3 ----------------------------set number of extra starting builders

    local iScout = GameInfo.Units["UNIT_SCOUT"].Index
    local iSettler = GameInfo.Units["UNIT_SETTLER"].Index
    local iLegion = GameInfo.Units["UNIT_LEGION"].Index
    local iBuilder = GameInfo.Units["UNIT_BUILDER"].Index

    function OnPlayerTurnActivated( player, bIsFirstTime )
    print("just a test-------------------------------------------------------------------------------");
    local pUnit;

    if (bIsFirstTime and player == Game.GetLocalPlayer()) then
    local currentTurn = Game.GetCurrentGameTurn();
    local SpawnTurn = 0;
    local playerUnits;
    local adjacentPlot;
    local unitPlot;
    if 1 == currentTurn then
    local pPlayer = Players[player]
    if pPlayer:IsHuman() then
    playerUnits = pPlayer:GetUnits()

    print("SpawnTurn", SpawnTurn) ;
    for i, unit in playerUnits:Members() do
    local unitTypeName = UnitManager.GetTypeName(unit)
    print("unitTypeName", unitTypeName) ;
    if "LOC_UNIT_SETTLER_NAME" == unitTypeName then
    SpawnTurn = 1;
    unitPlot = Map.GetPlot(unit:GetX(), unit:GetY());
    print("SpawnTurn", SpawnTurn) ;
    end
    end
    end

    if SpawnTurn == 1 then
    local lastPlot = unitPlot;
    if numScouts > 0 then
    for i = 1, numScouts do

    for direction = 1, DirectionTypes.NUM_DIRECTION_TYPES - 1, 1 do
    adjacentPlot = Map.GetAdjacentPlot((lastPlot:GetX() + 1), lastPlot:GetY(), direction);
    if (adjacentPlot ~= nil) and not (adjacentPlot:IsWater() or adjacentPlot:IsImpassable()) then
    break
    end
    end
    pUnit = playerUnits:Create(iScout, unitPlot:GetX(), unitPlot:GetY())
    lastPlot = Map.GetPlot(pUnit:GetX(), pUnit:GetY());
    end
    end
    if numSettlers > 0 then
    for i = 1, numSettlers 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
    pUnit2 = playerUnits:Create(iSettler, adjacentPlot:GetX(), adjacentPlot:GetY())
    lastPlot = Map.GetPlot(pUnit:GetX(), pUnit:GetY());
    end
    end
    if numLegions > 0 then
    for i = 1, numLegions 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
    pUnit2 = playerUnits:Create(iLegion, adjacentPlot:GetX(), adjacentPlot:GetY())
    lastPlot = Map.GetPlot(pUnit:GetX(), pUnit:GetY());
    end
    end
    if numBuilders > 0 then
    for i = 1, numBuilders 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(iBuilder, lastPlot:GetX(), lastPlot:GetY())
    lastPlot = Map.GetPlot(pUnit:GetX(), pUnit:GetY());
    end
    end
    Events.PlayerTurnActivated.Remove(OnPlayerTurnActivated)

    end

    end
    end
    end



    function Initialize()
    Events.PlayerTurnActivated.Add(OnPlayerTurnActivated)
    print("just a test init-------------------------------------------------------------------------------");
    end

    Initialize();
     
  5. gyogen2

    gyogen2 Chieftain

    Joined:
    May 8, 2014
    Messages:
    1,201
  6. SIGIMUS

    SIGIMUS Chieftain

    Joined:
    Nov 21, 2016
    Messages:
    6
    Gender:
    Male
    ah ok, makes sense bc its roman only, my bad :)

    cheers!
     
  7. Cellandine

    Cellandine Chieftain

    Joined:
    Dec 30, 2013
    Messages:
    16
    Location:
    Leipzig, Germany
    just a heads-up. When my wife and I used this mod in multiplayer, the units would just load in fine. However as soon as we both end the first turn, she drops out of the game, resynching and when she is back, her units are gone...
     
  8. gyogen2

    gyogen2 Chieftain

    Joined:
    May 8, 2014
    Messages:
    1,201
    Thanks for mentioning. I never thought of this for multiplayer and so never tested for it. Sorry for the inconvenience.
     
  9. Daft73

    Daft73 ¯\_(ツ)_/¯

    Joined:
    Jan 23, 2008
    Messages:
    498
    Location:
    Baba Yaga's Hut
    Found a bug. Upon reloading you first turn, let's say to start off with a new tactic or w/e...you lose your bonus units, and start with vanilla units; settler/warrior. :scan:
     
  10. gyogen2

    gyogen2 Chieftain

    Joined:
    May 8, 2014
    Messages:
    1,201
    This is a gamescript, and currently they are only loaded when a new game starts. If you try to reload, or open a save, the game will not load the script. Hopefully this is changed when tools released, or work around is found.
     
  11. gyogen2

    gyogen2 Chieftain

    Joined:
    May 8, 2014
    Messages:
    1,201
    gyogen2 updated Extra Human-Player Units at Game Start with a new update entry:

    Update Boosted Human Start

    Read the rest of this update entry...
     
  12. Shadole

    Shadole Chieftain

    Joined:
    Aug 7, 2015
    Messages:
    116
    Is there any way to make this apply to Hotseat players? I started a game with another person and only player 1 got the bonus, not player 2.
     
  13. WilliamTell

    WilliamTell Chieftain

    Joined:
    Apr 12, 2006
    Messages:
    5
    Stupid question (I am new to this): What .lua file do I modify?

    I tried adding the basic lines to the GreatestEarthMap.lua but nothing happened. I then unchecked the mod in the options menu, nothing happened, I then put it in a unique .lua file and included from the GreatesEarhMap.lua but nothing happened - so what .lua file do I modify?
     
  14. gyogen2

    gyogen2 Chieftain

    Joined:
    May 8, 2014
    Messages:
    1,201
    When I have a chance I will run some tests with hotseat and see if I can adapt.
     
  15. gyogen2

    gyogen2 Chieftain

    Joined:
    May 8, 2014
    Messages:
    1,201
    If you mean to set the gold, etc. then you open the ScoutSpawn.lua that is in the mod folder. It is the only lua in the folder.
     
  16. Shadole

    Shadole Chieftain

    Joined:
    Aug 7, 2015
    Messages:
    116
    Thank you! :D
     
  17. WilliamTell

    WilliamTell Chieftain

    Joined:
    Apr 12, 2006
    Messages:
    5
    I cannot find ScoutSpawn.lua in the "mod" folder. Full path would be helpful. MyDocs/Sids/Mods does not contain this file, and steamapps/Sids has no mod folder. Anyone willing to write up idiot proof instructions?

    Note: I downloaded Mynex More Starting Points and it is working, but I would really like to understand the basics.
     
  18. gyogen2

    gyogen2 Chieftain

    Joined:
    May 8, 2014
    Messages:
    1,201
    C:\Users\YourComputer\Documents\my games\Sid Meier's Civilization VI\Mods\PlayerSpawn, You are talking about Extra Human-Player Units mod right?
     
  19. kiwionstilts

    kiwionstilts Chieftain

    Joined:
    Nov 24, 2016
    Messages:
    3
    Gender:
    Male
    Hi there, I tried your MOD, and change the numbers for settlers, builders, and scouts to 5 each and 3 each but this doesn't seem to take affect in in the game??? I also tried changing the amount of gold and this didn't make a difference either. No matter what I change it seems to stick with 1 x settler, 3 x builders, and 5 x scouts. Any suggestions what I could be doing wrong???
     
  20. gyogen2

    gyogen2 Chieftain

    Joined:
    May 8, 2014
    Messages:
    1,201

Share This Page