(FIXED)I need help with making a menu!

Tony Hawk's Underground modding is discussed here.
ZurePitchmen83
Posts: 158
Joined: Mon Jul 30, 2012 9:18 am
Location: USA
Contact:

(FIXED)I need help with making a menu!

Postby ZurePitchmen83 » Wed Oct 17, 2012 6:57 am

I'm trying to make a menu for my THUG1 Mod, and i can't seem to get it to work, i tried integrating them to gamemenu.qb by decompiling with roq decompiler/recompiler, then i cut it off to the menu part, and put my menu in the middle of the script, and the button next to the "Change Level" Button, then compile the cut off script then hex edit gamemenu,qb, when i try to pause, the game crashes! :( , i also tried seperating the menu script and that didn't work at all, i edited my qdir and everything to load my new menu :nope: , is there any way to get a working menu in THUG1?

Code: Select all

:i function $create_zure_menu$
:i doIf call $ObjectExists$ arguments
$id$ = $current_menu_anchor$
:i call $DestroyScreenElement$ arguments
$id$ = $current_menu_anchor$
:i endif
:i call $pause_menu_gradient$ arguments
$off$
:i $make_new_menu$:s{
:i $menu_id$ = $zure_menu$
:i $vmenu_id$ = $zure_vmenu$
:i $menu_title$ = %s(16,"THUG1.1 MOD MENU")
:i $type$ = $VScrollingMenu$
:i $dims$ = %vec2(200.000000,350.000000)
:i $padding_scale$ = %f(0.950000)
:i $pos$ = %vec2(243.000000,50.000000)
:i :s}
:i $SetScreenElementProps$:s{$id$ = $zure_menu$
:i $event_handlers$ = :a{
:i :s{call $pad_back$ arguments
$generic_menu_pad_back$$params$ = :s{$callback$ = $create_pause_menu$:s}:s}
:i :a}
:i :s}
:i $set_theme_icons$
:i call $make_text_sub_menu_item$ arguments
$text$ = %s(10,"Debug Menu")$id$ = $debug_menu$$pad_choose_script$ = $create_debug_menu$
:i call $make_text_sub_menu_item$ arguments
$text$ = %s(4,"Done")$id$ = $menu_done$$pad_choose_script$ = $create_pause_menu$
:i call $RunScriptOnScreenElement$ arguments
$id$ = $current_menu_anchor$$animate_in$$params$ = :s{$final_pos$ = %vec2(320.000000,134.000000):s}
:i endfunction


this is the code for my menu, I don't see why it won't work for THUG1 :help
EDIT:I fixed this, quazz pointed out the issues with this menu on another site, now it works
Last edited by ZurePitchmen83 on Fri Nov 16, 2012 11:13 pm, edited 1 time in total.
THPS4 Level Expansion Pack, THUG2 710 Mod 1.0
Modding and Model ripping since 2009
WhoElseButMe
Posts: 419
Joined: Tue Aug 04, 2009 12:50 am
Location: FL - USA
Contact:

Re: I need help with making a menu!

Postby WhoElseButMe » Wed Oct 17, 2012 9:49 am

It looks like you're doing it wrong but I can't be 100% until I can write up a function and test and for a few reasons I can't do that right now.
I have a few suggestions 1) unlock debug menu through the pause menu instead of adding it to another menu, sure this doesn't help you create a menu but it gives you the options. 2) Use the theme_menu instead of the more in depth make_new_menu

Code: Select all

   if NOT CD
      make_sprite_menu_item text = "Debug Menu" id = debug_menu pad_choose_script = create_debug_menu
      make_text_sprite texture = <model_icon> parent = debug_menu
      make_sprite_menu_item text = "Test Menu" id = test_menu pad_choose_script = create_test_menu
      make_text_sprite texture = <model_icon> parent = test_menu
   endif

And remove the "if NOT CD" and the "endif" or change CD to isPS2 or something that would equate to true in your game.

As for the theme_menu have a look in displayoptions.qb -> create_display_options_menu
They're pretty much the same as thug2 theme_menus if you've created one there you should be able to do it in thug1 too.

The basics to a theme_menu

Code: Select all

