Page 2 of 49 FirstFirst 12345678910111227 ... LastLast
Results 21 to 40 of 967

Thread: STARTPOS.ESF analysis and modifications. HYBRID startpos.esf

  1. #21
    Burnoutfigs's Avatar Semisalis
    Join Date
    Apr 2009
    Location
    Fort Lewis, Wa
    Posts
    408

    Default Re: STARTPOS.ESF

    I figured out how to add CAI slots....yay








    but them it crashes ....boooo...lol

  2. #22

    Default Re: STARTPOS.ESF

    Quote Originally Posted by Burnoutfigs View Post
    I figured out how to add CAI slots....yay

    but them it crashes ....boooo...lol
    Yes, I know it's the story of my life lately!

  3. #23

    Default Re: STARTPOS.ESF

    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))


  4. #24

    Default Re: STARTPOS.ESF

    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.

  5. #25

    Default Re: STARTPOS.ESF

    thank you


  6. #26
    alpaca's Avatar Harbinger of saliva
    Join Date
    Sep 2005
    Location
    Germany
    Posts
    4,811

    Default Re: STARTPOS.ESF

    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):
    Code:
    if True:
        esfFile.open("startpos.esf")
    Edit: Attachment removed, see the fixed version below.
    Last edited by alpaca; July 20, 2009 at 05:30 AM.

    No thing is everything. Every thing is nothing.

  7. #27

    Default Re: STARTPOS.ESF

    Quote Originally Posted by alpaca View Post
    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):
    Code:
    if True:
        esfFile.open("startpos.esf")
    Alpaca, this is awesome! I've been trying to learn some c# so I could do this very thing, but after looking at the ESFeditor code, I'm a ways away from being able to do something like that. Thanks!

  8. #28

    Default Re: STARTPOS.ESF

    Quote Originally Posted by alpaca View Post
    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):
    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.

  9. #29

    Default Re: STARTPOS.ESF

    Quote Originally Posted by erasmus777 View Post
    I get no results even when searching for an ID I know exists. The output file is created, but it's empty. Here's the syntax I'm using:

    >START main.py 692683604 out.txt

    I have python 2.6.1 if that matters.
    I am almost sure that it needs 3.0 or later.

  10. #30

    Default Re: STARTPOS.ESF

    Quote Originally Posted by husserlTW View Post
    I am almost sure that it needs 3.0 or later.
    You're right, thanks.

    Alpaca, this is a great tool. However, it doesn't seem to be finding numbers in the CAI_World array. Apparently length doesn't matter. Still, it's very helpful.
    Last edited by erasmus777; July 19, 2009 at 03:27 PM.

  11. #31
    alpaca's Avatar Harbinger of saliva
    Join Date
    Sep 2005
    Location
    Germany
    Posts
    4,811

    Default Re: STARTPOS.ESF

    Quote Originally Posted by erasmus777 View Post
    You're right, thanks.

    Alpaca, this is a great tool. However, it doesn't seem to be finding numbers in the CAI_World array. Apparently length doesn't matter. Still, it's very helpful.
    Small wonder, I made a typo so it checked for UShort instead of UInt (and of course didn't find it). Here's the fixed version. Finds a lot more stuff

    Edit: Attachment removed, see below
    Last edited by alpaca; July 20, 2009 at 06:37 AM.

    No thing is everything. Every thing is nothing.

  12. #32

    Default Re: STARTPOS.ESF

    EDIT: Alpaca's researcher has been added in tutorial (TOOLS)

    Thanks alpa !

  13. #33
    alpaca's Avatar Harbinger of saliva
    Join Date
    Sep 2005
    Location
    Germany
    Posts
    4,811

    Default Re: STARTPOS.ESF

    Here's a new version (another bug fixed, doesn't find nodes twice anymore and it's also a bit faster because it uses a binary tree search instead of a linear search to find the nodes)

    No thing is everything. Every thing is nothing.

  14. #34

    Default Re: STARTPOS.ESF

    Thanks alpaca. What's the syntax for the mapping/resource functions?

  15. #35
    alpaca's Avatar Harbinger of saliva
    Join Date
    Sep 2005
    Location
    Germany
    Posts
    4,811

    Default Re: STARTPOS.ESF

    Quote Originally Posted by erasmus777 View Post
    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

    No thing is everything. Every thing is nothing.

  16. #36

    Default Re: STARTPOS.ESF

    Quote Originally Posted by alpaca View Post
    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
    Okie doke The code looks promising though, as you seem to have the basics of interpreting the outlines in regions.esf. By working backwards, I assume someone might be able to put new outlines in regions.esf, which would of course mean...

  17. #37
    alpaca's Avatar Harbinger of saliva
    Join Date
    Sep 2005
    Location
    Germany
    Posts
    4,811

    Default Re: STARTPOS.ESF

    Quote Originally Posted by erasmus777 View Post
    Okie doke The code looks promising though, as you seem to have the basics of interpreting the outlines in regions.esf. By working backwards, I assume someone might be able to put new outlines in regions.esf, which would of course mean...
    No I don't. I'm just using the pics CA uses for the overlay map images for the overlay. Except for a region list and positions I don't read anything out of regions.esf

    No thing is everything. Every thing is nothing.

  18. #38

    Default Re: STARTPOS.ESF

    Quote Originally Posted by erasmus777 View Post
    Okie doke The code looks promising though, as you seem to have the basics of interpreting the outlines in regions.esf. By working backwards, I assume someone might be able to put new outlines in regions.esf, which would of course mean...
    Since you are interesting about outlines, the areas where they are grouped in, are the CAI_HLCIS in startpos.esf.

  19. #39

    Default Re: STARTPOS.ESF

    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?

  20. #40

    Default Re: STARTPOS.ESF

    bump

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •