[THAW-THPG][PC/XBX/PS2]Make an array menu

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.
Morten1337
Site Admin
Posts: 322
Joined: Mon Mar 01, 2010 2:23 pm
Location: Norway

[THAW-THPG][PC/XBX/PS2]Make an array menu

Post by Morten1337 » Sat Mar 06, 2010 6:32 am

In this tutorial I i will show you how to make menus;
!NOTE: This is an old tutorial, there might be better ways to do this. Sorry for bad grammar etc.

First you need to read these threads:
(if you're not a complete newbie, then fuck this.. :D)
http://hackthps.it.cx/forum/showthread.php?t=116
http://hackthps.it.cx/forum/showthread.php?t=201 (Only the last part)


Ok... The differences between thug2 and thaw is, that the qb files are packed insinde a (pak)-file.

ofc there has been made some tools to extract them..

Tools you need:
Notepad
roq.exe
QueenBee 1.6
RoqCmd
Any hex editor


I figured a nice way to create menus in thaw... by making a function that adds menu items from arrays instead of from the function. This saves you alot of time, because QueenBee can only import/export functions as qb(edit-able). This means you have to compile each function as a separate qb, then import in queenbee every time, So instead you can use the Array editor in queenbee to fix your menu items.

I decided not to tell you how to add the a menu item to the pausemenu, you just need som basic hex skills, and because i dot want everyone to have menus etc, because of cheating online!

Here i'll show you what it looks like:
1.Create an qb file, and paste this

%include "MyMenu.qb_table.qbi" #/ Table file
:i $hide_current_goal$
:i $make_label_menu$:s{
:i $title$ = %s(0,"My Menu")
:i $title_pos$ = %vec2(160.000000,40.000000)$pos$ = %vec2(130.000000,120.000000)$title_rotation$ = %i(10,0000000a)
:i $spacing$ = %i(2,00000002)
:i $pad_back_script$ = call $generic_menu_pad_back$ arguments
$pad_back_params$ = :s{$callback$ = $create_pause_menu$:s}
:i :s}
:i $pause_menu_gradient$
:i $white_poly_bg_effect$
:i $GoalManager_HideGoalPoints$
:i $GoalManager_HidePoints$
:i $unhide_root_window$
:i $array_name$ = $MyMenuArray$
:i $GetArraySize$%GLOBAL%$array_name$
:i $item_index$ = %i(0,00000000)
:i while

:i $text$ = ( (%GLOBAL%$array_name$:a{%GLOBAL%$item_index$:a}) ->$text$)
:i $rot$ = ( (%GLOBAL%$array_name$:a{%GLOBAL%$item_index$:a}) ->$rot$)
:i $pad_choose_script$ = ( (%GLOBAL%$array_name$:a{%GLOBAL%$item_index$:a}) ->$pad_choose_script$)

:i $add_label_menu_item$:s{
:i $text$ = %GLOBAL%$text$
:i $rot$ = %GLOBAL%$rot$
:i $length$ = %i(140,00000096)
:i $scale$ = %f(0.700000)
:i $text_offset$ = %vec2(0.000000,0.000000)
:i $label_offset$ = %vec2(-10.000000,0.000000)
:i $pad_choose_script$ = %GLOBAL%$pad_choose_script$
:i :s}

:i %GLOBAL%$item_index$ = (%GLOBAL%$item_index$ + %i(1,00000001))
:i loop_to %GLOBAL%$array_size$
:i $label_menu_finish$
:i endfunction
ø Read the qb creation thread
ø The Title of your menu
ø This is the menu that you want to load if you press bakc button
ø This is the name of the array it loads menuitems from.. (I will explain this later in the tut.)

2.Now open RoqCMD Select your txt file and press compile (twice)
3.Now open the output file i hexeditor, search for "$+" (string)
then delete everything below "$"

Like this:
Image


Now lets create some arrays!



1.Launch QueenBee and Select:
PC(WCP) - on the dropdown box
...\game\data\pak\qb_e.pak - as PAK file
...\game\data\pak\qb_e.pab - as PAB file
...\game\data\pak\qbdb.pak - as DEBUG file
Then press "Load"

Image

2.Select an empty qb file, ex car_scripts.qb

3. Now Right click and select "Add Child" and select "SectionArray".
4. Select it and give it a name
(This is the "ArrayName" from the func you have made)
5. Now Right click the "SectionArray" and Add Child; "ArrayStruct"
6. Now Right click the "ArrayStruct" and Add Child; "StructHeader"
7. Then Add these childs to "ArrayStruct":

Code: Select all

StructItemString
StructItemQbKey
StructItemIntreger
Here i'll show you what to fill the boxes with
StructItemString:
ItemQbKey = "text"
Text = "The text in your menu item" (ex. "Debug Menu")

StructItemQbKey:
ItemQbKey = pad_choose_script
QB Key = "create_???_menu" (the function name of your ""link"")

StructItemIntreger:
ItemQbKey = "rot"
number = "0" (This is the rotation of the meu item, use "-2" and up to "4")
8. Repeat Step nr 6 and 7, to add more items!


Thats it! ;)

~Morten1337

cookie90
Posts: 30
Joined: Tue Mar 09, 2010 4:32 pm

Re: [TUROTIAL: Thaw] Make an array menu

Post by cookie90 » Tue Mar 09, 2010 4:35 pm

i dont undestand that pls make pic´s )=

3. Now Right click and select "Add Child" and select "SectionArray".
4. Select it and give it a name
(This is the "ArrayName" from the func you have made)
5. Now Right click the "SectionArray" and Add Child; "ArrayStruct"
6. Now Right click the "ArrayStruct" and Add Child; "StructHeader"
7. Then Add these childs to "ArrayStruct":

