[THUG2]Unlimited Scales

Tutorials for all THUG+ games goes here.
Forum rules
This forum is only for posting tutorials.
Specify what game it is for, and please take a look at this Template.
Post Reply
ProHad
VIP
Posts: 45
Joined: Wed Mar 03, 2010 10:10 pm

[THUG2]Unlimited Scales

Post by ProHad » Mon Feb 14, 2011 9:40 pm

First things first, I would like to explain a couple things. The first thing is something you need to read, the second thing I feel needs an explanation, but if your only reading this because you want the scales and you don't give a shit and don't want to learn anything here then it can be skipped, I guess.

Pre and Scripts
- Unlike most scripts you'll have any interest in the .qb files necessary for this mod are not located in qb_scripts.prx
- They are instead located in mainmenu_scripts.prx
- You will need to dummy this pre file to load your scripts from the files instead.
- To get to these file instead of going into data/scripts we are going to go into data/levels/mainmenu
- The two scripts we are going to be using here are scalingmenu.qb and colormenu.qb

-1.#QNAN0
NAN stands for not a number -1.#QNAN0 is a somewhat common error in c

as described by Yann L:
-1.#QNAN0 means: set sign bit (-), first part of the implied IEEE leading 1 (1.#), and exponent/mantissa is not a number but a quiet NaN (QNaN) type 0.
We are going to exploit this to max out the scales rather then what I did in my THPS3 tutorial where I just set the max to a value that was not likely to be reached.

Let's Get Down To Business!

What is needed?
colormenu.qb
scalingmenu.qb
A qb compiler(I suggest using roq's version of Blub's tool along with the roq cmd GUI to make things simple)

XYZ
Unlike THPS3 Instead of using Height and Weight THUG2's scaling system is broken down into seporate bone groups, each bone group has an X, Y, and Z scale We really don't need to worry that there is XYZ we just need to know that there are different bone groups.

