Are there THQB Tutorials?

Tony Hawk's Pro Skater 3 mod discussion.
itsthejayden
Posts: 16
Joined: Thu Jul 22, 2010 3:08 pm
Contact:

Are there THQB Tutorials?

Postby itsthejayden » Sun Sep 08, 2013 11:56 pm

Is there any Tutorials or help understanding some of the THPS3 .qb code?
Demo
Posts: 494
Joined: Mon Aug 15, 2011 2:20 pm
Contact:

Re: Are there THQB Tutorials?

Postby Demo » Mon Sep 09, 2013 5:26 pm

most of tutorials were written for roq compiler and thug+ games.
but if you got any problem you may ask here
itsthejayden
Posts: 16
Joined: Thu Jul 22, 2010 3:08 pm
Contact:

Re: Are there THQB Tutorials?

Postby itsthejayden » Tue Sep 10, 2013 11:24 pm

How would I add (or change) any menus and such?
Demo
Posts: 494
Joined: Mon Aug 15, 2011 2:20 pm
Contact:

Re: Are there THQB Tutorials?

Postby Demo » Wed Sep 11, 2013 9:21 am

Most menus can be found in qb files that have menu it their names like debugmenu, mainmenu, sfxmenu, etc.
Let's check a static menu example in optionsmenu.qb.
It's the menu that you can access by pressing options in main menu.

Look for Id = options_main_menu and you'll find this (actually it's the very first struct in this file)

Code: Select all

#00029    createmenu STRUCT{
            type = verticalmenu            //menu type
            Id = options_main_menu         //menu ID
            x = 170.0               // x, y - menu  position
            y = 90.0
            w = 300.0               // w,h - menu width and height
            h = 400.0
            just_center_x just_center_y blue_top   //params, other menus can have more.
            eventhandlers = ARRAY(  <...>   )      //this array contains event handlers, so you can show something different if conditions are met.
            children = ARRAY(            //children array, aka list of menuelements.
             
              STRUCT{               // this struct creates the blue menu header
                type = textmenuelement
                auto_id text = "Options"
                static dont_gray drawer = title      //this part makes it blue and huge
                }
              STRUCT{               //this struct links to another menu
                type = textmenuelement
                Id = soundfx_menu
                text = "sound options"
                link = sfx_menu_container                 
                }
              STRUCT{               // this struct links to a function
                type = textmenuelement
                auto_id
                text = "load game"
                target = "OptionsMenuLoad"
                }
<...>
}
)


So actionly all you need to add a new element is to insert another menuitem struct in the children array

Code: Select all

          STRUCT{
                type = textmenuelement      //says that it is menu element
                auto_id            // you may use this if you don't need actual ID, else you have to use Id = <your_id>. IDs should be unique.
                text = "load game"      //text that will be shown in menu
                target = "OptionsMenuLoad"   //target calls 1 function. if you need more than 1, you have to write your own function and call it instead.
                //link = sfx_menu_container   this may be used instead of target to link to another menu. the menu ID should be called here.
                }



Now a working example that will add a new menu item and play a special trick sound right after you press it.

Insert this struct as the second one in array, compile and try.

Code: Select all

              STRUCT{
                type = textmenuelement
                Id = newfunc_id
                text = "Play Special Sound"
                target = "LaunchSpecialMessage"
                }


Image
esoQsell
Posts: 1
Joined: Wed Aug 13, 2014 7:20 am

Re: Are there THQB Tutorials?

Postby esoQsell » Wed Aug 13, 2014 7:23 am

Who wants to be my friend?

we can be friends?

______________________
Here is my Favorites RS Gold will sent to you.

Return to “THPS3 modding”

Who is online

Users browsing this forum: No registered users and 2 guests