I figured out how to add CAI slots....yay
but them it crashes ....boooo...lol
I figured out how to add CAI slots....yay
but them it crashes ....boooo...lol
I have worked some with the diplomacy manager lately and thought i should share my findings.
So, here is portugals relationship array with some random other faction.Spoiler Alert, click show to read:
Each faction array contains a diplomacy manager. It contains a diplomacy relationship block for each faction, headed by the respective faction's ID. Most changes take changes in both factions arrays.
What i found out to do is:
Change Alliance Status
Easy: you see the both lines labelled "neutral", change them to "allied" or "war" respectively. Also make sure to change it in the other factions file regarding the faction you change (I.e. e.g. change Portugals relation to Britain, but also change Birtains relation to Portugal accordingly)
there are 2 int values that are 20 or 10 for allied factions. I don't know what they do.
Get a trade agreement running
Also easy: See the boolean values labelled "Trade Agreement" (by me). Set those two to true and you get a trade agreement between the two factions. Again do not forget to change the other factions file.
Give military acces
The third line is the military-acces line. You can enter a boolean value here, for a limited turn military acces, as labelled, -1 means infinite acces. This change also works one-way.
Change the Historical Friendship / Differences
Every subblock of the diplomatic relationships array contains one value of standing (Like same government type, at war with ally, etc). The 5th lowest is the one responsible for historical hatred / friendship.Spoiler Alert, click show to read:
The magnitude is stored in the second value. -70 means 70 less standing. I am unsure about the other values. The first boolean most likely makes sure the change is in effect, the second seems to be always false. No idea about the first integer, i think i also saw it being -1, so it might again be the number of turns this is active.
The last number in the diplomatic relations block ( -45 here) is the current total standing. I am unsure if it is necessary to update it accordingly to your changes, but i did it.
As you can see here, i allied The thirteen Colonies with the Iroquois, made them trade (also exchanged military acces, but you cannot see it in that screen) and made them like each other very much at the game start.Spoiler Alert, click show to read:
(Now all needed is to fix the Campaign AI so there is no declaration of war in turn 1 (only on hard setting though))
Very good contribution , thanks Lazy Knight.
EDIT: Link to Lazy Knight's post added to tutorial
Last edited by husserlTW; July 14, 2009 at 05:44 PM.
husserl, I recently thought a bit about this again and I have to say I'm an idiot
I found a much quicker way to search for IDs by converting the argument to raw bytes, doing a raw search and then getting the node from the address and checking whether it's an int or uint (which is far, far quicker than fully recursively searching every node value). Now a search doesn't take 10 minutes but less than 0.5 seconds
Make sure the main.py and lib folders are in the same directory as your startpos.esf, then open a command line, run "main.py <id> <output>" where id is the ID you're looking for and output is the filename of the output file. This will print all paths where the value is found and you can look at them in ESF editor.
A similar method can in be applied to find unused IDs: convert them to raw data, find the applicable nodes and if there are none you have an unused ID. To do this, start "main.py -u <start_id>" where start id is the ID where the script should start searching (use 100,000 as a start here, don't use very low values as they will all be in there).
I hope this will be useful for your research, I don't really have the time to do any on the esf files myself atm. You can change the file it searches by opening main.py in a text editor, going to line 31 and change this to something else (or rename the input file but that quickly gets messy):
Edit: Attachment removed, see the fixed version below.Code:if True: esfFile.open("startpos.esf")
I get no results even when searching for an ID I know exists. The output file is created, but it's empty. Here are the syntaxes I've used:
>START main.py 692683604 out.txt
and
>START python main.py 12 ouput.txt
I have python 2.6.1 if that matters.
Also, can you explain how to use the the other functions of the researcher, e.g. tga map functions, resource search, etc?
Last edited by erasmus777; July 19, 2009 at 12:11 PM.
EDIT: Alpaca's researcher has been added in tutorial (TOOLS)
Thanks alpa !
Thanks alpaca. What's the syntax for the mapping/resource functions?
Those need some additional external files, I wouldn't recommend you use them I only ever used them to create AOR maps for the vanilla resources because we decided to do things otherwise in APE:TI as you know, so I don't use it anymore and forgot what the functions exactly do. They were never intended for use by other people at any rate
this is a huge noob issue.
when i try to get into the ESF for GB, i get an error that says "object reference not set to an instance of an object"
what exactly is this saying to me?
bump