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

Questions about marvels and station trade routes

Discussion in 'CivBE - Modding Help & Mod Creation' started by SaucyJ, Aug 1, 2016.

  1. SaucyJ

    SaucyJ Chieftain

    Joined:
    Jan 14, 2016
    Messages:
    39
    Currently it seems that the marvels (hydracoral brains, floating progenitor cities, etc.) are tied to the type of planet you're playing on (frigid, fungal, aquatic, etc.).

    Is there any way to randomize which marvels get placed? Based on the code I saw, the only way I could think to do this was to basically have an iteration of each marvel for each planet type (ie. have a "frigid planet" listing for the giant fungus, an "arid planet" listing for the giant fungus, all the way down the planetary line) but it seems that if I did that, the effect would be that EVERY marvel would get spawned on EVERY planet.

    So is there any way to randomize which get placed (and how many) without spawning all of them all of the time?

    ---

    My second question is regarding station trade routes. Let's say I have four cities: A, B, C, and D. Given the game's current internal trade route mechanic, I have the following routes:

    A-B, A-C, A-D, B-C, B-D, and C-D.

    But if I want trade routes to station S, I can only have:

    A-S OR B-S OR C-S OR D-S.

    Is there anywhere in the code where I can tweak it so that multiple cities can have trade routes to the same station?

    Thanks in advance,

    - SJ
     
  2. Ryika

    Ryika Lazy Wannabe Artist

    Joined:
    Aug 30, 2013
    Messages:
    9,238
    /edit: Nevermind, whoward is correct!
     
  3. whoward69

    whoward69 DLL Minion

    Joined:
    May 30, 2011
    Messages:
    8,129
    Location:
    Near Portsmouth, UK
    Code:
    UPDATE Marvels SET Planet=NULL;
    DELETE FROM HeroLandmark_PlanetBooleans;
    INSERT INTO HeroLandmark_PlanetBooleans(HeroLandmarkType, PlanetType) SELECT h.Type, p.Type FROM HeroLandmarks h, Planets p;
    
    Not sure the first SQL statement is strictly necessary, but it won't hurt
     
  4. SaucyJ

    SaucyJ Chieftain

    Joined:
    Jan 14, 2016
    Messages:
    39
    Many thanks!
     
  5. Ryika

    Ryika Lazy Wannabe Artist

    Joined:
    Aug 30, 2013
    Messages:
    9,238
    Small note though: You can still get multiple Marvels on the same map. Forgot to actually remove the code from my mod after I was done testing and I just got two (non-water) Marvels.

    Still too lazy to actually look at the code, but I'd assume the reason is that the code that would otherwise pick up the water marvel now picks up a random Marvel.

    -----------

    Increasing the amount of Trade Routes you're able to send towards a station doesn't seem to be possible.
     
  6. whoward69

    whoward69 DLL Minion

    Joined:
    May 30, 2011
    Messages:
    8,129
    Location:
    Near Portsmouth, UK
    If that's an issue (try, untested as at work)

    Code:
    UPDATE Marvels SET Planet=NULL;
    DELETE FROM HeroLandmark_PlanetBooleans WHERE HeroLandmarkType<>'HERO_LANDMARK_WATER';
    
    CREATE TABLE HeroLandmarks_Temp AS SELECT Type FROM HeroLandmarks WHERE Type<>'HERO_LANDMARK_WATER' ORDER BY RANDOM();
    CREATE TABLE Planets_Temp AS SELECT Type FROM Planets ORDER BY RANDOM();
    INSERT INTO HeroLandmark_PlanetBooleans(HeroLandmarkType, PlanetType) SELECT h.Type, p.Type FROM HeroLandmarks_Temp h, Planets_Temp p WHERE h.RowID=p.RowID;
    DROP TABLE HeroLandmarks_Temp;
    DROP TABLE Planets_Temp;
    
     
  7. SaucyJ

    SaucyJ Chieftain

    Joined:
    Jan 14, 2016
    Messages:
    39
    I think the normal multiple marvels is due to the hydracoral marvel proccing on how much of the map is water. If you have a mostly land primordial planet, you'll just get the crater; if it's an archipelago primordial planet, most likely you'll get the crater and the hydracoral brain.
     
  8. Ryika

    Ryika Lazy Wannabe Artist

    Joined:
    Aug 30, 2013
    Messages:
    9,238
    Yes, the Water Marvel spawns when a map has generated a certain amount of water. I think it's 50%+, but I'm not sure where I got that number from anymore.

    Anyway, whoward's solution seems to solve that "problem", and pretty elegantly, too. I guess it's really time for me to have a closer look at SQL. Randomizing Elements in tables opens up so many potential things one could play around with.:eek:
     
  9. whoward69

    whoward69 DLL Minion

    Joined:
    May 30, 2011
    Messages:
    8,129
    Location:
    Near Portsmouth, UK
    And so many new ways to crash/trash the game :lol:

    Take care with this approach, as every time the game is restarted the temp tables will randomise in a different way. While this is not an issue for things like city names (where the game checks for duplicates before naming the city) and in this case (where the table is only used during map generation), trying to randomise other tables will lead to weird results.

    For example, if in CivV you randomise the religion table, because a civ's religion is stored by ID and not by Type, every time the game reloads, the civ will get a differently named religion (been there, done that!)

    W
     
  10. Ryika

    Ryika Lazy Wannabe Artist

    Joined:
    Aug 30, 2013
    Messages:
    9,238
    Oh, I was mostly thinking about stuff that I can just play around with, not stuff to actually put into mods and release them - so the game crashing sounds like an okay outcome to me. :D
     

Share This Page

Ebates: Get Paid to Shop