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

Some Observations About Events and Techs

Discussion in 'Civ4 - Creation & Customization' started by Merkava120, Feb 14, 2020.

  1. Merkava120

    Merkava120 Oberleutnant

    Joined:
    Feb 2, 2013
    Messages:
    380
    Gender:
    Male
    Location:
    Socially distant
    This is a really good idea. My nomadic start so far uses Mongol Camps from the database (I think originally by Bhuric, but I might be wrong) to do a similar thing.

    But I had not considered the "cannot reveal new tiles" feature. That would certainly force units to stay near the camp/tribe.

    It'd also be pretty easy to do through python, I think - just use a promotion, then under "canMoveTo" or whatever the equivalent is in EventManager.py, check if a unit has the 'Can't reveal tiles' promotion and prevent them from moving if the tile is unrevealed.
     
  2. Merkava120

    Merkava120 Oberleutnant

    Joined:
    Feb 2, 2013
    Messages:
    380
    Gender:
    Male
    Location:
    Socially distant
    I can actually envision how to do this, I think...using python's XML parser/writer. It'd be super messy though.

    Spoiler :
    You make all the pieces of the mod separately. Then when you settle a city in the first mod, python triggers an event that makes a new XML file containing the data from your civilization (what techs you had and such). Also triggers a pop-up that tells you "this mod is done, please move to mod 2".

    When you load mod 2 you just start some random game. During loading or on game start, the mod checks for the file, uses xml parse to read in data about your civilization, then sets it up in a sort of "advanced start" way. (Changing techs, civilizations, units, etc. is really easy through python.)

    Then when you launch the spaceship, the same thing is done again.

    You could also have it change terrain to match the original world but that would make the XML file very complicated (and I think the point is to make the old map useless, no?)


    You could also use that for a "tactical battle" python button.
    Spoiler :
    When you hit the button, the game saves an XML file and tells you to go switch to another mod. When you load the mod, the game loads the xml file and sets up the tactical battle for you. Then when you win or lose it writes a file saying so; you go back into the original game and press "load result" or whatever and it figures out who won/how much damage they took/etc.


    You could maybe use the worldbuilder too...

    Spoiler :
    When the first mod finishes, save it as a worldbuilder file. Then have a separate little script (C# or anything really) that goes through the worldbuilder file and changes it to comply with the second mod, and adds other civilizations and stuff. Then load up the same scenario in the second mod and away you go.

    The space part would be a little harder but still doable
     
  3. Zeta Nexus

    Zeta Nexus Deity

    Joined:
    Jan 23, 2014
    Messages:
    3,818
    Gender:
    Male
    Location:
    In a constant brainstorm...
    There's no need for that either. There is an xml tag for that: <bNoRevealMap>
     
  4. Merkava120

    Merkava120 Oberleutnant

    Joined:
    Feb 2, 2013
    Messages:
    380
    Gender:
    Male
    Location:
    Socially distant
    Oh that's dope! Easy peezy then!
     
  5. Merkava120

    Merkava120 Oberleutnant

    Joined:
    Feb 2, 2013
    Messages:
    380
    Gender:
    Male
    Location:
    Socially distant
    Here's another question for you: how to do different eras with a dynamic tech tree?

    For example, if I want to start a game in the 1700's as Britain, and I have a dynamic tech tree, starting in the "Renaissance" era will give ALL civs ALL the techs, including things like nomadism and city-states that shouldn't go together. And then you lose all the diversity you gain from the dynamic tech tree.

    I thought you could fix that by always choosing "stone age" and then giving free techs to civs based on when they start, but that means you wouldn't be able to have random civs when you start a game (Stone Age Sumer vs. US Navy SEALs - Who Will Win??).

    Any ideas?
     
  6. Zeta Nexus

    Zeta Nexus Deity

    Joined:
    Jan 23, 2014
    Messages:
    3,818
    Gender:
    Male
    Location:
    In a constant brainstorm...
    Do you mean unique tech trees for each civ? Like in Galactic Civilization 2? Well... I wouldn't like that.

    BTW: How is it going?
     
  7. Merkava120

    Merkava120 Oberleutnant

    Joined:
    Feb 2, 2013
    Messages:
    380
    Gender:
    Male
    Location:
    Socially distant
    I wouldn't either haha. I mean if someone were to start a game out in the Renaissance era, then either they'd be given all of the techs from before that (which could include lots of different paths that shouldn't go together) or they wouldn't be given any techs at all because the techs are all disabled...
    I'm thinking of having a python call on game start that divvies techs out to civs according to whatever era the game started in, just enough techs to give them a good starting position.

    It's going well! I am working on adding your dynamic techs idea and right now I'm fixing lots of bugs with it. But now schools are cancelled here so I am free to mod all day long LOL.
     
  8. Zeta Nexus

    Zeta Nexus Deity

    Joined:
    Jan 23, 2014
    Messages:
    3,818
    Gender:
    Male
    Location:
    In a constant brainstorm...
    :lol:
    Will you upload an alpha sometime?
     
  9. Merkava120

    Merkava120 Oberleutnant

    Joined:
    Feb 2, 2013
    Messages:
    380
    Gender:
    Male
    Location:
    Socially distant
    Yeah, soon as I get to a point where it's playable :)


    Edit: Ok, here's my current plan.

    I am realizing that the mod I want to do really should be a modmod of something like AND.

    So right now I'm downloading lots of big mods to try out; eventually I'll choose one and convert it into a dynamic-tech-tree mod.

    In the meantime, I'm going to get all of the python stuff I've made minimally working and upload each one to the database individually - which will include both the event techs and the Nexus-style (that's what I'm calling it) dynamic techs.
     
    Last edited: Mar 14, 2020
  10. Zeta Nexus

    Zeta Nexus Deity

    Joined:
    Jan 23, 2014
    Messages:
    3,818
    Gender:
    Male
    Location:
    In a constant brainstorm...
    :woohoo:Choose mine! Choose mine! :woohoo:
    ...or whatever suites your taste :lol:
    Wow! I don't see how I earned that honour :worship:
     
  11. Merkava120

    Merkava120 Oberleutnant

    Joined:
    Feb 2, 2013
    Messages:
    380
    Gender:
    Male
    Location:
    Socially distant
    So the last few days have been revolutionary for me...I can now compile a DLL with no problems. So I've decided to build my own as I'm developing this mod, with all the pieces I like from other mods.

    One in particular is your civics mod for Chronicles of Mankind - is there a standalone version somewhere? (It would mesh very well with a dynamic tech tree, I think.)
     
  12. Merkava120

    Merkava120 Oberleutnant

    Joined:
    Feb 2, 2013
    Messages:
    380
    Gender:
    Male
    Location:
    Socially distant
    Also, now that dynamic techs aren't throwing python errors, I'm going to make it into a standalone so I can see if it actually works with Civ4 vanilla techs. Should be uploaded in the next day or two.
     
  13. Zeta Nexus

    Zeta Nexus Deity

    Joined:
    Jan 23, 2014
    Messages:
    3,818
    Gender:
    Male
    Location:
    In a constant brainstorm...
    No, but working with civics s really easy. You can copy those stuff in no time.
     
  14. Merkava120

    Merkava120 Oberleutnant

    Joined:
    Feb 2, 2013
    Messages:
    380
    Gender:
    Male
    Location:
    Socially distant
    Zeta Nexus likes this.

Share This Page