K-Mod: Far Beyond the Sword

There have been lots of bug fixes and changes since then.

Not sure if it's a bug or it is supposed to happen, but have you noticed that when a top "repeat command" in the building queue (aka one triggered with the ALT key and having the "*" mark in front of it) is followed by "normal" commands, the former does not stay on top after the item that should be built indefinitely is completed?

For example, let's say I have the queue:
* Warrior
Library
[some other stuff]​

Now when the first Warrior is completed, the queue becomes:
Library
* Warrior
[some other stuff]​

while I expect the order to stay the same.

All this forces me to constantly remember to "shift" (aka push down) the Library back to being the 2nd item in the queue. Considering that the "repeated" item is usually a military unit which gets built in 1 or 2 turns in my production city, the whole process becomes a little ... redundant.

Again, I don't know if it's supposed to happen (or if it's the default unmodded Civ's behavior) - just giving some feedback. I'm still using k_mod_v1_44b version.

By the way, the queue is functioning correctly when the "repeated" item is the only item in the list.
 
I don't remember anymore if stock BtS behaves the same, but if you don't want the Library to be built, why not just remove it from the queue entirely? In defense of this behavior, it allows you to have your cities build a mix of units. For example, during an early game war you might tell them to build something like this:

*War Elephant
*Catapult
*Spearman
*War Elephant
*Catapult

Especially in prolonged wars, that can be a lot less work than manually checking what units you have and adjusting production accordingly.
 
Hey, it seems I have a problem when it comes to modding based on the K-Mod.

Basically, the K-Mod works fine on its own, but as soon as I copy my modified XML files (they are basically empty, with only token entries where necessary) into it, even though I edited all the files so that I get no errors on start, once I am in the game, there is no Interface.

I have seen few posts about the "no interface" problem itself, but the responses given there didn't proven helpful.
 
Wow, there are a lot more changes than I expected. Nice work, as always.

  • Many fixed memory leaks and logic mistakes, with help from alberts2 and DarkLunaPhantom.
  • Fixed potential crash in CvSelectionGroup::groupMove (again, thanks to DarkLunaPhantom for the idea)

All the fixes you included were made by alberts2 so I shouldn't be credited for that.

Also, it seems that civfanatics file hosting system is finally online.
 
Hey, it seems I have a problem when it comes to modding based on the K-Mod.

Basically, the K-Mod works fine on its own, but as soon as I copy my modified XML files (they are basically empty, with only token entries where necessary) into it, even though I edited all the files so that I get no errors on start, once I am in the game, there is no Interface.

I have seen few posts about the "no interface" problem itself, but the responses given there didn't proven helpful.
It's hard to say exactly what the problem is; but I can say that usually the "no interface" problem is a result of some python code crashing before it can create the interface. That doesn't really tell us much other than "something is broken; probably not the dll".

My suggestion for modifying the xml is to copy all of the K-Mod xml files to your new mod, and then to edit whichever bits you want to edit. You can't use blank xml, because then there will be missing information.

Note that the .ini file that comes with K-Mod has 'ModularLoading' turned off; and so you can't add 'modules' unless you explicitly turn that on. Adding modules should be fine; but I generally don't recommend it, because the K-Mod xml might not be compatible with the xml in whatever module you are trying to add - unless you wrote it explicitly for K-Mod. I think it's generally safer and easier to just copy and edit the K-Mod xml files directly.


--

@DarkLunaPhantom, regardless of whether you were responsible for writing the fixes - you did bring them to my attention by having them in your github fork and posting about it on this forum. So I don't think I'll rush out to edit your name out of the commit history. Thanks.
 
Hi Karadoc! Nice to see you are still working on this!
I still play with K-Mod two times per week multiplayer, but always on GEM. So if I want to try the new version, I need a 48 civ build of the dll. Is this possible?
 
Hi Karadoc! Nice to see you are still working on this!
I still play with K-Mod two times per week multiplayer, but always on GEM. So if I want to try the new version, I need a 48 civ build of the dll. Is this possible?
Attached.

As usual with the 48 civ version, it is untested and it is it is not compatible with the usual 18 civ version. (i.e. everyone in a multi-player game needs to have the same version of the dll; and you won't be able to share save games across different versions either.) I think it will work fine though.
 

Attachments

  • CvGameCoreDLL - 48 civ.zip
    1.8 MB · Views: 172
I don't remember anymore if stock BtS behaves the same, but if you don't want the Library to be built, why not just remove it from the queue entirely?

I do want those items after the Warrior to be built - I just want that after a lot of Warriors are built first. Sure, I can add a specific number of them at the beginning of the queue, but sometimes you don't know that number ... for example, when you're attacked, and you want to keep building units in that military city until you defeat the enemy and the size of your previous army is reached again ... and then resume your usual (more peaceful) list of things to build.

I can understand your argument about a mix of units as well - I didn't thought of that, and that might be the correct explanation for this behavior. So maybe it's the "default" BTS behavior, after all...

Thanks for the reply.
 
@karadoc and @keldath
Thanks for the advice. While re-doing things slowly, I managed to get it to work somehow. Not sure what was causing the problem exactly, but it seems it was after some building or tech entry I deleted. Pretty sad it has dependencies on stuff one might want to remove, but at least there's some ways to get around it :)

Thanks for your help!
 
Hello, I have been using your mod for a year almost now to build up my own mod. It is really great what you are doing, and I love very much the AI autoplay function, really awesome to test new functions if they CTD:cool:. I have added quite some SDK over your mod, XML a lot and rarely python. These past days i am trying to add the python modcomp Mercenaries by Platyping http://forums.civfanatics.com/threa...sant-posh-python.497337/page-26#post-12641569. I`ve went through the files at least 5 times thinking i missmerged something, tried with/without CvEventManager used this tutorial for reference http://forums.civfanatics.com/threads/merging-better-ai-with-bug-3-5.296534/ (with whom i merged previously the MongolCamp that works just fine).
In the end I merged the Mercenaries mod on a clean K-Mod (your latest one) as I was running out of ideeas on what the problem is (thought it is some of my code from SDK very unlikely though as it has nothing to do with python). But i still get this problem in the screenshot.
Line 6 from that file is:
Spoiler :

<?xml version="1.0" encoding="ISO-8859-1" ?>
<mod id="Mercernaries"
name="Mercernaries"
url="http://forums.civfanatics.com/forumdisplay.php?f=245">

<events module="Mercernaries" /> line 6
</mod>

I have attached the merged simple mod (K-Mod + Mercernaries) I am hoping so much that you can help :please:
 

Attachments

  • Civ4ScreenShot0005.JPG
    Civ4ScreenShot0005.JPG
    128.3 KB · Views: 148
  • K-Mod + Mercernary Mod.zip
    3.9 MB · Views: 345
Hi Castor_Troy,

Did you manage to get this working?

I had a look and have made some progress.
I can now enter the Mercenaries screen after the requirement of Currency is researched but I cannot hire a unit and see no error with debugging turned on.
So still needs work with the screen interface.
Unfortunately I am not a programmer so only have limited programming skills.

What I did:

1. In the file "init.xml" located at "...\K-Mod\Assets\Config" I removed the Mercenaries module line <load mod="Mercenaries"/>
I did this as I notice that Caveman2Cosmos has integrated Platyping modules with K-Mod but does not add Platyping modules to this file.
So different to the BUG instructions on how to integrate a mod with BUG.
This resolved your line 6 error from <events module="Mercenaries" />

2. In the file "CvMainInterface.py" located at "...\K-Mod\Assets\Python\Screens" I moved the Mercenaries button on the main screen to the right of the BUG Options button as the the BUG Options button position is fixed.
Now I see both buttons.
The BUG Options button uses a wider spaced position of 30 rather than the Civ4 default of 25, and I have kept the spacing position to be 30.
I changed the line:
## Mercernaries ##
iBtnX += iBtnAdvance
To Be:
## Mercernaries ##
iBtnX += iBtnAdvance + 35

Hopefully more investigation of Caveman2Cosmos or other projects that have merged Platyping modules with K-Mod will show how to get this working.

Regards,

ZuluKing.
 
I tried the new 48 version, but I always get an assertion when joining a multiplayer team game in cvteam.cpp. Afterwards I have to restart windows, because the mouse is captured by civ :(

Assert Failed
File: CvTeam.cpp
Line: 5323
Expression: ePlayer>=0

Team game means in the scenario file the human players are set as a team. In version 42b (and older versions) this worked perfectly.
 
Last edited:
I tried the new 48 version, but I always get an assertion when joining a multiplayer team game in cvteam.cpp. Afterwards I have to restart windows, because the mouse is captured by civ :(

Assert Failed
File: CvTeam.cpp
Line: 5323
Expression: ePlayer>=0

Team game means in the scenario file the human players are set as a team. In version 42b (and older versions) this worked perfectly.
I tested an ordinary team game and it seemed to work ok. (I just started a new multiplayer game with some players on the same team, without using a scenario.

Perhaps there is a problem with the scenario you are using? I don't know much about scenarios, but my guess is that the scenario should be created using a 48 civ dll if you want to use it with the 48 civ dll. Are you sure that this particular scenario worked with the previous version? Perhaps you should upload it here.
 
Yes I'm sure, we immediately installed the 48 version of K-MOD 42b and started the scenario again, and it worked! And we used that scenario for the last 2-3 years
I will upload the file here. The game is started with custom scenario/GEM 6.3... the human team is edited to QinShiHuang and Suryavarman.
 

Attachments

  • GEM 6.3 Ancient for BTS.CivBeyondSwordWBSave
    1.6 MB · Views: 75
Top Bottom