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

TechPrereqs causing crash when Capital founded

Discussion in 'Civ5 - Creation & Customization' started by Elliot Codd, Jun 9, 2019.

  1. Elliot Codd

    Elliot Codd Chieftain

    Joined:
    Oct 16, 2016
    Messages:
    5
    Location:
    New Hampshire
    I have recently implemented a complete rework of the tech tree in a scenario I have been cobbling together for a while now. I partially used a tool, IndieStoneTechEditor, for the code generation, but basically most techs were deleted and a host of new ones added in. I removed the final three eras as well.

    Anyway, when I or any other player founds a city including the capital, the game crashes right away. Lua.log sends me to Database.log, which says:
    Code:
    [1454847.500] near " ": syntax error
    [1454847.500] In Query - select * from Technology_PrereqTechs where
    
    and no other unexpected errors. I'll attach it below.

    What is driving me crazy is what that syntax error means. Am I looking for a pair of quotes ( " " ) or misplaced whitespace, or some hidden character?

    I can supply other files, but I wouldn't know where to start.
    I would greatly appreciate any suggestions or points of view - I just can't let myself stare at this anymore.
     

    Attached Files:

    Last edited: Jul 3, 2019
  2. LeeS

    LeeS Imperator

    Joined:
    Jul 23, 2013
    Messages:
    6,284
    Location:
    Illinois, USA
    You need to compare the timestamps on the error messages in database.log to the timestamps in Stopwatch.log to determine which file(s) were being loaded when the error(s) were reported in database.log

    Code:
    near " "
    is indicative of an error just before a space.
    Code:
    near ","
    would be indicative of an error just before a comma character, as an example comparison message.

    "just before" however, is somewhat open-ended because database log reports the character nearest following the syntax error as far as the SQL parser is able to parse the erroneous line of code. Sometimes this can actually mean a syntax error quite a bit before the indicated character because the syntax error is making it impossible for the SQL parser to interpret the string of characters between the actual problem and a character it is able to "recognize".

    Code:
    select * from Technology_PrereqTechs where
    in your database.log should give a clue as to what to be looking at.

    Without the files of the mod themselves to look at, however, it will be impossible to provide more guidance than that. The mod itself zipped and added to a post is preferred.
     
    Last edited: Jun 9, 2019
  3. Elliot Codd

    Elliot Codd Chieftain

    Joined:
    Oct 16, 2016
    Messages:
    5
    Location:
    New Hampshire
    Thank you for the reply LeeS- I’ve seen you around this forum a lot, and I appreciate it.

    I had meant to mention, I did check the Stopwatch.log and the Database error is at a time definitely after the last line noted in Stopwatch. Seeing as the error comes only on a taken action once fully in game, I suppose no files are being loaded in at that point.

    When I get back to my computer I will attach that other log. As for zipping the mod, I can do it then as well, if need be.
     
  4. Elliot Codd

    Elliot Codd Chieftain

    Joined:
    Oct 16, 2016
    Messages:
    5
    Location:
    New Hampshire
    Attached here is the Stopwatch log, as well as the scenario zipped - minus the art. I couldn't get it to upload otherwise, hope that is alright.

    Thank you again for any suggestions you can offer.


    Edit: Ask me any questions you need to about my files - I'm attaching separately the only files I know I altered the Tech Prereqs table in, so you may not need to slog through my whole mod. Just trying to be helpful - I don't know where to start explaining.
     

    Attached Files:

    Last edited: Jun 10, 2019
  5. LeeS

    LeeS Imperator

    Joined:
    Jul 23, 2013
    Messages:
    6,284
    Location:
    Illinois, USA
  6. Elliot Codd

    Elliot Codd Chieftain

    Joined:
    Oct 16, 2016
    Messages:
    5
    Location:
    New Hampshire
    I'm sorry - I wasn't even thinking, of course you need them. My ART folder is ~50MB, but the site here refuses to upload it. Which makes me suddenly realize that none of my image files are compressed in my mod - should they be? This started out as a small mod that grew over time, and I never put any thought into it. I've been doing this for a while, but in my own private way, so I haven't necessarily been efficient.

    I really appreciate you sticking with me -

    This is the only way I can do it right now:
    https://drive.google.com/open?id=16stFes388n202ZtWr-v6hwnYChjUy07C
    (to be dropped in with the other folders)
     
  7. Elliot Codd

    Elliot Codd Chieftain

    Joined:
    Oct 16, 2016
    Messages:
    5
    Location:
    New Hampshire
    Okay - I solved the problem. Thank you, LeeS, for you help, but ultimately the SQL syntax error I was fretting about had nothing to do with my crash.

    For the sake of anyone else who will run into this problem, I was able to track the crash to a single file.
    When I overhauled the Tech Tree, I ran into a few database errors in "AIEconomicStrategies", because two of these strategies have Tech prerequisites. Since I removed boats in my expansion (as well as no oceans), I tried deleting them and their related flavors, and it turns out they would crash my game instantly and without a logged error when any player founded a city.

    These are the particular offenders:
    Code:
    <AIEconomicStrategies>
        <Delete Type="ECONOMICAISTRATEGY_EXPAND_TO_OTHER_CONTINENTS" />
        <Delete Type="ECONOMICAISTRATEGY_REALLY_EXPAND_TO_OTHER_CONTINENTS" />
    
    etc
    
    I have avoided the problem by re-mapping the prereq tech to Future Tech.
     

Share This Page