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

ExtraModMod continued

Discussion in 'More Naval AI Modmod' started by lfgr, Jun 16, 2019.

  1. Tielby

    Tielby Prince

    Joined:
    Sep 23, 2007
    Messages:
    351
    Location:
    The sacred and free citadel of mind
    IIRC, you lose the promotions that automatically gain XP (the one that any adept/mage has, but I think the hero loses the Hero promotion as well) and you become vulnerable to the Destroy Undead spell, but like any Undead, you are then immune to some other spells, including some beneficial ones like Haste. Since those hero units already have Channeling III, I consider it a waste of a perfectly good national unit slot.

    Actually, now I can't remember if liches are national units, i.e. limited to 4.
     
  2. kvaak

    kvaak Chieftain

    Joined:
    Dec 16, 2016
    Messages:
    26
    I tried playing around with the worldbuilder, any hero I gave the Death 3 and/or Channeling 3 promotion to was unable to cast Lichform with the button being grayed out. They were able to summon Wraiths so their spellcasting ability was also otherwise unhampered. I also tried various kinds of heroes to check if any of their background promotions/effects were interfering, but that didn't seem to be the case.

    Grigori would be the one oddball in this case since they can get non-unique hero archmages, so I gave Death 3 and Hero to a random Acolyte and it was able to cast Lichform just fine. It also didn't lose the hero promotion in the process.

    Liches are national units, if you have 4 or more the Lichform button is grayed out. Notably they have significantly higher base strength than Archmages (5+2 vs. 5) which can be further increased with the Tower of Necromancy.
     
    DuskTreader and Tielby like this.
  3. fe79

    fe79 Chieftain

    Joined:
    Sep 19, 2013
    Messages:
    37
    In regular MNAI, world units (which includes all unique heroes) cannot cast Lichdom. Flesh golems and puppets have the same restriction.
     
    DuskTreader and Tielby like this.
  4. DuskTreader

    DuskTreader Chieftain

    Joined:
    Mar 25, 2018
    Messages:
    83
    I captured a slave from a hellhound and was surprised to get a normal human rather than a demon unit. Why?
     
  5. DuskTreader

    DuskTreader Chieftain

    Joined:
    Mar 25, 2018
    Messages:
    83
    Am I correct that tolerant civs that capture grigori cities can't make adventurers?
     
  6. lfgr

    lfgr King

    Joined:
    Feb 6, 2010
    Messages:
    853
    Correct.
     
    jackal1234 and DuskTreader like this.
  7. Alekseyev_

    Alekseyev_ Chieftain

    Joined:
    Jul 18, 2014
    Messages:
    23
    Hey lfgr, there's a small issue in the EMM archive download:

    It names the wrong zip (should be emm-0.6.0-beta5.zip) and has a typo in "Mods/ExtraModModI". :)
     
  8. lfgr

    lfgr King

    Joined:
    Feb 6, 2010
    Messages:
    853
    Thanks, fixed.
     
    Alekseyev_ likes this.
  9. WaywardRogue77

    WaywardRogue77 Chieftain

    Joined:
    Jan 7, 2020
    Messages:
    10
    Gender:
    Male
    I’m trying to figure out how to modify the random civ selections when playing a custom game. You know, where you can choose each civ and select random or @random by alignment, etc.. I found the random txt info in the CIV4CivlizatioinsInfo xml, then in the CIV4GameText_FF2 xml but cant find it in any python code. at least not where ive looked, and i think ive looked at just about every file that made any sense.
    I was hoping this wouldnt be that big of deal and i wanted to add a "special random" or something like that for myself to randomly select from only the civs i want to play.
    Anyway, ill keep looking but it seems that the xml entry would correspond to a python entry somewhere. any help would be appreciated, ty for all you do, the mod is great!
     
    Last edited: Dec 8, 2020
  10. DarkLunaPhantom

    DarkLunaPhantom Prince Supporter

    Joined:
    Feb 4, 2013
    Messages:
    443
    The implementation of those special random options is done through the DLL inside the function CvGame::init. So you would have to edit the C++ code and recompile the DLL if you wanted to change something.
     
    lfgr likes this.
  11. WaywardRogue77

    WaywardRogue77 Chieftain

    Joined:
    Jan 7, 2020
    Messages:
    10
    Gender:
    Male
    ah, well that would explain it. I’ll take a look. Ty very much for the help!
     
    DarkLunaPhantom likes this.
  12. Tugboatspotter

    Tugboatspotter Warlord

    Joined:
    Dec 19, 2019
    Messages:
    215
    Is Erebuscontinents map script included with the latest version?
     
  13. WaywardRogue77

    WaywardRogue77 Chieftain

    Joined:
    Jan 7, 2020
    Messages:
    10
    Gender:
    Male
    Yes, here are the maps included. Also, the scenarios all work great except the "dungeon crawler" one (Gift of <something>).
    Install FFH2, patch O and then extramodmod. This is the most stable version of modmods that ive found out of the mods for ffh2The scenarios being the "funnest" to me.
    I find the smartmap_mst to be a very good generator. Any "mst" will remember your choices.
     

    Attached Files:

    lfgr and Tugboatspotter like this.
  14. WaywardRogue77

    WaywardRogue77 Chieftain

    Joined:
    Jan 7, 2020
    Messages:
    10
    Gender:
    Male
    I have one other question on modding. I have learned and modified things here and there as I wanted, mostly simple xml modifications but some in code. The only part I'd really like to delve into is creating some more scenarios. Maybe to tell the story of some other different civs. I see there is a CustomFunctions and the ScenarioFunctions py. I cant figure out how the game "knows" how to find a specific method called? Would one simply setup the scenario map (with all the civs etc) and then have method callbacks to the python code from the xml? Does it search a certain way from one source to the next until it finds what it's "looking" for, or does the class need to be included in some way? I don't see any real "class imports" or some such that would indicate to the program how it would.

    For instance, "GameStart". When the scenario runs how does it know to "go to" this method? I know how it works after that, but not sure how to start one, if that makes sense.

    Also, cant figure out how to actually "print" something to the screen (some things, to me, need spelled out on screen at the times they occur)? I tried a few things, but always end up in some crash, as im not sure the syntax to use. I tried to use the szBuffer (pic below) but the ways I used to pyPrint to screen or a popup ended in failures.
     

    Attached Files:

  15. lfgr

    lfgr King

    Joined:
    Feb 6, 2010
    Messages:
    853
    There are a couple of ways to get a method to run on a specific event. FfH scenarios do it the following way: First, the methods in CvEventManager, like "onGameStart", are called "automatically" by the game (its not important how that works). In CvEventManager.onGameStart() you can find the following code:
    Code:
    if CyGame().getWBMapScript():
       sf.gameStart()
    
    The if condition checks whether a scenario is loaded (scenario in the wider sense of civ scenarios, not only FfH scenarios). If yes, it calls gameStart() of ScenarioFunctions; "sf" is the name of the ScenarioFunctions object defined in line 56:
    Code:
    sf = ScenarioFunctions.ScenarioFunctions()
    
    Now, as you probably can see, FfH just puts all code for every scenario into ScenarioFunctions.gameStart(). There are better options then this, but if you're new to modding (and programming?), then I suggest you start this way. Or is there a reason why you cannot do that?

    One remaining problem is that FfH differentiates between scenarios by having a special invisible gameoption for each scenario. You cannot currently add new gameoptions, unfortunately. I will try to make this possible in a limited way for the next version. Until then, you could see if "CyMap().getMapScriptName()" returns something useful that could be checked (I'm not sure right now).

    Printing to screen is done with the "CyInterface().addImmediateMessage(...)", to display it immediately, or "CyInterface().addMessage(...)", to add it to the messages that are displayed one-by-one, with some time between them. See the code for examples on how to use these two messages (there is documentation, but it seems to be unreachable right now).

    Let me know if you have further questions, I'll probably be able to answer with less delay in the coming days and weeks. :)
     
  16. WaywardRogue77

    WaywardRogue77 Chieftain

    Joined:
    Jan 7, 2020
    Messages:
    10
    Gender:
    Male
    Man that’s awesome, thanks for the reply!

    I am developer by profession. Mainly java and C#, but I’ve dabbled in python/ruby (Rpg maker) and a hint of C++ and other languages. I know how to read and follow code, but as you probably know, it’s a lot easier to do that when you’re not picking up where someone else left off. Truly though, I can read just about any language. I mean at some point they are all “the same”. You know this. I haven’t been developing long though, a few years.

    Anyway, what I mainly wanted to do was simple at first. I just want to create a scenario for myself (doesn’t have to be tied with the others the way they are. Meaning, just a stand-alone, not finish this one before you play that one. I know this is most likely some flag that gets sets to 1 or whatever. I haven’t looked and don’t care really at this point. What I was mainly interested in was how to “control” an event triggering in my own scenario. Let’s say at the beginning I want the faction to play until something specific happens. Then, at that point the next “objective” becomes available, then when that is accomplished the next one, etc etc. I can find the code behind, let’s say Fall of Caurantine, and basically follow that but was unsure where all the code actually “connects to” in the other scripts. Civ4 or FFH scripts. You know what I’m saying? So, what all to ensure is imported when I’m building my class and methods (not sure if I would make a new class or just add methods in the scenarios class).

    I can get more details in the future. I will run with what you gave me so far. I probably won’t have time to delve into it right now, but will be sporadically here and there. I’ll post some questions I have as I come across some and if you have time would really appreciate any pointers.

    oh, btw, not too sure how to “log” or debug code as I go? Basically to “see” like you said if some method brings back something useful to me.

    My basic scenario idea is having one for the Sheiam. I’m thinking of having only 4 mana nodes on the map. One “enemy” faction, probably the Bannor, a few neutral factions and the below objectives.
    - the 4 mana nodes must be “captured” (within the factions borders). One of each type of mana must be built on each mana node.
    - a neutral empire has a capital in which once conquered an item is obtained.
    - once all mana nodes are constructed, and the item has been obtained, a ritual can be performed in the shieam capital city which allows a special building to be constructed. Once the building is constructed the sheiam win the scenario.

    this is a rough draft, but shows you my thinking. I also won’t it where you could play as the good or bad faction. So shieam or bannor. Anyway, just my thoughts and objectives I want to pursue but was unsure how to make sure nothing triggered but my scenario and no “outside” influences disrupted that.

    so I’ll dig into this when I get the time. I really appreciate your feedback, much appreciated, ty!
     
  17. The_Reckoning

    The_Reckoning Prince

    Joined:
    Sep 21, 2005
    Messages:
    421
    Location:
    UK
    First off thank you for continuing the mod! I'm always on the hunt for a good AI challenge and it's shocking to me that the free market is failing to provide this!
    Would expect the below could be fixed in the next release :) - took me a shameful amount of time to figure out from the somewhat cryptic instructions in the OP.
    ------------------------------------------------------------------------------------------------------------------------------------------------
    for anyone experiencing the GFC error:

    // *** Control Bitmap Theme file

    // Set the resource
    resource_path "Mods/Fall from Heaven 2/Resource";

    // Setup common properties
    include "Mods/ExtraModMod/Resource/Themes/Civ4/Civ4Theme.thm";

    in

    \steamapps\common\Sid Meier's Civilization IV Beyond the Sword\Beyond the Sword\Mods\Fall from Heaven 2\Resource\Civ4.thm

    shows it's expecting the mod folder to be called ExtraModMod and not Fall from Heaven 2 - change it to


    // *** Control Bitmap Theme file

    // Set the resource
    resource_path "Mods/Fall from Heaven 2/Resource";

    // Setup common properties
    include "Mods/Fall from Heaven 2/Resource/Themes/Civ4/Civ4Theme.thm";
     
    Tielby likes this.
  18. lfgr

    lfgr King

    Joined:
    Feb 6, 2010
    Messages:
    853
    There is a bug that currently requires the old "Fall from Heaven 2" folder to be present to play EMM. So in the archive instructions, you have to "copy" the folder, not "move" it (I just changed it accordingly). See here for details (the same bug is present in MNAI). This will be fixed in the next version.

    Your second file makes the mod work in the "Fall from Heaven 2" folder, the way it worked in earlier versions. Be aware that in future versions, you'll have to change the Civ4ArtDefines_Misc.xml line for that, too, since it will still expect the mod to be installed in the ExtraModMod folder.
     
  19. The_Reckoning

    The_Reckoning Prince

    Joined:
    Sep 21, 2005
    Messages:
    421
    Location:
    UK
    Thanks

    E: Ignore below - it seems like the bug is that they can be automated just fine if Spring is their only spell. It breaks when they learn anything else!

    E2: Also - currently playing as Illians - the automated Adept with Sping only decided to cast the world spell Statis... thanks Adept.

    I can't automate my Adepts with Spring as Amurites, but I could as Malakim. I tested it in my game with Amurites - went into worldbuilder, created Malakim, created an Adept, changed it to my civ - it could be automated. Spawned a Malakim city, conquered it, built an Adept - could still be automated. Have a Balseraph city conquered and that Adept couldn't be automated. So it seems the code for automating Adepts is specifically attached to the Malakim Adept. Also the Malakim Adept couldn't be automated while sat in the city tile. Also FWIW the Amurite Adept is female but uses the male warrior grunt voice :D

    Hope this helps fix it.
     
    Last edited: Jan 8, 2021
    lfgr likes this.

Share This Page