Azurency / CQUI_Community-Edition

Civilization 6 mod - UI enhancements, reduce clicks and manage your empire faster!
MIT License
399 stars 98 forks source link

Future Tech/Civic is unselectable #115

Open Azurency opened 7 years ago

Azurency commented 7 years ago

Issue by chaorace Saturday Jun 03, 2017 at 04:12 GMT Originally opened as https://github.com/CQUI-Org/cqui/issues/548


This is a secondhand report from the Steam comments, but I've seen it a few times now and I think it's an edge case worth investigating since we do have some heuristics which specifically don't account for repeating techs

Azurency commented 7 years ago

Comment by ricanuck Sunday Jun 04, 2017 at 03:27 GMT


Yes, I have seen it, quick workaround was to select Futures from the World Tracker instead, which is in fact easier than going to the Tree to select them.

Azurency commented 7 years ago

Comment by JHCD Sunday Jun 04, 2017 at 11:28 GMT


Never seen that problem and I always open the Tree... Occours that problem only for the repeatable entries?

Azurency commented 7 years ago

Comment by chaorace Sunday Jun 04, 2017 at 17:38 GMT


@JHCD Yes, I believe it's only for repeat entries

Azurency commented 7 years ago

Comment by ricanuck Tuesday Jun 06, 2017 at 17:40 GMT


Yes, IIRC, it triggers after the first Future was selected, and you try to select the second.

Azurency commented 7 years ago

Comment by SpaceOgre Saturday Jul 08, 2017 at 11:13 GMT


The problem is here:

function SetCurrentNode( hash )
  if hash ~= nil then
    local localPlayerCulture = Players[Game.GetLocalPlayer()]:GetCulture();
    -- Get the complete path to the tech
    local pathToCivic = localPlayerCulture:GetCivicPath( hash );
    local tParameters = {};
    tParameters[PlayerOperations.PARAM_CIVIC_TYPE]  = pathToCivic;
    if m_shiftDown then
      tParameters[PlayerOperations.PARAM_INSERT_MODE] = PlayerOperations.VALUE_APPEND;
    else
      tParameters[PlayerOperations.PARAM_INSERT_MODE] = PlayerOperations.VALUE_EXCLUSIVE;
    end
    UI.RequestPlayerOperation(Game.GetLocalPlayer(), PlayerOperations.PROGRESS_CIVIC, tParameters);
        UI.PlaySound("Confirm_Civic_CivicsTree");
  else
    UI.DataError("Attempt to change current tree item with NIL hash!");
  end

end

It seems like localPlayerCulture:GetCivicPath does not work so well when the tech is researched. I think this is a problem in vanilla to since I can't find anything different from our code that interferes with this. I tried to replace the pathToCivic with the hash instead and that works.

I think we might need to a special SetCurrentNode for the future civic and tech that checks if is done and then just adds the hash instead of the pathToCivic.

Azurency commented 7 years ago

Comment by ehmonny Tuesday Aug 01, 2017 at 04:03 GMT


@SpaceOgre

Hey man, just wondering if there are any resolutions to this issue yet. I just downloaded the CQUI mod and I've run into the issue listed above. I'm not able to select tech/civic and I can't set any policies either.

I'm really not familiar with programming so I'm not sure if that was a solution that you posted above.

Any help is greatly appreciated.

Thanks

Azurency commented 7 years ago

Comment by SpaceOgre Tuesday Aug 01, 2017 at 08:24 GMT


@ehmonny Sorry nothing yet and will have to wait until the Summer Patch fixes are done.

Azurency commented 7 years ago

Comment by ehmonny Tuesday Aug 01, 2017 at 20:49 GMT


Thanks very much for the quick reply