[THUG2][PC] How to make an animation Menu

Tutorial forum for Tony Hawk games.
Forum rules
No requests, use other sections for that. TAG your titles [THAW][THUG2] etc.
Anteara
Posts: 268
Joined: Thu Oct 14, 2010 2:55 am
Contact:

[THUG2][PC] How to make an animation Menu

Postby Anteara » Fri Jan 28, 2011 2:10 pm

In this tutorial I will show you how to create an animation menu.

Things needed:
  • QB Decompiler/Compiler
  • Your own menu

The way this tutorial works:
  • The functions will be displayed in quotes (because I can't use color in code)
  • Parts of each function will be color coded, underneath the function will show you what each color means

The reason I am color coding things is so people will learn what each part of the function does.




For this tutorial, we will use a scrolling menu, that way we can put as many animations on a single menu as we want.

1) How to make a scrolling menu

:i function $anims_menu$
:i call $make_new_themed_scrolling_menu$ arguments
$title$ = %s(14,"Animation Menu")
:i $SetScreenElementProps$:s{
:i $id$ = $sub_menu$
:i $event_handlers$ = :a{:s{call $pad_back$ arguments
$generic_menu_pad_back$$params$ = :s{$callback$ = $create_anteara_menu$:s}:s}

:i :a}
:i $replace_handlers$
:i :s}
:i call $theme_menu_add_item$ arguments
$text$ = %s(7,"Blocker")
$pad_choose_script$ = $Anim_01$$no_bg$$centered$ = $centered$
:i call $theme_menu_add_item$ arguments
$text$ = %s(4,"Done")$pad_choose_script$ = $create_anteara_menu$$no_bg$$centered$ = $centered$
:i $finish_themed_scrolling_menu$
:i endfunction


#The type of menu we will be making
#The title of the menu
#The pad back script (When you press escape or backspace)
#The menu item
#The function that the menu item calls

2) Now that we have a menu, we haveto make the function that the menu item will call.

:i function $Anim_01$
:i $exit_pause_menu$
:i $Skater$.call $PlayAnim$ arguments
$Anim$ = $Ped_Blocker_BlockA_idle$$cycle$$NoRestart$

:i endfunction


#The function name
#When the function is called, this will exit the pause menu
#Self explanatory
#This is the anim that is being called

We now have a scrolling menu with a menu item that when used exits the pause menu, and tells the skater to play an anim. It's also possible to link anims.

3) How to link an anim

:i function $anteara_starwars$
:i $exit_pause_menu$
:i $Skater$.call $PlayAnim$ arguments
$Anim$ = $PED_Starwarskid_clip01$
:i $Skater$.$WaitAnimFinished$
:i $Skater$.call $PlayAnim$ arguments
$Anim$ = $PED_Starwarskid_clip02$
:i $Skater$.$WaitAnimFinished$
:i endfunction


#This tells the function to wait for the first anim to finish, and when it is finished, it will then play the next anim.

We now have a function with two anims linked together.

Unfortunately, at this time, I will not tell you how to make these anims work online, the reason i am not going to tell you this is because if you use an anim online that another player doesn't have preloaded, you will cause the other player to crash, and in many cases, you will crash the entire server.

You still may use these anims in story mode, etc, you just haveto locate where each anim is loaded. When using anims be sure to be off your board, the anims don't work if you're on your board.

Also, some of this code is sloppy, but it does work well nonetheless.
PunK™95
Posts: 19
Joined: Sat Feb 12, 2011 6:03 am
Contact:

Re: [THUG2][PC] How to make an animation Menu

Postby PunK™95 » Sat Oct 08, 2011 4:33 am

That can come in handy in my menu mod> tnx bro. :clap:
PunK95
ZurePitchmen83
Posts: 158
Joined: Mon Jul 30, 2012 9:18 am
Location: USA
Contact:

Re: [THUG2][PC] How to make an animation Menu

Postby ZurePitchmen83 » Fri Oct 12, 2012 11:40 pm

This worked for me, but i can't add another animation to a menu, when i try to, the game freezes :( , how can i put more than 1 animation to a menu properly?
THPS4 Level Expansion Pack, THUG2 710 Mod 1.0
Modding and Model ripping since 2009
WhoElseButMe
Posts: 416
Joined: Tue Aug 04, 2009 12:50 am
Location: FL - USA
Contact:

Re: [THUG2][PC] How to make an animation Menu

Postby WhoElseButMe » Sat Oct 13, 2012 2:51 am

Need more details about your code
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: [THUG2][PC] How to make an animation Menu

Postby ZurePitchmen83 » Tue Oct 16, 2012 4:48 am

It's similar to the one in the tut, but this is my attempt

Code: Select all

:i function $anims_menu$
:i call $make_new_themed_scrolling_menu$ arguments
$title$ = %s(14,"Animation Menu")
:i $SetScreenElementProps$:s{
:i $id$ = $sub_menu$
:i $event_handlers$ = :a{:s{call $pad_back$ arguments
$generic_menu_pad_back$$params$ = :s{$callback$ = $create_anteara_menu$:s}:s}
:i :a}
:i $replace_handlers$
:i :s}
:i call $theme_menu_add_item$ arguments
$text$ = %s(7,"Blocker")$pad_choose_script$ = $Anim_01$$no_bg$$centered$ = $centered$
:i call $theme_menu_add_item$ arguments
$text$ = %s(5,"Panic")$pad_choose_script$ = $Anim_02$$no_bg$$centered$ = $centered$
:i call $theme_menu_add_item$ arguments
$text$ = %s(4,"Done")$pad_choose_script$ = $create_anteara_menu$$no_bg$$centered$ = $centered$
:i $finish_themed_scrolling_menu$
:i endfunction
:i function $Anim_01$
:i $exit_pause_menu$
:i $Skater$.call $PlayAnim$ arguments
$Anim$ = $Ped_Blocker_BlockA_idle$$cycle$$NoRestart$
:i endfunction
:i function $Anim_02$
:i $exit_pause_menu$
:i $Skater$.call $PlayAnim$ arguments
$Anim$ = $Ped_GermanCop_Panic$$cycle$$NoRestart$
:i endfunction
:i function $anteara_starwars$
:i $exit_pause_menu$
:i $Skater$.call $PlayAnim$ arguments
$Anim$ = $PED_Starwarskid_clip01$
:i $Skater$.$WaitAnimFinished$
:i $Skater$.call $PlayAnim$ arguments
$Anim$ = $PED_Starwarskid_clip02$
:i $Skater$.$WaitAnimFinished$
:i endfunction

I tried the level that was specific to the anim (Berlin) and yet it doesn't work, it just freezes, no matter which level i play in, why? :help
THPS4 Level Expansion Pack, THUG2 710 Mod 1.0
Modding and Model ripping since 2009

Return to “Tutorials”

Who is online

Users browsing this forum: Google [Bot] and 2 guests