script create_my_options_menu
   make_new_themed_sub_menu title = "MY OPTIONS"
   create_helper_text { helper_text_elements = [
         { text = "\b7/\b4 = Select" }
         { text = "\bn = Back" }
         { text = "\bm = Accept" }
      ]
   }
   SetScreenElementProps { id = sub_menu
      event_handlers = [
         { pad_back generic_menu_pad_back params = { callback = create_pause_menu } }
      ]
   }
   theme_menu_add_item {
      text = "My First Option"
      id = my_first_option
      pad_choose_script = do_something_here
      first_item = 1
      centered
   }
   theme_menu_add_item {
      text = "My Second Option"
      id = my_second_option
      pad_choose_script = do_something_else_here
      centered
   }
   theme_menu_add_item {
      text = "Done"
      id = menu_done
      pad_choose_script = create_pause_menu
      last_menu_item = 1
      centered
   }
   finish_themed_sub_menu
endscript
Image
WhoElseButMe on Nov 26, 2009 wrote:It's that lack of respect amongst their peers and ignorance towards modding etiquette that keeps us who know this stuff well from spreading it like wild fire. We do still enjoy playing the game and if you need to cheat to play a game PLAY SOMETHING ELSE YOU DON'T SUCK AT.
ZurePitchmen83
Posts: 158
Joined: Mon Jul 30, 2012 9:18 am
Location: USA
Contact:

Re: I need help with making a menu!

Postby ZurePitchmen83 » Wed Oct 17, 2012 10:42 pm

I tried to mess with the theme menu so it would be the way i wanted and it won't work still

Code: Select all

:i function $create_zure_menu$
   :i call $make_new_themed_sub_menu$ arguments
      $title$ = %s(17,"THUG1.1 TEST MENU")#/$title_icon$ = %GLOBAL%$title_icon$
   :i $create_helper_text$:s{$helper_text_elements$ = :a{
         :i :s{$text$ = %s(16,"\b7/\b4 = Select"):s}
         :i :s{$text$ = %s(10,"\bn = Back"):s}
         :i :s{$text$ = %s(12,"\bm = Accept"):s}
      :i :a}
   :i :s}
   :i $SetScreenElementProps$:s{$id$ = $sub_menu$
      :i $event_handlers$ = :a{
         :i :s{call $pad_back$ arguments
            $generic_menu_pad_back$$params$ = :s{$callback$ = $create_pause_menu$:s}:s}
      :i :a} #/you were missing an EndArray token
   :i :s}
   :i call $theme_menu_add_item$ arguments
      $text$ = %s(11,"Test Option")
      $id$ = $my_first_option$
      $pad_choose_script$ = $do_something_here$
      $centered$
   #/:i :s} this shouldn't be here
   :i call $theme_menu_add_item$ arguments
      $text$ = %s(4,"Done")
      $id$ = $menu_done$
      $pad_choose_script$ = $create_pause_menu$
      $centered$
   :i $finish_themed_sub_menu$
:i endfunction


and yet, when i try to use my menu, THE GAME DOES NOT START!!!, it just sits there doing ABSOLUTELY NOTHING! :@ :@ :@, Sorry if i sound like i'm mad but what did i do wrong?
THPS4 Level Expansion Pack, THUG2 710 Mod 1.0
Modding and Model ripping since 2009
ZurePitchmen83
Posts: 158
Joined: Mon Jul 30, 2012 9:18 am
Location: USA
Contact:

Re: I need help with making a menu!

Postby ZurePitchmen83 » Wed Oct 17, 2012 10:53 pm

Somebody please reply soon, i really need help before i end up scrapping my mod -_-
THPS4 Level Expansion Pack, THUG2 710 Mod 1.0
Modding and Model ripping since 2009
WhoElseButMe
Posts: 419
Joined: Tue Aug 04, 2009 12:50 am
Location: FL - USA
Contact:

Re: I need help with making a menu!

Postby WhoElseButMe » Wed Oct 17, 2012 11:42 pm

No one can be sure what you did wrong when your method of decompiling involves chopping up the script. If i had to guess you didn't piece it back together properly, which leaves a broken script that the game can't load.

EDIT: Try removing this "$title_icon$ = %GLOBAL%$title_icon$" unless you're passing in a title_icon parameter
Image
WhoElseButMe on Nov 26, 2009 wrote:It's that lack of respect amongst their peers and ignorance towards modding etiquette that keeps us who know this stuff well from spreading it like wild fire. We do still enjoy playing the game and if you need to cheat to play a game PLAY SOMETHING ELSE YOU DON'T SUCK AT.
ZurePitchmen83
Posts: 158
Joined: Mon Jul 30, 2012 9:18 am
Location: USA
Contact:

Re: I need help with making a menu!

Postby ZurePitchmen83 » Thu Oct 18, 2012 12:43 am

