Results 1 to 9 of 9

Thread: [HelpCampaign Cap

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1

    Default [HelpCampaign Cap

    (I had posted this in the Modding section by mistake and asked for the thread to be moved about a week ago, but that hasn't happened, so I'm reposting here)

    Greetings, it has been some time since I last posted here.

    I have made a mod which alters some variables of the Dwarf Slayers, but I'm having trouble restricting their use. I set the Campaign_Cap to 6, but this appeared to set a permanent cap meaning you could never recruit more than 6 in total ever, rather than just having a limit of 6 at any one time. Using the PFM, I found Campaign_Total_Cap, and set that to 6 instead, but this crashed my save-game 100% of the time. I set it to one of the values found in the Chaos section (something like 3354275) and this allowed the save game to load, but didn't appear to actually do anything.

    My ultimate goal was actually to have the numbers of recruitable Slayers limited by the number of Slayer Shrines you owned, but I don't know if that's possible either. There was a thread from 2012 on here which suggests that could be done in Shogun 2: Fall of the Samurai, but the variable mentioned there (unit_cap) doesn't seem to exist in Total Warhammer.

    Any more experienced modders have any suggestions for what I might be able to do?

    Edit: For goodness sake, it just posted this before I was ready...
    Last edited by KindredBrujah; June 06, 2016 at 03:25 AM.

  2. #2

    Default Re: [HelpCampaign Cap

    Could some kind mod edit the thread title to read "[Help] Campaign Unit Cap", if such a thing is possible?

  3. #3

    Default Re: [HelpCampaign Cap

    Okay, so this is pretty weird.

    The two numbers from the 'main_units_tables'>'data__ch_' section for 'Campaign_Total_Cap' are 33554432 and 1073741824.

    The first of those comes up as some sort of stack overflow error in certain applications and the second is exactly the number of Bytes in a Gigabyte.

    Though doing a spot of maths, I think 33554432 might be the number of Bytes in 32 Megabytes.

    So if I set the Campaign_Total_Cap of the Dwarf Slayers to the 3x number, it doesn't appear to do anything. If I set it to the 1x number, it seems to remove their recruitment from the game entirely.

    I do wonder, though, if the 32 Megabyte thing means you can only recruit 32 units? That would be weird, but I'll test that out.

    Edit: Nope, that doesn't seem to be the case.


    ---

    I've tried a few other numbers in the Campaign_Total_Cap column and they've all resulted in a crash when loading so far: 6, 10, 160, 1000.
    Last edited by KindredBrujah; June 06, 2016 at 05:06 AM. Reason: Testing complete

  4. #4

    Default Re: [HelpCampaign Cap

    [I'll continue to update this post with my various tests in order to prevent the thread getting overrun with different posts with various tests]

    Okay, so I set the value to 1048576, which is 1MB in Bytes and the game loaded, so I think I'm onto something with the numbers. Still didn't do anything to the recruiting though. Gonna try 512 MB and see what that does.

    So 536870912 (512MB) also appeared to disable recruitment entirely.

    I'll try 67108864 (64MB) now. Nope, this also disables recruitment.

    Starting to think these values are just completely arbitrary. The 33554432 value looks like it might be the maximum that can go into the field without the thing cutting out completely.

    I'll try 33MB and see what that does. That functions the same as 32MB did, so my theory about 32MB being the limit seems unfounded. I'll try 63MB next and see what that does.

    63MB allowed unrestricted recruitment, just as 1MB, 32MB and 33MB (or indeed 0) did.

    I also tested 1024 (1kB) and 2048 (2kB) and they exhibited yet another weird behaviour: The Slayers still show up as being recruitable in the Building Browser, but cannot actually be recruited. For the previous tests, they were also missing from the Slayer buildings in the Building Browser (the little picture of the unit at the top-right of the building was gone).

    Tried 6291456 (6MB). This also allowed unlimited recruitment.

    Gonna try 524288 (512kB) and see what that does. That functions the same as 1MB through 63MB.

    Testing 8192 (8kB). Same behaviour as with 1kB and 2kB. Ditto for 64kB.

    Gonna try 511kB now. That functions like 1kB, 2kB and so on.

    -----------

    Right, to recap then:

    Using multiples of 1024, the game has the unit tied to the building in the Building Browser as normal, but doesn't allow actual recruitment. This continues up to 511kB.
    At 512kB and above it allows unlimited recruitment, this continues up to 63MB.
    At 64MB and above it seems to block out recruitment entirely, and the unit disappears from the Building Browser as well.

    None of these have any effect that could be described as being a 'Campaign Total Cap' in any way, shape or form. What a weird setup.


    Further Edit: So just to throw a spanner in my works, I tried 128kB and this functions in the same way as the 1MB values and above: full, unlimited recruitment.
    Last edited by KindredBrujah; June 06, 2016 at 06:26 AM. Reason: Update

  5. #5
    Commissar Caligula_'s Avatar The Ecstasy of Potatoes
    Join Date
    Dec 2013
    Location
    The alcoves in the Koningin Astridpark
    Posts
    5,871

    Default Re: [HelpCampaign Cap

    Are you editing a unique ID number, such as units and buildings have? If so, I think only the Assembly Kit creates unique IDs that actually work at the moment, so if you're using PFM switch to the Assembly Kit and try it out.



  6. #6

    Default Re: [HelpCampaign Cap

    Quote Originally Posted by Caligula the Mad View Post
    Are you editing a unique ID number, such as units and buildings have? If so, I think only the Assembly Kit creates unique IDs that actually work at the moment, so if you're using PFM switch to the Assembly Kit and try it out.
    Hi Caligula. Nope, I'm editing Campaign_Total_Cap in main_units_tables. At present they're all set to 0, but when I fiddle with the one for Slayers (I gather it would be the same for them all, but I've not tried) it exhibits the very strange behaviour I noted above.
    Last edited by KindredBrujah; June 06, 2016 at 06:27 AM.

  7. #7

    Default Re: [HelpCampaign Cap

    Though it seems I should perhaps have more thoroughly tested Campaign_Cap as it actually does seem to do what I wanted it to, just not in a direct way. More testing ongoing.

    So Campaign_Cap does seem to do what I wanted, which is what I originally expected. For some reason, though, for Slayers anyway, the Cap is set 3 higher than the actual available units (so to have a cap of 6, I need to set it to 9).

    I'll load an earlier save and test it in case there's something else going on. Hmm, so on an earlier save game I can recruit 8 from the cap of 9. Not sure what's going on with that. I wonder if it's all Slayers across every Dwarf Faction, rather than just your own. Either way, seems like it'll be okay in the meantime until I can work out how to set it per Slayer Shrine.
    Last edited by KindredBrujah; June 06, 2016 at 07:00 AM.

  8. #8

    Default Re: [HelpCampaign Cap

    I'm pretty sure Cataph got the cap working in his Bretonnian foot knights mod. Are you using the assembly kit? I suggest using that because it has built in safe guards. It isn't too hard, just watch Magnum's video first, he walks you through the steps: http://www.twcenter.net/forums/showt...utorial%28s%29

  9. #9

    Default Re: [HelpCampaign Cap

    Quote Originally Posted by Prater View Post
    I'm pretty sure Cataph got the cap working in his Bretonnian foot knights mod. Are you using the assembly kit? I suggest using that because it has built in safe guards. It isn't too hard, just watch Magnum's video first, he walks you through the steps: http://www.twcenter.net/forums/showt...utorial%28s%29
    Hi Prater, I have as well, mostly, but I'll have a wee look at Cataph's mod too to see if there's anything they did that I missed.

    I was initially using the Assembly Kit, but moved to the PFM because it can do more. Though I think more of the variables are named in DaVE than in the PFM.

Posting Permissions

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