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

[Vanilla] [1.0.0.317] Can't set plot ownership in scenarios/mods for Vanilla

Discussion in 'Civ6 - Bug Reports' started by Gedemon, Mar 3, 2019.

  1. Gedemon

    Gedemon Modder Moderator

    Joined:
    Oct 4, 2004
    Messages:
    8,448
    Location:
    France
    Since version 1.0.0.290, WorldBuilder.CityManager is nil in gameplay/script context with the base game, which has broken the ability to change plot ownership using WorldBuilder.CityManager():SetPlotOwner(x, y, playerID, CityID)

    We can't use plot:SetOwner(playerID, cityID) as then the plot can't be selected to be worked by the city.

    This seems to be a bug instead of the expected behavior (for example WorldBuilder functions only available in WB mode) as WorldBuilder.CityManager is still available in gameplay/script context when the Gathering Storm expansion is activated.

    See this thread for more details:
    https://forums.civfanatics.com/threads/lua-function-not-working-after-update.642369/
     
    Infixo likes this.
  2. LeeS

    LeeS Imperator

    Joined:
    Jul 23, 2013
    Messages:
    6,124
    Location:
    Illinois, USA
    From the experimentation I did re the linked thread and the invalid function error that was occuring, no change on the behavior appears to occur whether syntax
    Code:
    WorldBuilder.CityManager():SetPlotOwner(PlotObject, CityObject)
    or syntax
    Code:
    WorldBuilder.CityManager():SetPlotOwner(iX, iY, iPlayerID, iCityID)
    is used.

    WorldBuilder.CityManager():SetPlotOwner(args) is recognized and executed from an AddGameplayScripts type of InGame Action when running either of Rise and Fall and Gathering Storm but not when running Vanilla after the Gathering Storm "update", even for users who do not have Gathering Storm.

    The modinfo code for the testing I ran
    Code:
      <InGameActions>
        <AddGameplayScripts id="GS_TestScripting">
          <File>LUA/GS_TestScripting.lua</File>
        </AddGameplayScripts>
    Just to be clear on how we are attempting to implement the code in mods. This is also the same type of modinfo action "set-up" TC's Strategic Forts mod is using.
     
    Last edited: Mar 3, 2019
  3. TC_

    TC_ Chieftain

    Joined:
    Jul 8, 2017
    Messages:
    55
    Gender:
    Male

    Attached Files:

  4. Gedemon

    Gedemon Modder Moderator

    Joined:
    Oct 4, 2004
    Messages:
    8,448
    Location:
    France
    1.0.0.314 : WorldBuilder.CityManager still nil in vanilla.
     
    Last edited: Apr 11, 2019
  5. Gedemon

    Gedemon Modder Moderator

    Joined:
    Oct 4, 2004
    Messages:
    8,448
    Location:
    France
    1.0.0.317 :

    WorldBuilder.CityManager still unavailable in vanilla

    pPlot:SetOwner(playerID, cityID) still doesn't allow the city to work the plot:
    Spoiler unworkable plot :
    Clipboard-1.jpg


    Spoiler Yet the UI registers that the plot is owned by the city :
    Clipboard-2.jpg
     
  6. dshirk

    dshirk Firaxian

    Joined:
    Oct 31, 2005
    Messages:
    818
    Taking a look, thank you!
     
  7. Gedemon

    Gedemon Modder Moderator

    Joined:
    Oct 4, 2004
    Messages:
    8,448
    Location:
    France
    @LeeS @TC_ that hack may be of use to continue development of mods depending on plot ownership change for civ6 vanilla until it's fixed on Firaxis side.
     
  8. LeeS

    LeeS Imperator

    Joined:
    Jul 23, 2013
    Messages:
    6,124
    Location:
    Illinois, USA
    There was another issue with lua plot-ownership-assignment which the author of the Usable Forts mod was not concerned by, which is that even with the WorldBuilder.SetPlotOwner method, modifiers that such plots ought to qualify for aren't applied to the plot so far as I have ever been able to determine. A save of the game and a reload of the save cures this issue, however, since on game reload the game-core (I assume) needs to process all in-game objects and assign their qualifying modifiers.

    Sorry but I simply forgot to mention this additional issue earlier.
     
  9. Gedemon

    Gedemon Modder Moderator

    Joined:
    Oct 4, 2004
    Messages:
    8,448
    Location:
    France
    I don't know for that specific issue, but at least WorldBuilder.CityManager was restored for vanilla in the last patch (and still allow the city to work the plot), thanks.

    Not really an issue now that WorldBuilder.CityManager is available again, but as a side note, using pPlot:SetOwner(playerID, cityID) still doesn't allow the city to work the plot.
     

Share This Page