1. We have added the ability to collapse/expand forum categories and widgets on forum home.
    Dismiss Notice
  2. All Civ avatars are brought back and available for selection in the Avatar Gallery! There are 945 avatars total.
    Dismiss Notice
  3. To make the site more secure, we have installed SSL certificates and enabled HTTPS for both the main site and forums.
    Dismiss Notice
  4. Civ6 is released! Order now! (Amazon US | Amazon UK | Amazon CA | Amazon DE | Amazon FR)
    Dismiss Notice
  5. Dismiss Notice
  6. Forum account upgrades are available for ad-free browsing.
    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 tested on a few different map sizes/settings and it worked as intended.
    You are changing the values at the top of the lua file, and have the mod activated correct. I am sorry if silly questions, but I am not sure why it wouldn't work for you.
    Could you post your lua log file (from C:\Users\you computer\Documents\my games\Sid Meier's Civilization VI\Logs) To post here, you will need to rename to lua.txt.
     
  2. gyogen2

    gyogen2 Chieftain

    Joined:
    May 8, 2014
    Messages:
    1,201
    It was because of the event I was using to call the function

    If you want to play hotseat, open the ScoutSpawn.lua and at the bottom, just below function Initialize() add:

    Events.LocalPlayerChanged.Add( OnPlayerTurnActivated );

    I will post an update if you'd rather just re-download.
     
  3. gyogen2

    gyogen2 Chieftain

    Joined:
    May 8, 2014
    Messages:
    1,201
  4. gyogen2

    gyogen2 Chieftain

    Joined:
    May 8, 2014
    Messages:
    1,201
    Just a note, it wasn't the event I used, it was because I forgot I still had a line in from the original that removed the call. Anyway, should work now.
     
  5. gyogen2

    gyogen2 Chieftain

    Joined:
    May 8, 2014
    Messages:
    1,201
    I just noticed while testing something else that when starting in later eras, if the game starts on a turn other than 1 then this script would not fire. I have adjusted and will upload an update when finished with other testing
     
    Daft73 likes this.
  6. gyogen2

    gyogen2 Chieftain

    Joined:
    May 8, 2014
    Messages:
    1,201
  7. kiwionstilts

    kiwionstilts Chieftain

    Joined:
    Nov 24, 2016
    Messages:
    3
    Gender:
    Male
    That's so weird, I did exactly that. I change the numbers at the very top. Here is a copy and paste of the top section with the changes I made:

    local numSettlers = 5 --------------------------------------------set number of extra starting settlers for player
    local numScouts = 5 --------------------------------------------set number of extra starting scouts
    local numBuilders = 5 ---------------------------------------------set number of extra starting builders
    local TechOne = GameInfo.Technologies["TECH_POTTERY"]; ------------set technology
    local TechTwo = GameInfo.Technologies["TECH_ANIMAL_HUSBANDRY"]; ---set technology
    local TechThree = GameInfo.Technologies["TECH_MINING"]; -----------set technology to start with less techs, local TechThree;
    local PlayerGold = 999 --------------------------------------------set gold
    local iScout = GameInfo.Units["UNIT_SCOUT"].Index -----------------set unit
    local iSettler = GameInfo.Units["UNIT_SETTLER"].Index -------------set unit
    local iBuilder = GameInfo.Units["UNIT_BUILDER"].Index -------------set unit

    I wanted 5 of each unit, and 999 units of gold. Even when I make this change and re-start the game it stays with the original 5 x scouts, 3 x builders, and 1 x settler. Gold stays at 100.
     
  8. gyogen2

    gyogen2 Chieftain

    Joined:
    May 8, 2014
    Messages:
    1,201
  9. gyogen2

    gyogen2 Chieftain

    Joined:
    May 8, 2014
    Messages:
    1,201
    There was an issue I found depending on start era, don't know if that's what affected you, but you could try latest update and see if it helps.
     
  10. kiwionstilts

    kiwionstilts Chieftain

    Joined:
    Nov 24, 2016
    Messages:
    3
    Gender:
    Male
    OMG... so the software I downloaded from the Windows store wasn't saving the changes even though it appeared that I had. I downloaded different software that actually saved it and made all the difference lol. I knew it would be something stupid. Thanks :)
     
  11. DinoHullo

    DinoHullo Chieftain

    Joined:
    Nov 5, 2016
    Messages:
    5
    Gender:
    Male
    Are lines of code similar to the one that add's gold to add faith and culture? Is there someplace where the different api calls are documented?
     
  12. DinoHullo

    DinoHullo Chieftain

    Joined:
    Nov 5, 2016
    Messages:
    5
    Gender:
    Male
    Did you try adding a swordsman (the generic version of Legion)? With Mynex's code I added spearman and since I was playing as Gorgo they come in as Hoplite's. Not sure if the same will work with this code.
     
  13. gyogen2

    gyogen2 Chieftain

    Joined:
    May 8, 2014
    Messages:
    1,201
    I am not sure if they are documented anywhere yet, but you can find them in the ltp files in the debug folder, and tuner files in ui folder. Only issue is currently they only work in gamescripts, which right now will only load in new game start, not saves.
     
  14. gyogen2

    gyogen2 Chieftain

    Joined:
    May 8, 2014
    Messages:
    1,201
    I'v only focused on the mechanics and haven't tried a lot of different units. The code for creation is the same, so I would imagine same results.
     
  15. kalibre45xx

    kalibre45xx Chieftain

    Joined:
    Nov 24, 2016
    Messages:
    3
    Thanks! Just A quick note, it only works if you start the game in "ANCIENT ERA"
     
  16. gyogen2

    gyogen2 Chieftain

    Joined:
    May 8, 2014
    Messages:
    1,201
    I have updated for this. When I originally did code I neglected to consider all eras don't start on turn 1, the newest update should solve this.
     
  17. Daft73

    Daft73 ¯\_(ツ)_/¯

    Joined:
    Jan 23, 2008
    Messages:
    496
    Location:
    Baba Yaga's Hut
    Spoiler :

    Spoiler :

    6b94d5be9a89d16f188de2fa37d2e10d.png


    Well the good news is that you got it sorted out. :crazyeye:
     
  18. KevSkegRed

    KevSkegRed Chieftain

    Joined:
    Jun 21, 2015
    Messages:
    54
    Location:
    Skegness, Lincolnshire, England
    Love this as it stops the need to edit the actual game code but, I've downloaded the latest version and it had missionaries in the builder line so when I started my game I got 2 missionaries instead of builders. I've edited it in mine. Just thought I'd let you know. Thanks very much for the mod though.
     
  19. gyogen2

    gyogen2 Chieftain

    Joined:
    May 8, 2014
    Messages:
    1,201
    Oh sorry, I was using this script to test another one involving religious units when I found the starting era problem. I guess I forgot to change unit back to builder. Shouldn't try to fix one thing while working on another I guess:crazyeye:
     
  20. gyogen2

    gyogen2 Chieftain

    Joined:
    May 8, 2014
    Messages:
    1,201

Share This Page