The game starts up now, but i can't access my menu! when i try to use my script with the button added, the game will crash when i try to hover over it! :help
THPS4 Level Expansion Pack, THUG2 710 Mod 1.0
Modding and Model ripping since 2009
WhoElseButMe
Posts: 419
Joined: Tue Aug 04, 2009 12:50 am
Location: FL - USA
Contact:

Re: I need help with making a menu!

Postby WhoElseButMe » Thu Oct 18, 2012 2:20 am

I don't follow, you mean when you try to access the modded menu that contains your added menu button item the game crashes?
Or it crashes only when you select the menu button item which calls on your menu? How did you mod the menu which contains your menu pointer?

EDIT: see your code posted above for the 3 fixes, this should work now.
Image
WhoElseButMe on Nov 26, 2009 wrote:It's that lack of respect amongst their peers and ignorance towards modding etiquette that keeps us who know this stuff well from spreading it like wild fire. We do still enjoy playing the game and if you need to cheat to play a game PLAY SOMETHING ELSE YOU DON'T SUCK AT.
ZurePitchmen83
Posts: 158
Joined: Mon Jul 30, 2012 9:18 am
Location: USA
Contact:

Re: I need help with making a menu!

Postby ZurePitchmen83 » Thu Oct 18, 2012 5:23 am

I'm attempting to add a button in the pause menu to launch my menu, and every attempt i try won't work, this is my attempt for the button to add it to the pause menu

Code: Select all

:i call $make_sprite_menu_item$ arguments
$text$ = %s(8,"Mod Menu")$id$ = $zure_menu$$pad_choose_script$ = $create_zure_menu$
:i call $make_text_sprite$ arguments
$texture$ = %GLOBAL%$model_icon$$parent$ = $zure_menu$


When i try to start the game with the edited script with the button, it won't start up, then i tried to mess with it, it started, but the game would crash if i exited the pause menu, and the button won't show up (like there's a blank in the menu where the button is supposed to be), The button is below the debug menu (which i unlocked by replacing CD with InNetGame), What's going on?
THPS4 Level Expansion Pack, THUG2 710 Mod 1.0
Modding and Model ripping since 2009
WhoElseButMe
Posts: 419
Joined: Tue Aug 04, 2009 12:50 am
Location: FL - USA
Contact:

Re: I need help with making a menu!

Postby WhoElseButMe » Thu Oct 18, 2012 6:56 am

What the fuck is <model_icon>?
That's your problem I'M CERTAIN OF IT.
Use one of the already used icon names.
The game loads them and unloads them accordingly and doesn't know anything about your made up global parameter.
I thought by your actual menu not supporting a made up icon name you would've learned by now but I guess not.

CD with InNetGame, USE SOMETHING ELSE. If you're ever in a net game these options won't appear. The point was to make them appear indefinitely.
Image
WhoElseButMe on Nov 26, 2009 wrote:It's that lack of respect amongst their peers and ignorance towards modding etiquette that keeps us who know this stuff well from spreading it like wild fire. We do still enjoy playing the game and if you need to cheat to play a game PLAY SOMETHING ELSE YOU DON'T SUCK AT.
ZurePitchmen83
Posts: 158
Joined: Mon Jul 30, 2012 9:18 am
Location: USA
Contact:

Re: I need help with making a menu!

Postby ZurePitchmen83 » Thu Oct 18, 2012 8:18 am

i fixed it, i replaced "zure_menu" with "sub_menu" in the button and it shows up, but i still can't access my menu, it crashes when i try to access my Mod's menu,
THPS4 Level Expansion Pack, THUG2 710 Mod 1.0
Modding and Model ripping since 2009
WhoElseButMe
Posts: 419
Joined: Tue Aug 04, 2009 12:50 am
Location: FL - USA
Contact:

Re: I need help with making a menu!

Postby WhoElseButMe » Thu Oct 18, 2012 1:12 pm

Did you fix the issues, I made changes in your menus code above involving the array end and struct end?
If so then the problem resides in the caller function and not the callee
Image
WhoElseButMe on Nov 26, 2009 wrote:It's that lack of respect amongst their peers and ignorance towards modding etiquette that keeps us who know this stuff well from spreading it like wild fire. We do still enjoy playing the game and if you need to cheat to play a game PLAY SOMETHING ELSE YOU DON'T SUCK AT.

Return to “THUG modding”

Who is online

Users browsing this forum: No registered users and 20 guests