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
  On 05/11/2023 at 00:42, 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?

Read more  

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>

Read more  

 

rules.xmlFetching info...

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

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

    • I Need Help With Modding the Graphics of Stronghold Crusader!

      Hi everyone! I'm working on a project where I want to modify the graphics of Stronghold Crusader. My goal is to create an entirely new themed game using the existing game's framework, where I’ll redesign everything from buildings and units to the main menu and in-game text. However, I’ve run into some issues with the tools I've tried, and I’m looking for suggestions on what programs I could use and if there are any specialized tools for this. Programs I’ve tried: Drago

      in Stronghold Crusader & Crusader Extreme

    • 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

    • G.M.B. mod by LORD_VALROY v.4.1

      :knight: G.M.B. mod. Big mod for Stronghold Crusader! This mod makes a large number of useful changes to the game Stronghold Crusader.   Installation: In the game folder   System requirements: OS: Windows XP, Vista, 7, 8, 8.1 Disk space: 430 MB     If the problem with the modification to apply: valroy17@mail.ru   List of changes introduced by a modification of the original game: - Added a special program to run and modify the settings on the user's discretion - Now you can check for updates at s

      in Stronghold Crusader & Crusader Extreme

    • Stronghold Crusader Night Mod Review

      im working on a mod that adds night enviorment to the game the mod isn't originaly made by me but the original version wasn't already in this forum so i worked a little more on the mod and added some new features and optimizations to it and heres a photo from how it looks like   the beta early access version will be available for download very soon  

      in Stronghold Crusader & Crusader Extreme

×
×
  • Create New...