Open up scalingmenu.qb like past games you'll notice the scaling information is fairly close to the top.
:i :s{$part$ = call $object_scaling$ arguments
$male_min$ = %f(90.000000)$male_max$ = %f(120.000000)$female_min$ = %f(90.000000)$female_max$ = %f(120.000000):s}
:i :s{$part$ = call $headtop_bone_group$ arguments
$male_min$ = %f(80.000000)$male_max$ = %f(130.000000)$female_min$ = %f(80.000000)$female_max$ = %f(130.000000):s}
:i :s{$part$ = call $head_bone_group$ arguments
$male_min$ = %f(85.000000)$male_max$ = %f(115.000000)$female_min$ = %f(85.000000)$female_max$ = %f(115.000000):s}
:i :s{$part$ = call $nose_bone_group$ arguments
$male_min$ = %f(20.000000)$male_max$ = %f(150.000000)$female_min$ = %f(20.000000)$female_max$ = %f(150.000000):s}
:i :s{$part$ = call $Jaw_bone_group$ arguments
$male_min$ = %f(60.000000)$male_max$ = %f(130.000000)$female_min$ = %f(60.000000)$female_max$ = %f(130.000000):s}
:i :s{$part$ = call $torso_bone_group$ arguments
$male_min$ = %f(90.000000)$male_max$ = %f(130.000000)$female_min$ = %f(90.000000)$female_max$ = %f(150.000000):s}
:i :s{$part$ = call $stomach_bone_group$ arguments
$male_min$ = %f(90.000000)$male_max$ = %f(130.000000)$female_min$ = %f(90.000000)$female_max$ = %f(100.000000):s}
:i :s{$part$ = call $upper_arm_bone_group$ arguments
$male_min$ = %f(90.000000)$male_max$ = %f(130.000000)$female_min$ = %f(90.000000)$female_max$ = %f(120.000000):s}
:i :s{$part$ = call $lower_arm_bone_group$ arguments
$male_min$ = %f(90.000000)$male_max$ = %f(130.000000)$female_min$ = %f(90.000000)$female_max$ = %f(120.000000):s}
:i :s{$part$ = call $hands_bone_group$ arguments
$male_min$ = %f(90.000000)$male_max$ = %f(130.000000)$female_min$ = %f(90.000000)$female_max$ = %f(120.000000):s}
:i :s{$part$ = call $upper_leg_bone_group$ arguments
$male_min$ = %f(90.000000)$male_max$ = %f(150.000000)$female_min$ = %f(90.000000)$female_max$ = %f(120.000000):s}
:i :s{$part$ = call $lower_leg_bone_group$ arguments
$male_min$ = %f(90.000000)$male_max$ = %f(150.000000)$female_min$ = %f(90.000000)$female_max$ = %f(120.000000):s}
:i :s{$part$ = call $feet_bone_group$ arguments
$male_min$ = %f(90.000000)$male_max$ = %f(150.000000)$female_min$ = %f(90.000000)$female_max$ = %f(120.000000):s}
:i :a}
Everything is very cleanly laid out here, we can see the bone group and the min/max for both male and female directly under it. We will start out by setting all of the minimums to 0.
:i :s{$part$ = call $object_scaling$ arguments
$male_min$ = %f(0.000000)$male_max$ = %f(120.000000)$female_min$ = %f(0.000000)$female_max$ = %f(120.000000):s}
:i :s{$part$ = call $headtop_bone_group$ arguments
$male_min$ = %f(0.000000)$male_max$ = %f(130.000000)$female_min$ = %f(0.000000)$female_max$ = %f(130.000000):s}
:i :s{$part$ = call $head_bone_group$ arguments
$male_min$ = %f(0.000000)$male_max$ = %f(115.000000)$female_min$ = %f(0.000000)$female_max$ = %f(115.000000):s}
:i :s{$part$ = call $nose_bone_group$ arguments
$male_min$ = %f(0.000000)$male_max$ = %f(150.000000)$female_min$ = %f(0.000000)$female_max$ = %f(150.000000):s}
:i :s{$part$ = call $Jaw_bone_group$ arguments
$male_min$ = %f(0.000000)$male_max$ = %f(130.000000)$female_min$ = %f(0.000000)$female_max$ = %f(130.000000):s}
:i :s{$part$ = call $torso_bone_group$ arguments
$male_min$ = %f(0.000000)$male_max$ = %f(130.000000)$female_min$ = %f(0.000000)$female_max$ = %f(150.000000):s}
:i :s{$part$ = call $stomach_bone_group$ arguments
$male_min$ = %f(0.000000)$male_max$ = %f(130.000000)$female_min$ = %f(0.000000)$female_max$ = %f(100.000000):s}
:i :s{$part$ = call $upper_arm_bone_group$ arguments
$male_min$ = %f(0.000000)$male_max$ = %f(130.000000)$female_min$ = %f(0.000000)$female_max$ = %f(120.000000):s}
:i :s{$part$ = call $lower_arm_bone_group$ arguments
$male_min$ = %f(0.000000)$male_max$ = %f(130.000000)$female_min$ = %f(0.000000)$female_max$ = %f(120.000000):s}
:i :s{$part$ = call $hands_bone_group$ arguments
$male_min$ = %f(0.000000)$male_max$ = %f(130.000000)$female_min$ = %f(0.000000)$female_max$ = %f(120.000000):s}
:i :s{$part$ = call $upper_leg_bone_group$ arguments
$male_min$ = %f(0.000000)$male_max$ = %f(150.000000)$female_min$ = %f(0.000000)$female_max$ = %f(120.000000):s}
:i :s{$part$ = call $lower_leg_bone_group$ arguments
$male_min$ = %f(0.000000)$male_max$ = %f(150.000000)$female_min$ = %f(0.000000)$female_max$ = %f(120.000000):s}
:i :s{$part$ = call $feet_bone_group$ arguments
$male_min$ = %f(0.000000)$male_max$ = %f(150.000000)$female_min$ = %f(0.000000)$female_max$ = %f(120.000000):s}
:i :a}

