Making constant Wars and Alliances with Module System. (No diplomacy change)

正在查看此主题的用户

Blackburn99

Recruit
If you guys played TLD mod you've probably seen that the Wars are constant, the diplomacy can't be changed. Does anyone have a clue how to do that with Mod System ?

I've searched around forums, google but no luck.

If anyone knows, drop a comment below. I'll appreciate it a lot.
 
The clean way to do it, would be to go to module_scripts, and install special cases for your factions there. The relevant ones should be:
"decide_faction_ai"
"npc_decision_checklist_peace_or_war"
Both scripts are horrible, horrible spaghetti code, so good luck with that.
Alternatively, you could try some dirty hacks, like a simple trigger that constantly increases or decreases relations between factions and rulers. Also, "game_start" contains a few lines that make one faction claim anothers' centers. Removing contested claims tends to make them more peaceful, adding more makes them hate each others guts.
 
Autolykos 说:
The clean way to do it, would be to go to module_scripts, and install special cases for your factions there. The relevant ones should be:
"decide_faction_ai"
"npc_decision_checklist_peace_or_war"
Both scripts are horrible, horrible spaghetti code, so good luck with that.
Alternatively, you could try some dirty hacks, like a simple trigger that constantly increases or decreases relations between factions and rulers. Also, "game_start" contains a few lines that make one faction claim anothers' centers. Removing contested claims tends to make them more peaceful, adding more makes them hate each others guts.

Didn't understand anything you said lol. Could you help me out in private, or teamviewer maybe ? I really need that.
 
Then, you probably need to get some more familiarity with the Module System before attempting the change. Read tutorials, make a few simple changes, write your own scripts and generally play around with stuff. What you're trying to do is not easy, and definitely not something you should attempt if you're new to modding or scripts. It would take me quite a while to figure out what *exactly* to do, and it wouldn't do you much good to have code in your mod that you don't understand and can't debug.

A bit more explanation on my first comment:

The scripts I referred to are what the Faction AI uses to make their decisions. You can find them by opening "module_scripts.py" and searching for their names. Scripts are just lists of instructions that can be called from other parts of the Module System, or directly by the game engine. The instructions you can use are listed in "header_operations.py" (if you use Lav's Module System, there's also a short explanation of what they do).
Sadly, those two scripts are among the most arcane and poorly written in the whole Module System; that's why I advise you to try something easier first and come back when you understand how they work and why they are written the way they are.
Implementing the hacks I suggested would be easier to put in at first, but you *really* shouldn't do that until you understand how the parts of the Module System interact. Otherwise, you'll get yourself into a nightmare of strange bugs happening for weird reasons.

Sorry if that came off as incredibly arrogant, but what you're trying to do there is *hard*. Teaching you how to do it from zero would take way too long, and I don't want to give out "recipes" that will do you more harm than good in the long run.

EDIT: Changing the initial claims is not exactly what you want, but it should have few side effects, so it's relatively safe to mess with:
1) Open "module_scripts.py"
2) Search for "#set territorial disputes/outstanding border issues"
3) Each line below represents one claim (they are commented)
4) If you want two factions to be mostly peaceful, make sure they do not claim each others' stuff
5) If you want total war between them, make them claim everything the other faction owns
6) You can look up which number is which castle/town in "module_parties.py"

The way this works is that factions will regularly check whether other factions own centers that they believe should belong to them. In the first line, for example, the Vaegirs claim Alburq Castle, which is owned by the Nords. So they will want to attack the Nords to get it "back". If they take it, its slot_center_ex_faction will get set to the Nords (the previous owner), which will make the Nords want to attack the Vaegirs. This pretty much guarantees that there will always be some conflict between Nords and Vaegirs (but the Vaegirs will probably not attack the Nords now, at least for this reason).
If you change it so the Vaegirs claim everything the Nords own, the Vaegirs will continously try to make war until the Nords are completely pushed out of their initial holdings.
Note that each center can only be claimed by one faction (other than the owner). Setting another one overwrites the old value.
There will still be the occasional ceasefire when both combatants are too exhausted to fight, and occasionally wars happen without conflicting claims (e.g. when a caravan is raided). But this should get you mostly the desired effect, and in a way that is unlikely to screw up lots of other stuff.
 
i highly advice you to do what Autolykos said below since it will be much easier for you then doing other stuff (thinking you already know the basics of course from reading the tutorials)

Autolykos 说:
EDIT: Changing the initial claims is not exactly what you want, but it should have few side effects, so it's relatively safe to mess with:
1) Open "module_scripts.py"
2) Search for "#set territorial disputes/outstanding border issues"
3) Each line below represents one claim (they are commented)
4) If you want two factions to be mostly peaceful, make sure they do not claim each others' stuff
5) If you want total war between them, make them claim everything the other faction owns
6) You can look up which number is which castle/town in "module_parties.py"

The way this works is that factions will regularly check whether other factions own centers that they believe should belong to them. In the first line, for example, the Vaegirs claim Alburq Castle, which is owned by the Nords. So they will want to attack the Nords to get it "back". If they take it, its slot_center_ex_faction will get set to the Nords (the previous owner), which will make the Nords want to attack the Vaegirs. This pretty much guarantees that there will always be some conflict between Nords and Vaegirs (but the Vaegirs will probably not attack the Nords now, at least for this reason).
If you change it so the Vaegirs claim everything the Nords own, the Vaegirs will continously try to make war until the Nords are completely pushed out of their initial holdings.
Note that each center can only be claimed by one faction (other than the owner). Setting another one overwrites the old value.
There will still be the occasional ceasefire when both combatants are too exhausted to fight, and occasionally wars happen without conflicting claims (e.g. when a caravan is raided). But this should get you mostly the desired effect, and in a way that is unlikely to screw up lots of other stuff.

and at the same time realistic since in history many kingdoms (clans;nations...etc) had an ending wars with some other kingdoms  (clans;nations...etc) but they had some cease fire cases where they had to prepare again for the next wave and rest their people from the suffering so it will feel kinda realistic cuz an ending war will allow other kingdoms  (clans;nations...etc) nations to use this chance take them both out !
 
You are right, that is too much for someone like me. Do you have any editors, like Savegame editor that can change the relations ? I've tried the Savegame editor, i changed the relations but the problem is they change them again. Do you know any other easier apps ?
 
Blackburn99 说:
You are right, that is too much for someone like me. Do you have any editors, like Savegame editor that can change the relations ? I've tried the Savegame editor, i changed the relations but the problem is they change them again. Do you know any other easier apps ?
use morgth editor if i'm not mistaken you can change the relations between factions so they will hate each other in new game not sure though , gl!!
 
Blackburn99 说:
like Savegame editor that can change the relations ?

MnBSaveGameEditor

remember that relations are a two way street. You need to update both sides. If A hates B, also change B to hate A (-100 relation).
 
kalarhan 说:
Blackburn99 说:
like Savegame editor that can change the relations ?

MnBSaveGameEditor

remember that relations are a two way street. You need to update both sides. If A hates B, also change B to hate A (-100 relation).

I've tried setting the relation to -9999 but they still change it after some time.
 
imado552 说:
Blackburn99 说:
You are right, that is too much for someone like me. Do you have any editors, like Savegame editor that can change the relations ? I've tried the Savegame editor, i changed the relations but the problem is they change them again. Do you know any other easier apps ?
use morgth editor if i'm not mistaken you can change the relations between factions so they will hate each other in new game not sure though , gl!!

I'll try that, thanks.
 
后退
顶部 底部