Results 1 to 20 of 20

Thread: RTW Unit Stat multiplier v1.2

  1. #1
    RedFox's Avatar When it's done.™
    Join Date
    Nov 2006
    Location
    Estonia
    Posts
    3,027

    Icon2 RTW Unit Stat multiplier v1.2

    I recently came up with a problem of increasing the units stats and testing them out, without having to do it all by hand and fear making mistakes/losing time.
    This tool simply increases/decreases unit values in EDU and generates a new file EDU_copy.txt.

    A settings file is also generated at first run: edustat_settings.txt
    You can change the default multiplication values there if you don't agree with it.

    WARNING: You will need the latest .net framework! So if you experience weird errors, that's probably why.
    -> http://www.microsoft.com/downloads/..;lang=en

    >>> DOWNLOAD EDU STAT MULTIPLIER v1.2 <<<

    Changelog:
    v1.2
    - Fixed a major error with mount_effect
    - You can now continue editing export_descr_unit_STAT.txt so you can do more complex moves that require several passes.
    - Program is now more or less usable. It still doesn't take into account RTW's stat limits though, so don't multiply a crazy amount.
    v1.1
    - Fixed a huge bunch of silly errors
    - Added support for multiplying; just type *2 to multiply by two, or type 2 to increase by two, or -2 to decrease by two.
    - For the sake of simplicity, multiplying doesn't use the extra scaling values from edustat_settings.txt

    Code:
    Unit Stat multiplier by RedFox
    This program will generate a new file named export_descr_unit_STAT.txt
    |---------------------------------------------|
    |-If a stat is 0, then value isn't modified  -|
    |-Negative values decrease stats             -|
    |-Multiplying doesn't use variables [x.xx]   -|
    |-inputs x=att y=def z=leth                  -|
    |---------------------------------------------|
    |-mount_effect = old+/*[0,33]x
    |-if x=8 old=4 => 4+int(2.65) = 4+2; new=6   -|
    |---------------------------------------------|
    |-stat_pri => att = old+/*[1]x
    |-         charge = old+/*[0,5]x
    |-           leth = old+/*z  [0<z<1]         -|
    |---------------------------------------------|
    |-stat_def => armor = old+/*[0,66]y
    |-            skill = old+/*[1]y
    |-           shield = old+/*[0,33]y
    |---------------------------------------------|
    |-stat_ground = old+/*[0,25]x
    |---------------------------------------------|
    Default is addition/subtraction, write *x to multiply instead.
    Reading stream export_descr_unit.txt...
    Value to change attack: *2
     -> Multiplying with 2
    Value to change defense: 8
     -> Adding with 8
    Value to change lethality: *1
     -> Multiplying with 1
    Task completed! Check export_descr_unit_STAT.txt for your new file.
    Press E to edit new STAT file, R to restart from scratch, any other key to quit . 
    If you think this tool is useful, feel free to comment.

    Also, a small readme:
    Spoiler Alert, click show to read: 
    I tried to make a tool for experienced modders. Albeit this tool doesn't have a graphical user interface (which makes coding a bit easier), it is still very functional.

    This program should be placed into your mod-folder and it searches for data/export_descr_unit.txt
    A new file named export_descr_unit_STAT.txt is generated based on the changes you made.
    There are three settings which is all documented in the start-up display.
    Only values that are not 0 will be modified. If a number calculated is 0, then the value defaults to 1.

    1) Enter the value to change attack: X
    Multiplication: *1; *0.66; *0,66; *1,5...
    Regular addition: 4; 8; -2; -5; +2,5; 4,5...
    All resulting values in the EDU will be integers (no floating point, e.g. 5;+10;-12)

    This setting will modify:
    mount_effect
    stat_pri
    stat_sec
    stat_ground

    2) Enter the value to change defense: Y

    Multiplication: *1; *0.66; *0,66; *1,5...
    Regular addition: 4; 8; -2; -5; +2,5; 4,5...
    All resulting values in the EDU will be integers (no floating point, e.g. 5;+10;-12)

    This setting will modify:
    stat_pri_armour
    stat_sec_armour

    3) Enter the value to change lethality: Z

    Multiplication: *1; *0.66; *0,66; *1,5...
    Regular addition: -0,33; 0,33; +0,33...
    All resulting values in the EDU will be double precision floating points(0.00) and 0<Z<1

    After one pass, you have the option of either continue editing the new file 'E', or start from scratch 'R' if you messed up. There is also a settings file edustat_settings.txt generated at first run if not present.
    From there you can change the amounts with which the stats are changed in relation to the number you enter in the program. I believe it is quite well documented for people to understand.
    Last edited by RedFox; September 19, 2009 at 04:37 PM.

  2. #2
    RedFox's Avatar When it's done.™
    Join Date
    Nov 2006
    Location
    Estonia
    Posts
    3,027

    Default Re: RTW Unit Stat multiplier v1.1

    Updated to v1.2
    Changelog:
    v1.2
    - Fixed a major error with mount_effect
    - You can now continue editing export_descr_unit_STAT.txt so you can do more complex moves that require several passes.
    - Program is now more or less usable. It still doesn't take into account RTW's stat limits though, so don't multiply a crazy amount.
    v1.1
    - Fixed a huge bunch of silly errors
    - Added support for multiplying; just type *2 to multiply by two, or type 2 to increase by two, or -2 to decrease by two.
    - For the sake of simplicity, multiplying doesn't use the extra scaling values from edustat_settings.txt

  3. #3
    Kylan271's Avatar Domesticus
    Join Date
    Jul 2007
    Location
    Vietnam
    Posts
    2,235

    Default Re: RTW Unit Stat multiplier v1.1

    Your tools are amazing,but here I am not sure how to use? Because of Lusted's game in TE using a stat cost calculation,I have to change every single piece of data by hand when assigning values. I am a newbie a tad,so not sure abetter work around,but will looksie at this. Thanks.


  4. #4
    RedFox's Avatar When it's done.™
    Join Date
    Nov 2006
    Location
    Estonia
    Posts
    3,027

    Default Re: RTW Unit Stat multiplier v1.1

    I tried to make a tool for experienced modders. Albeit this tool doesn't have a graphical user interface (which makes coding a bit easier), it is still very functional.

    This program should be placed into your mod-folder and it searches for data/export_descr_unit.txt
    A new file named export_descr_unit_STAT.txt is generated based on the changes you made.
    There are three settings which is all documented in the start-up display.
    Only values that are not 0 will be modified. If a number calculated is 0, then the value defaults to 1.

    1) Enter the value to change attack: X
    Multiplication: *1; *0.66; *0,66; *1,5...
    Regular addition: 4; 8; -2; -5; +2,5; 4,5...
    All resulting values in the EDU will be integers (no floating point, e.g. 5;+10;-12)

    This setting will modify:
    mount_effect
    stat_pri
    stat_sec
    stat_ground

    2) Enter the value to change defense: Y

    Multiplication: *1; *0.66; *0,66; *1,5...
    Regular addition: 4; 8; -2; -5; +2,5; 4,5...
    All resulting values in the EDU will be integers (no floating point, e.g. 5;+10;-12)

    This setting will modify:
    stat_pri_armour
    stat_sec_armour

    3) Enter the value to change lethality: Z

    Multiplication: *1; *0.66; *0,66; *1,5...
    Regular addition: -0,33; 0,33; +0,33...
    All resulting values in the EDU will be double precision floating points(0.00) and 0<Z<1

    After one pass, you have the option of either continue editing the new file 'E', or start from scratch 'R' if you messed up. There is also a settings file edustat_settings.txt generated at first run if not present.
    From there you can change the amounts with which the stats are changed in relation to the number you enter in the program. I believe it is quite well documented for people to understand.

    WARNING: You will need the latest .net framework! So if you experience weird errors, that's probably why.
    -> http://www.microsoft.com/downloads/..;lang=en
    Last edited by RedFox; September 16, 2009 at 11:16 AM.

  5. #5
    Kylan271's Avatar Domesticus
    Join Date
    Jul 2007
    Location
    Vietnam
    Posts
    2,235

    Default Re: RTW Unit Stat multiplier v1.2

    OK thanks for clarification,I have the microsoft program OK,so no probs.


  6. #6

    Default Re: RTW Unit Stat multiplier v1.2

    I see you are able to have a reference to specific unit stats by codes like X and Y. That's actually very cool! And I wonder if you maybe would be able to create a tool with which you can calculate unit costs based on a random formula.

    I know it's probably asked a bit too much, but there also are some stats in EDU which are not based on a value, but rather a word (like "hide_long_grass" or "piercing"). Perhaps you could then also add a function to let the user add a speccific value to such words. Allowing them to be used in the formula.

    In the end a formula would then be build up of codes. For example: "upkeep = A *B +(X -Y)"

    Would that be doable?
    It would surely be very helpful!!

  7. #7
    RedFox's Avatar When it's done.™
    Join Date
    Nov 2006
    Location
    Estonia
    Posts
    3,027

    Default Re: RTW Unit Stat multiplier v1.2

    It's always possible to do it. The real question here is: how practical would it be?

    I don't see anything difficult in making a basic formulator that uses variables.

    such as:
    attPri=10; attSec=8; allDef=20;
    cost=attPri+attSec *allDef *2.5
    cost= 18 *20 *2 = 900

    upkeep=cost /3
    upkeep=300
    Last edited by RedFox; October 05, 2009 at 12:03 PM.

  8. #8

    Default Re: RTW Unit Stat multiplier v1.2

    Yep very true. But you would have to create a different exe for everytime you change the formula. I was just thinking out loud though

    Well, I guess I have to live with my own primitive tools then
    (Besides the ones you already made of course!!)

  9. #9
    Squid's Avatar Opifex
    Patrician Artifex Technical Staff

    Join Date
    Feb 2007
    Location
    Frozen waste lands of the north
    Posts
    17,760
    Blog Entries
    3

    Default Re: RTW Unit Stat multiplier v1.2

    Not really you could make the forumula on the fly, it would just be a bit more complicated.
    Under the patronage of Roman_Man#3, Patron of Ishan
    Click for my tools and tutorials
    "Two things are infinite: the universe and human stupidity; and I'm not sure about the universe." -----Albert Einstein

  10. #10
    RedFox's Avatar When it's done.™
    Join Date
    Nov 2006
    Location
    Estonia
    Posts
    3,027

    Default Re: RTW Unit Stat multiplier v1.2

    PatricianS: You would not have to make a new exe every time you changed the formula. What I wrote was the way I proposed writing the formula into the UI. For example:

    1* -> (allDef*0.5*3 -statPri-statSec+statDef1) /2 *10 = var // totally random btw
    2* -> statPri*2 +statSec*2 +allDef*2 *10 = var // - || -

    The program would store all the formulas in either the registry, or in a settings file (I'd prefer settings.cfg), so the next time you boot the program, it remembers the formulas.

    I'd use spaces and '(',')' as delimiters. So that it firstly splits up the line with ( ):

    'allDef*0.5*3 -statPri-statSec
    +statDef1', '/2 *10'
    Then for each item, it splits again: (i'd use a method that returns a double)
    [0] -> 'allDef*0.5*3', '-statPri-statSec+statDef1'

    The first one isn't really a problem: since all this stuff is split into arrays, then only multiplication/division and addition/subtraction can exist in one array(list) item. For simplification, it would be good to forbid division, but I'll take a better look at that later.

    If '*' exists, split them all into an array 'allDef', '0.5', '3'
    Get allDef value, multiply with array[1] value '0.5' -> rearrange the new array into 'outValue', '3', repeat the multiplication process until array length is 1.
    Final outValue gets added to var

    Else (multiplication and addition)
    Since + doesn't really matter, it should do a quick replace: all '+' replaced with space ' ' characters and trimstart should be called. -> '-statPri-statSec statDef1'
    If startswith '-', subTract=true; else subTract=false; TrimStart '-' -> 'statPri-statSec statDef1'
    Once that is done, it can (again.. *sigh*) split it into an array 'statPri-statSec', 'statDef1'
    and now for each array item here, it checks if '-' exists, if there is, it splits them, subtracts all the possible subtractions and adds to the outValue.
    Now all that is left is 'statDef1', which has no other function than get statDef1 value and add to outValue.

    Now we have both of the outValues of the two items in the ()'s. If !subTract, we add the two values, else, we subtract.
    So, the first value inside the ( ) 's is done -> this outputs the 'var' value.
    Now it will rebuild the whole list:
    '<number> /2 *10'
    If no more ( ) exist, it splits it up with spaces and does simple functions.

    Obviously, this code is FAR from anything perfect (quite a few obvious flaws here and there), but I'll try to come up with some real code and post it here later.

    - P.S.: If you understood all of this, you get a free cookie, courtesy of RedFox.
    Last edited by RedFox; October 06, 2009 at 07:00 AM.

  11. #11

    Default Re: RTW Unit Stat multiplier v1.2

    Well, I understand what you're doing there. But translating this to AutoIt and actually make it happen is an entirely different matter

  12. #12
    RedFox's Avatar When it's done.™
    Join Date
    Nov 2006
    Location
    Estonia
    Posts
    3,027

    Default Re: RTW Unit Stat multiplier v1.2

    PatricianS: Trust me on this: Using C# or Visual Basic .Net is way easier than AutoIt.

  13. #13

    Default Re: RTW Unit Stat multiplier v1.2

    Oh ok. Well I should try that sometime then. I only just learned myself some advanced basics of AutoIt and used it to create a pretty advanced launcher for FoE (and RS). I'm a bit busy with FoE at the moment, but I surely will try it!

    Btw, isn't RTW written in C++?

  14. #14
    RedFox's Avatar When it's done.™
    Join Date
    Nov 2006
    Location
    Estonia
    Posts
    3,027

    Default Re: RTW Unit Stat multiplier v1.2

    RTW is written in C++, but I wouldn't use C++ for interactive development, especially if you're learning. Interpreting languages are much easier to learn with.

    C++ takes a lot of time to compile.

  15. #15

    Default Re: RTW Unit Stat multiplier v1.2

    Oh Ok... I downloaded this one now. it's C#

  16. #16
    RedFox's Avatar When it's done.™
    Join Date
    Nov 2006
    Location
    Estonia
    Posts
    3,027

    Default Re: RTW Unit Stat multiplier v1.2

    C# is rather easy to use/learn. Just remember 'F1' and Google 'C# <whatIwantToKnow>' and of course MSDN.

  17. #17
    Squid's Avatar Opifex
    Patrician Artifex Technical Staff

    Join Date
    Feb 2007
    Location
    Frozen waste lands of the north
    Posts
    17,760
    Blog Entries
    3

    Default Re: RTW Unit Stat multiplier v1.2

    Easy to learn hard to master. I'm still learning new things all the time.
    Under the patronage of Roman_Man#3, Patron of Ishan
    Click for my tools and tutorials
    "Two things are infinite: the universe and human stupidity; and I'm not sure about the universe." -----Albert Einstein

  18. #18
    RedFox's Avatar When it's done.™
    Join Date
    Nov 2006
    Location
    Estonia
    Posts
    3,027

    Default Re: RTW Unit Stat multiplier v1.2

    Well, its major plus is its beginner-friendliness. It just makes sense. C# isn't that much slower from C++ and rapid development + easier syntax outweighs all the pluses of C++. Even if C++ is a tad bit faster, it doesn't matter much since CPU's nowadays are so much more powerful and the gap is less obvious.
    The compilation time of C++ is just a pain, so if you're a beginner, figuring how stuff works is frustrating. There are some interpreting versions of C++ out there, but they're codejunk.

  19. #19

    Default Re: RTW Unit Stat multiplier v1.2

    Well, it is likely much faster than AutoIt anyway, so the speed isn't the problem. And the interface is very user-friendly indeed. Also with lots of beginners tutorials

  20. #20
    RedFox's Avatar When it's done.™
    Join Date
    Nov 2006
    Location
    Estonia
    Posts
    3,027

    Default Re: RTW Unit Stat multiplier v1.2

    You can try rewriting your tool in C# so you can get a hang of it.

Posting Permissions

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