Results 1 to 4 of 4

Thread: Adding generals in the campaign at start

  1. #1
    Steph's Avatar Maréchal de France
    Patrician Artifex

    Join Date
    Apr 2010
    Location
    Pont de l'Arn, France
    Posts
    9,174

    Default Adding generals in the campaign at start

    I want to add some generals at start to the campaign. I tried different solutions, including using the "hybrid startpos", copying the whole CAMPAIGN_MODEL.
    If I do that, the campaign start, but it ignores my script, and the advice are not displayed for instance.

    So I tried another method to copy the hybryd startpos at another level.

    I have added 3 units, and I moved them a little outside of the city. Then I saved.

    I opened the save, and I copied one by one my 3 new ARMY_ARRAY from the save to the startpos, and then copied one by one the 3 colonels (automatically created when I moved the units outside of the city).
    Now... Do I also need to copy the CAI_Interface / CAI_WORLD_UNITS? I've seen there are 3 new elements, with as reference the ID of the units inside my ARMY_ARRAY
    What about CAI_Interface / CAI_WORLD_CHARACTERS?

    I tried first without copying those (I copied only the ARMY_ARRY and CHARACTER), it seems to work. I can start the campaign, my new units are there, I can move them. I can go to turn 2. My scripts are working.

    What can happen if I don't copy the CAI_WORLD_UNITS and CAI_WORLD_CHARACTERS? Could it prevent the unit from moving if it's AI controlled?

    Is there another part I need to copy?

  2. #2
    Steph's Avatar Maréchal de France
    Patrician Artifex

    Join Date
    Apr 2010
    Location
    Pont de l'Arn, France
    Posts
    9,174

    Default Re: Adding generals in the campaign at start

    Here is my idea to add new starting generals.
    1) In the script, add a line to spawn a general_staff unit in a city near where you want to put the general
    2) Start the game. The general_staff unit is added. Move this unit a little outside, alone. Since the unit is alone, the engine automatically creates a colonel for it.
    3) Save.
    4) Open the startpos and the save with Esf Editor.
    5) From the save, copy the ARMY_ARRAY (it should be at the end) and paste into the startpos
    6) Do the same for the new colonel
    7) Do the same for the CAI_WORLD_UNIT and CAI_WORLD_CHARACTER. It's not very difficult to do since they are placed last in the save. Just copy the last entry, and copy on the startpos
    8) Save the startpos
    At this point, if you start the campaign, you have a new colonel correctly placed. ID are correct, automatically created by the engine, you don't have to put a new one or copy it manually.

    Now, a part I'm not really sure about
    9) In the startpos, go back to your colonel. Change it to a general. Rename if needed, change the portrait. Add traits and change attributes.

    I think this should work. I tested it quickly, no crash.

    What do you think of this method?

  3. #3

    Default Re: Adding generals in the campaign at start

    Seems good.

    EDIT: NVM I didnt realise that there was a good tut on this forum for this that works for Shogun 2 too.
    Last edited by Moonhoplite; June 23, 2012 at 12:07 AM.

  4. #4

    Default Re: Adding generals in the campaign at start

    Thank you, Steph.
    I think it is right,
    but,than continue the game,
    we have two same Generals.
    Becouse the generals is not change for script, from true to false.
    So, do you have any idea better?

Posting Permissions

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