Skip to content

Instantly share code, notes, and snippets.

@adituv
Last active June 26, 2016 23:14
Show Gist options
  • Select an option

  • Save adituv/b476bff32d95f499c4ce2446aac3bb75 to your computer and use it in GitHub Desktop.

Select an option

Save adituv/b476bff32d95f499c4ce2446aac3bb75 to your computer and use it in GitHub Desktop.
GH3 - show title

Show Song Title

The below script is the rough skeleton of a script to draw the song title at the top left.

I attempted to translate it the language used by the Tony Hawk modding community to describe QB scripts, but can't guarantee it's entirely correct. Further, it uses an opcode (0x4B) that wasn't available in at least the early Tony Hawk games (though probably was in THAW and onwards); I have denoted that as * in my scripts as it seems to be vaguely similar to C's pointer dereference.

As it uses this opcode, the QBX compiler will not work for this. I compiled the below script by hand.

Bugs

So far, the main issue is that this code just draws the text on screen and never removes it. To remove it, I'll need to add a line in the struct: :i $id$=$mytextelement$ then later call:

:i $safe_destroy$:s{
  :i $id$ = $mytextelement$
:i :s}

Also, I currently injected this script directly into numanuma_song.pak.xen rather than have it load on all songs. I will be editing existing scripts eventually, but I am currently researching how to have the settings of the displayed text editable in Queen Bee without editing the script.

Offset(h) 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
00000000 01 16 AD DC 9A 1D 16 5E 11 12 CC 07 0E 4B 16 38 ...Üš..^..Ì..K.8
00000010 78 A1 03 0F 01 16 40 51 66 73 03 01 16 D6 A8 21 x¡....@Qfs...Ö¨!
00000020 73 07 16 B6 DF 00 52 01 16 B0 9F 71 C2 07 16 F6 s..¶ß.R..°ŸqÂ..ö
00000030 3A 6B DF 01 16 2F 02 60 8B 07 05 16 97 18 98 85 :kß../.`‹...—.˜…
00000040 16 35 E0 26 E1 06 01 16 53 19 26 7F 07 1F 00 00 .5à&á...S.&.....
00000050 F0 41 00 00 F0 41 01 16 2D F7 6B 2F 07 0E 4B 16 ðA..ðA..-÷k/..K.
00000060 53 B3 09 A6 0F 01 16 38 58 74 C4 07 0E 2D 16 D1 S³.¦...8XtÄ..-.Ñ
00000070 12 6D 19 0F 01 16 BA CD 6B 3F 07 0E 4B 16 99 B9 .m....ºÍk?..K.™¹
00000080 B0 EE 0F 01 04 01 24 °î....$
:i call $get_song_title$ arguments
$song$ = (*$current_song$)
:i $createscreenelement$:s{
:i $type$ = $textelement$
:i $parent$ = $hud_window$
:i $just$ = :a{$left$, $top$:a}
:i $pos$ = %vec2(30.000000,30.000000)
:i $font$ = (*$user_control_text_font$)
:i $text$ = %GLOBAL%$song_title$
:i $rgba$ = (*$menu_text_color$)
:i :s}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment