I want to make a mini mod where backstabbing is impossible and where you will go to war if a faction has attacked one of your allies.
This was my original idea
Spoiler Alert, click show to read:
I want to make a mini mod where backstabbing is impossible and where you will go to war if a faction has attacked one of your allies.
This was my original idea
Spoiler Alert, click show to read:
Knowledge is a deadly friend, if no one sets the rules. The fate of all mankind I see, is in the hands of fools - King Crimson's Epitaph.
תחי מדינת ישראל
This would be a very large script. It is simply not feasible.
Here's the problem: (In psuedocode)
That would make the total number of if statements needed number of factions * number of factions * number of factions, or number of factions^3. So for the vanilla game, that would be 22^3, or 10648 if statements.Code:monitor_event FactionAttacksFaction if AttackingFaction == england if DefendingFaction == hre if not FactionsAtWar france hre SetFactionsAtWar france hre end_if ;all other factions here end_if ;all other factions here end_if if AttackingFaction == france if DefendingFaction == hre if not FactionsAtWar england hre SetFactionsAtWar england hre end_if ;all other factions here end_if ;all other factions here end_if if AttackingFaction == hre if DefendingFaction == england if not FactionsAtWar france england SetFactionsAtWar france england end_if ;all other factions here end_if ;all other factions here end_if ;all other factions here end_monitor
Last edited by Azim; August 23, 2008 at 08:52 PM.
Dominion of the Sword, a Medieval II: Total War Supermod
Under the patronage of Archaon. Proud member of the House of Siblesz
My friend died from chain letters. If you don't post this again 100 times, he will come and kill you in your sleep!
It could probably be done a bit cleaner than that, but it would still be large. Actually 10k events isnt terrible, after all there are garrison scripts out there with 200k+ lines of code.
But I wont be writing it.
Which .txt is that?
Knowledge is a deadly friend, if no one sets the rules. The fate of all mankind I see, is in the hands of fools - King Crimson's Epitaph.
תחי מדינת ישראל
It would go in the campaign_script.txt
How do you actually do that?
I've hardly any experience with this kind of scripting.
Knowledge is a deadly friend, if no one sets the rules. The fate of all mankind I see, is in the hands of fools - King Crimson's Epitaph.
תחי מדינת ישראל
I have quite a bit of experience scripting, and I never solved this issue to my satisfaction. There are a lot of roadblocks. If you are truly interested, then you need more than a basic understanding of scripting.
I have posted some of my research in a similar thread if you care to read through it. Its not all in code so you should be able to follow the logic fairly well. Maybe if we get enough people with ideas together, both scripters and non scripters, we can work out something decent.
http://www.twcenter.net/forums/showthread.php?t=187424
There's a line in descr_campaign_ai_db.xml. About trusted allies going to war.
I have used it in my mod. It doesn't do exactly what you want though.
Anyway, it's the closest and easiest thing to do.
Use Lusted's AI for preventing backstabbing of allies first.
Then change the descr_campaign_ai_db.xml
as follows:
<trusted_ally_fs_threshold float="-1.0"/>
<trusted_ally_target_fs_threshold float="-1.0"/>
<trusted_ally_target_human_fs_threshold float="-1.0"/>
<trusted_ally_gs_threshold float="-1.0"/>
<trusted_ally_target_gs_threshold float="-1.0"/>
<trusted_ally_enemy_auto_war bool="true"/>
I have used it in my mod (Lands to conquer: Andy's modifications) and it works.
That way everytime the AI declares war to it's allies enemies. Even if these allies are pathetic scumbugs.
HOWEVER: the Player won't go to war with his allies enemies automatically.
Last edited by alhoon; August 24, 2008 at 02:18 PM.
alhoon is not a member of the infamous Hoons: a (fictional) nazi-sympathizer KKK clan. Of course, no Hoon would openly admit affiliation to the uninitiated.
"Angry Uncle Gordon" describes me well.
_______________________________________________________
Beta-tester for Darthmod Empire, the default modification for Empire Total War that does not ask for your money behind patreon.
Developer of Causa Belli submod for Darthmod, headed by Hammeredalways and a ton of other people.
Developer of LtC: Random maps submod for Lands to Conquer (that brings a multitude of random maps and other features).