Code: Select all
StructItemString
StructItemQbKey
StructItemIntreger



Here i'll show you what to fill the boxes with

StructItemString:
ItemQbKey = "text"
Text = "The text in your menu item" (ex. "Debug Menu")

StructItemQbKey:
ItemQbKey = pad_choose_script
QB Key = "create_???_menu" (the function name of your ""link"")

StructItemIntreger:
ItemQbKey = "rot"
number = "0" (This is the rotation of the meu item, use "-2" and up to "4")



8. Repeat Step nr 6 and 7, to add more items!

Morten1337
Site Admin
Posts: 322
Joined: Mon Mar 01, 2010 2:23 pm
Location: Norway

Re: [TUROTIAL: Thaw] Make an array menu

Post by Morten1337 » Wed Mar 10, 2010 12:22 pm

cookie90 wrote:i dont undestand that pls make pic´s )=
i'm sorry for the bad explanation on that part. I think things have changed inside queenbee, so im not sure if this is the "up-to-date"-way to do it. ;)
Also i dont have thaw or queenbee installed, so i cant really help you with pictures, sorry : /

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

Re: [TUROTIAL: Thaw] Make an array menu

Post by %.gone. » Wed Mar 10, 2010 2:00 pm

the only part i believe thats out of date is that with newer versions of queenbee you can add scripts to the pak/pab
but this stuff can go inside any script

you need to double click on a script to open it up and from there you need to right click the left area in queenbee
"insert sibling/child" places your request ABOVE where you clicked, "add sibling/child" places your request BELOW where you clicked

3) so while in ANY script right click a main script item and select either "insert" or "add" child and find "sectionarray" from the list that appears.
4) now give it the name that you have in your script function, for this example it would be "MyMenuArray"
5) then right click that "sectionarray item" to add children per this tutorial.
you can also right click on the child and select "add or insert "sibling""

cookie90
Posts: 30
Joined: Tue Mar 09, 2010 4:32 pm

Re: [TUROTIAL: Thaw] Make an array menu

Post by cookie90 » Fri Mar 12, 2010 10:49 am

can somebody say me pls how to use roq.exe pls with download link and tutorial PLS ;:D how to compile :D

quazz
Global Moderator
Posts: 196
Joined: Sat Nov 13, 2010 12:04 am

Re: [TUROTIAL: Thaw] Make an array menu

Post by quazz » Fri Mar 12, 2010 1:08 pm

I'll make a tutorial later to help out, expect me to make a new topic for it.

qwertysind
Posts: 117
Joined: Sun Mar 14, 2010 9:07 am

Re: [TUROTIAL: Thaw] Make an array menu

Post by qwertysind » Sun Mar 14, 2010 9:14 am

Can anybody do "The Off/On Menu Tutorial"? I will be very glad, if someone do it

cookie90
Posts: 30
Joined: Tue Mar 09, 2010 4:32 pm

Re: [TUROTIAL: Thaw] Make an array menu

Post by cookie90 » Sun Mar 14, 2010 11:14 am

i have a problem pls =)

http://www.youtube.com/user/MoDdEr44

Morten1337
Site Admin
Posts: 322
Joined: Mon Mar 01, 2010 2:23 pm
Location: Norway

Re: [TUROTIAL: Thaw] Make an array menu

Post by Morten1337 » Sun Mar 14, 2010 12:22 pm

try to add this at the last line;
:end

cookie90
Posts: 30
Joined: Tue Mar 09, 2010 4:32 pm

Re: [TUROTIAL: Thaw] Make an array menu

Post by cookie90 » Sun Mar 14, 2010 1:03 pm

i ad this and now its is so


:i $make_label_menu$:s{
:i $title$ = %s(0,"My Menu")
:i $title_pos$ = %vec2(160.000000,40.000000)$pos$ = %vec2(130.000000,120.000000)$title_rotation$ = %i(10,0000000a)
:i $spacing$ = %i(2,00000002)
:i $pad_back_script$ = call $generic_menu_pad_back$ arguments
$pad_back_params$ = :s{$callback$ = $create_pause_menu$:s}
:i :s}
:i $pause_menu_gradient$
:i $white_poly_bg_effect$
:i $GoalManager_HideGoalPoints$
:i $GoalManager_HidePoints$
:i $unhide_root_window$
:i $array_name$ = $MyMenuArray$
:i $GetArraySize$%GLOBAL%$array_name$
:i $item_index$ = %i(0,00000000)
:i while

:i $text$ = ( (%GLOBAL%$array_name$:a{%GLOBAL%$item_index$:a}) ->$text$)
:i $rot$ = ( (%GLOBAL%$array_name$:a{%GLOBAL%$item_index$:a}) ->$rot$)
:i $pad_choose_script$ = ( (%GLOBAL%$array_name$:a{%GLOBAL%$item_index$:a}) ->$pad_choose_script$)

:i $add_label_menu_item$:s{
:i $text$ = %GLOBAL%$text$
:i $rot$ = %GLOBAL%$rot$
:i $length$ = %i(140,00000096)
:i $scale$ = %f(0.700000)
:i $text_offset$ = %vec2(0.000000,0.000000)
:i $label_offset$ = %vec2(-10.000000,0.000000)
:i $pad_choose_script$ = %GLOBAL%$pad_choose_script$
:i :s}

:i %GLOBAL%$item_index$ = (%GLOBAL%$item_index$ + %i(1,00000001))
:i loop_to %GLOBAL%$array_size$
:i $label_menu_finish$
:i endfunction

:end


and now it was again well in the video )=

Post Reply