Jump to content
Excited4IM

Modding - How do I Mod Unit Stats?

Recommended Posts

I want to do the following:

1. Increase the strength of walls.

2. Increase the resource cost of walls.

3. Limit the popcap

4. Increase the cost of mercenaries.

Is this possible and if so how?

I had a look in the editor_data folder but could not find any files that give unit stats to edit.

Share this post


Link to post
Share on other sites

Take a look at rules.xml to modify unit stats (beside goods and random events).

Popcap - and game rules in general -  is mostly governed in the script file "game_settings.lua". The numbers depend on player. Find these two rows and you can override the limits. I think the array elements follow each other from 2 to 8 players present.

image.png.6af8aa95dfb11507753adc9d35cbaecd.png

There is also the file "options.xml" in Documents/My Games/Stronghold Crusader 2, where you can alter the absolute hard cap of buildings and units per player.

image.png.9b8dfbff41eea048035fec39d1b9fc2b.png

 

Share this post


Link to post
Share on other sites

Thanks for your reply, where is the rules.xml file? The only file I can find that begins with r is the resources.xml file in steamapps\common\Stronghold Crusader 2\assets\editor_data.

Edited by Lord_Chris
Removed previous quote

Share this post


Link to post
Share on other sites

You need to directly modify the bundled assets in C2. For that, use the V-maker utility found in this guide.

After you feed assets.v to the maker (remember to create a copy and rename the extension to .txt first), unpack the archive or use Total Commander to edit the archive directly.

Share this post


Link to post
Share on other sites

Thanks, I made a few edits (increased the price of walls) and then zipped the folder back up and put it onto the maker before copy and pasting back to the game folder. But when I got to start the game it starts to load, the screen goes black for a few seconds and then exits. Any ideas what the issue could be?

Edited by Lord_Chris
Removed previous quote

Share this post


Link to post
Share on other sites
7 hours ago, Excited4IM said:

Thanks, I made a few edits (increased the price of walls) and then zipped the folder back up and put it onto the maker before copy and pasting back to the game folder. But when I got to start the game it starts to load, the screen goes black for a few seconds and then exits. Any ideas what the issue could be?

If you used the V-maker on your zip and copied assets.v back to the original folder, then the next thing coming to mind is data integrity. Your .v should be around 450 MB large after the process (Firefly bundled with a less space efficient algorithm).

I encountered black screens frequently when toying around with the scripts. What changes have you made in the .v exactly?

Share this post


Link to post
Share on other sites

the file is 231mb and the only changes I made were to the walls and towers. I made all walls cost more and significantly stronger.

Share this post


Link to post
Share on other sites

Should be normal. I had a false memory of assets.v being larger. Try sharing your edited assets.v and I could compare it in detail.

Edited by Asophix

Share this post


Link to post
Share on other sites

Thank you very much for being so willing to help. I was not able to upload the entire file as the size limit for attachments is only 24 mb. However, the rules.xml file is literally the only file I edited before re-zipping everything. I have attached this file as well as some of the changes I made. The "<-----------------------------------------changed this" is something I added for your benefit in my post here. It is not in the rules file.

Quote

<building>
            <class>StoneWall</class>
            <hitpoints>50000</hitpoints>             <-----------------------------------------changed this
            <stone_cost>100</stone_cost>             <-----------------------------------------changed this
            <rank>knight</rank>
            <ai_value>5</ai_value>
            <points_make>7</points_make>
            <points_kill>50</points_kill>
            <exclude_from_unit_counts>1</exclude_from_unit_counts>
        </building>
        <building>
            <class>StoneCurtainWall</class>
            <hitpoints>50000</hitpoints>             <-----------------------------------------changed this
            <stone_cost>100</stone_cost>             <-----------------------------------------changed this
            <rank>knight</rank>
            <ai_value>3</ai_value>
            <points_make>3</points_make>
            <points_kill>20</points_kill>
            <exclude_from_unit_counts>1</exclude_from_unit_counts>
        </building>
        <building>
            <class>WallStairs</class>
            <hitpoints>50000</hitpoints>             <-----------------------------------------changed this
            <stone_cost>100</stone_cost>             <-----------------------------------------changed this
            <rank>knight</rank>
            <ai_value>10</ai_value>
            <points_make>10</points_make>
            <points_kill>50</points_kill>
            <exclude_from_unit_counts>1</exclude_from_unit_counts>
        </building>

 

rules.xml

Share this post


Link to post
Share on other sites

Thanks for the attachment! I quickly tried out directly modifying the zip in Total Commander, as well as unpacking to a test folder, modifying there, and packing it right back in.

I only modified rules.xml with the variant you sent me, and it works spiffingly in both cases!

I don't understand what went you wrong. You could use Google Drive or another file sharing site, and drop a link to your assets.v, if you're up for another round of inspection.

image.png.e8a46b36f7b993e32daae693085107e3.png

Share this post


Link to post
Share on other sites

I will try and find another way to upload the files. In the meantime, I have made a screenshot of the contents of the asset file that I am rezipping which is the only file I zipped up. So this is literally everything that is being zipped up - let me know if there is anything missing.

image.thumb.png.5cad486f6ac01d0b88cbdecdc1609596.png

So literally all I did is I right-clicked on the folder named "assets" that contains all the files in the screenshot and then clicked "compress to zip file". It created a new zip "assets" file which I then dragged and dropped onto makev to get a new "assets.v" file. I then copy and pasted that file into the Stronghold folder here: ...\Games\steamapps\common\Stronghold Crusader 2\assets

 

Share this post


Link to post
Share on other sites

This is literally one of the cases I tested. Should be fine according to the screenshot.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Similar Topics

    • Stronghold Legend Units Stats

      I found a table with Stronghold crudader 2 units stats https://steamcommunity.com/sharedfiles/filedetails/?id=496117533. Is there such a thing, only with a legend?

      in Stronghold Legends

    • Modding Bear Necessities

      Bear Necessities is a vastly underutilized map in my opinion. Fairly easy, only 1 mission and a bunch of estates that you don't need. Because of that, I toyed with the idea of tweaking it into a richer peace map (though I think I have to unlock my modded version too). However, the map keeps spamming wolves for some reason and I don't even see a trigger that would be responsible for it. Any idea of the cause? Is it hard coded into it?

      in Stronghold 2

    • Stronghold Warlords Unit and Building Limit

      Hi, i would like to get help if anyone is willing to help me. I have used Stronghold 3 makev tool to unpack .v file from Warlords and did simple mod to change max unit and building limit in Multiplayer and Singleplayer but when i zip folder and use makev to create .v file back (7zip with compresion or no compresion doesnt matter) game just opens and closes I wanted to mod this only for me and my cousin and i am aware it cannot be used in multiplayer unless we both have this mod.

      in Stronghold Warlords

    • Warlords Ai Modding Map Creation

      The game isn't out yet, but i am very curious how the map creation and AI modifications work in it. If you have suggestions what i should try on my Release live-stream, let me know! Looking forward to keeping all the information gathered up and sorted afterwards! :D

      in Stronghold Warlords

    • Comprehensive Unit Overview

      I'm delighted to announce that we now have the most comprehensive, detailed unit overview on Stronghold Legends units ever written. You can take a look at the units in Stronghold Legends via this link: https://www.stronghold-nation.com/article/367-stronghold-legends-game-units

      in Stronghold Legends

×
×
  • Create New...