Now this is where we get to take advantage of -1.#QNAN0, Instead of using digits for our maximums we are going to replace them with -1.#QNAN0.
:i :s{$part$ = call $object_scaling$ arguments
$male_min$ = %f(0.000000)$male_max$ = %f(-1.#QNAN0)$female_min$ = %f(0.000000)$female_max$ = %f(-1.#QNAN0):s}
:i :s{$part$ = call $headtop_bone_group$ arguments
$male_min$ = %f(0.000000)$male_max$ = %f(-1.#QNAN0)$female_min$ = %f(0.000000)$female_max$ = %f(-1.#QNAN0):s}
:i :s{$part$ = call $head_bone_group$ arguments
$male_min$ = %f(0.000000)$male_max$ = %f(-1.#QNAN0)$female_min$ = %f(0.000000)$female_max$ = %f(-1.#QNAN0):s}
:i :s{$part$ = call $nose_bone_group$ arguments
$male_min$ = %f(0.000000)$male_max$ = %f(-1.#QNAN0)$female_min$ = %f(0.000000)$female_max$ = %f(-1.#QNAN0):s}
:i :s{$part$ = call $Jaw_bone_group$ arguments
$male_min$ = %f(0.000000)$male_max$ = %f(-1.#QNAN0)$female_min$ = %f(0.000000)$female_max$ = %f(-1.#QNAN0):s}
:i :s{$part$ = call $torso_bone_group$ arguments
$male_min$ = %f(0.000000)$male_max$ = %f(-1.#QNAN0)$female_min$ = %f(0.000000)$female_max$ = %f(-1.#QNAN0):s}
:i :s{$part$ = call $stomach_bone_group$ arguments
$male_min$ = %f(0.000000)$male_max$ = %f(-1.#QNAN0)$female_min$ = %f(0.000000)$female_max$ = %f(-1.#QNAN0):s}
:i :s{$part$ = call $upper_arm_bone_group$ arguments
$male_min$ = %f(0.000000)$male_max$ = %f(-1.#QNAN0)$female_min$ = %f(0.000000)$female_max$ = %f(-1.#QNAN0):s}
:i :s{$part$ = call $lower_arm_bone_group$ arguments
$male_min$ = %f(0.000000)$male_max$ = %f(-1.#QNAN0)$female_min$ = %f(0.000000)$female_max$ = %f(-1.#QNAN0):s}
:i :s{$part$ = call $hands_bone_group$ arguments
$male_min$ = %f(0.000000)$male_max$ = %f(-1.#QNAN0)$female_min$ = %f(0.000000)$female_max$ = %f(-1.#QNAN0):s}
:i :s{$part$ = call $upper_leg_bone_group$ arguments
$male_min$ = %f(0.000000)$male_max$ = %f(-1.#QNAN0)$female_min$ = %f(0.000000)$female_max$ = %f(-1.#QNAN0):s}
:i :s{$part$ = call $lower_leg_bone_group$ arguments
$male_min$ = %f(0.000000)$male_max$ = %f(-1.#QNAN0)$female_min$ = %f(0.000000)$female_max$ = %f(-1.#QNAN0):s}
:i :s{$part$ = call $feet_bone_group$ arguments
$male_min$ = %f(0.000000)$male_max$ = %f(-1.#QNAN0)$female_min$ = %f(0.000000)$female_max$ = %f(-1.#QNAN0):s}
:i :a}
Colour Scale

Now open up colormenu.qb

Once again all the information we need is right around the top, we are only going to use the bottom section of this chunk.
:i $colormenu_bar_scale$ = %vec2(4.400000,2.000000)
:i $colormenu_bar_focus_rgba$ = :a{%i(128,00000080)%i(128,00000080)%i(128,00000080)%i(118,00000076):a}
:i $colormenu_bar_unfocus_rgba$ = :a{%i(40,00000028)%i(40,00000028)%i(40,00000028)%i(118,00000076):a}
:i $colormenu_bar_pos$ = %vec2(12.000000,0.000000)
:i $colormenu_text_pos$ = %vec2(-102.000000,0.000000)
:i $colormenu_spacing_between$ = %i(25,00000019)
:i $colormenu_arrow_pos_up$ = %vec2(0.000000,7.000000)
:i $colormenu_arrow_pos_down$ = %vec2(0.000000,-7.000000)
:i $colormenu_arrow_rgba$ = :a{%i(128,00000080)%i(128,00000080)%i(128,00000080)%i(128,00000080):a}
:i $colormenu_arrow_scale$ = %f(0.700000)
:i $colormenu_wrap_arrow_left$ = %f(-53.000000)
:i $colormenu_wrap_arrow_right$ = %f(80.000000)
:i $colormenu_nowrap_arrow_left$ = %f(-53.000000)
:i $colormenu_nowrap_arrow_right$ = %f(80.000000)
:i $colormenu_hue_increment$ = %i(5,00000005)
:i $colormenu_saturation_increment$ = %i(3,00000003)
:i $colormenu_value_increment$ = %i(2,00000002)
:i $colormenu_min_saturation$ = %f(0.000000)
:i $colormenu_max_saturation$ = %f(90.000000)
:i $colormenu_min_value$ = %f(12.000000)
:i $colormenu_max_value$ = %f(60.000000)

:i function $edit_graphic_image_focus_glow$
We are going to do the same exact thing we did with the bone groups setting the min to 0 and the max as -1.#QNAN0
:i $colormenu_min_saturation$ = %f(0.000000)
:i $colormenu_max_saturation$ = %f(-1.#QNAN0)
:i $colormenu_min_value$ = %f(0.000000)
:i $colormenu_max_value$ = %f(-1.#QNAN0)
That's it that's all

Recompile em and replace your defaults, and you're done, scale away kiddo.

I may do a fast little write up about deck scale at a later point, but for now you have this.
Last edited by ProHad on Sat Mar 12, 2011 1:13 pm, edited 1 time in total.

%.gone.
Global Moderator
Posts: 390
Joined: Sun Mar 07, 2010 5:12 pm

Re: [THUG2]Unlimited Scales

Post by %.gone. » Tue Feb 15, 2011 9:46 am

I was wondering why you didn't do NaN in your THPS3 tut.
Maxing out the color saturation, hue and value gives ill effects instead just find the max and set that.

ProHad
VIP
Posts: 45
Joined: Wed Mar 03, 2010 10:10 pm

Re: [THUG2]Unlimited Scales

Post by ProHad » Tue Feb 15, 2011 3:19 pm

Yeah i get what you mean, that would make it 1025328 then if I'm not mistaken?

Post Reply