Ranking
Original Post
[Mod] [LUA] Scaling fighters up or down

************************************************** ************
PLEASE UPLOAD ALL REPLAYS THAT USE A GOLIATH MOD HERE
************************************************** ************

1. Intro

2. Before you can use it…

3. How to use it
4. Problems
5. How did I came up with this script?
6. Pictures
7. Edit
Attached Files: Goliath mods and scaling script

1. Intro

In case you want to see results immediately, you can download a goliath replay here: get_on_my_back.tbm together with get_on_my_back_[goliathmod].rpl

This is the second script I’ve written so far and the first one I'm uploading. So please don’t hate >.<
The script enables you to scale your Toris up or down. This is a harder task than you might think, especially when Toris get taller and taller. So I wrote this script. Unfortunately, it only runs in Lua not in Toribash. (Maybe someone with more programming experience can change that?). After I had been asked to upload it, I made some improvements. I tried to make it more intuitive to use, too. Also, English is not my main language, so if there are any mistakes, please let me now.


The script is intended to make realistic 'David_VS_Goliath' action possible.

I hope some good sparers (and programers) will take a look at this =)


2. Before you can use it…
…you’ll need the default modmaker.tbm file.To make sure you've got the correct modmaker.tbm file, do this: Go to your data/mod folder. In case there is a modmaker.tbm file, delete it. Open Toribash, open single player, then open modmaker. Now there should be the correct (= default) modmaker.tbm file in your data/mod folder.


3. How to use it
3.1. After you opened the program, you will be asked how tall your Tori is supposed to be. This is the height factor. You can choose some value between > 0 and some larger number (not too large and too small though, I’ll come back to that later). Value 1 is a default Tori with the exact size we are all used to play with. If you choose value 1.5 your Tori will be +50% taller when compared to a default Tori. Choosing value 0.3 will size your Tori down by -70%. Pretty simple, right?
3.2. Next, you will be asked how heavy your Tori is supposed to be. This is the density factor. Actually you don’t really need this one because the script already changes the density correctly. No matter how tall you’ve chosen your Tori to be, just set density factor = 1 to calculate a realistic weight of your Tori. (I recommend value 1). Though, if you like to play around with this variable, go ahead: Values larger than 1 will make your Tori heavier compared to his / her height. Values less than 1 will make your Tori lighter. Set density factor = 0 and your Tori will weigh about as much as a default Tori - no matter how tall you made him / her!
Next, you will be asked to put in values for Uke, too.
3.3. Open your output.tbm file to change the game rules as you wish (set gravity to -30, turn off dismemberment, set player positions and stuff like that). Save your file. Load your output.tbm in Toribash. Now have fun.


4. Problems
4.1. The script doesn’t run in Toribash.
4.2. It’s kind of obvious, but sizing fighters too much up or down might crash your game.
4.3. Depending on whether they have been scaled up or down, fighters spawn a bit too high or too low, respectively.
4.4. With increasing their size, fighters get harder and harder to handle (assuming density factor is not less than 1). There are two reasons for that. More mass is harder to handle. Also, I had to make larger fighters less agile (or flexible, I don’t know the correct word). That means their joints have less range. Otherwise, the joints would start to bend under the pressure of the fighter’s weight and strength. That looks goofy and is impossible to handle.


5. How did I came up with this script?
Someday, I wondered if you could calculate the weight of the fighters. You can >.<

So I could see that the weight of the fighters increases disproportional to their actual size. They tend to get disproportionally 'fatter' the larger you make them. Though, with density factor = 1, double size equals double weight, what I think is more realistic and can actually be handled.


6. Pictures
To the left, there is a fighter scaled up by height factor 2. To the right, there is a default fighter (usual height and weight).
tori1.bmp

To the left, there is a fighter scaled up by height factor 4.9. To the right, there is a default fighter (usual height and weight).
tori2.bmp


7. Edit
08/12/2015: I've corrected some mistakes.
7.1. Now users can put in their directory when the script is running, they don't have to change the script itself anymore.
7.2. Also, there was a problem with the joint ranges I hadn't noticed before and now is fixed.

7.3. The densitiy of head, breast and chest will now be scaled down faster compared to the rest of the body parts. Larger fighters (size 2 and larger) will be able to walk better.
10/12/2015:
7.4. In version scale_tori_size_v5.lua, bicepses will also be scaled down faster.
7.5. I've added a replay.

11/12/2015:
7.6. When scaling fighters down, there was a problem with their joint ranges which now is fixed (scale_tori_size_v6.lua).
7.7.
When scaling fighters down, there was a problem with their weight which now is fixed (scale_tori_size_v6.lua).
Attached Files
d_vs_g_size1_vs_size1half.tbm (17.9 KB, 13 views)
d_vs_g_size1_vs_size2.tbm (17.5 KB, 14 views)
d_vs_g_size1_vs_size4_v2.tbm (17.1 KB, 13 views)
scale_tori_size_v6.lua (4.7 KB, 32 views)
Last edited by F3hler; Dec 11, 2015 at 02:24 PM. Reason: updated script
Wow this script is really impressive Oo nice job
Last edited by Mercurit; Dec 8, 2015 at 09:43 PM.
[sigpic][/sigpic]
Was zurük bleibt ist erinnerung
I hope to try this, it might be cool to try to trick using a smaller tori. Or, it would be cool to use a default tori with higher gravity (like -50) but make the tori lighter, so that the gravity appears more realistic.
Co-leader of Nitro | Replays
Hey, I'm working on a boss battle kind of mod, and this mod would help greatly by reducing the time it'd take to resize the "boss" tori.

Is it possible to use the resized tori in modmaker?