the cutting room mirror

Tony Hawk's Pro Skater 4 (PlayStation 2, Xbox, GameCube, Windows)

Debug Mode#

THPS4PS2-debugmenu1.png THPS4PS2-debugmenu2.png

Having debug mode will enable extra menu options, mainly in the pause menu and in the options menu. This puts Debug Menu and Goto Restart in the root of the pause menu. Inside the Options menu , this also puts Cheats: DO NOT TEST.

Goto Restart allows selection of spawn points to spawn from.

Many of the debug functions require additional RAM, and will crash or do nothing on a standard console. The game has a value (Config::gGotExtraMemory) which needs to be true for the game to use additional RAM.

USA code:

Enable Debug Mode
D095D520 00007300
202CE720 00000001

Use 128MB of RAM
002CE71C 00000001

(Source: Original TCRF research)

Debug Menu#

THPS4PS2-debugmenu1-1.png THPS4PS2-debugmenu1-2.png THPS4PS2-debugmenu1-3.png

Text

Effect

View Models

Would allow viewing of models, but doesn't appear to work.

Create a Skater

Edit the current skater.

Set Pro Skater

Changes the current player.

Menu Test

Displays a test menu.

Toggle Profiler

Unknown.

Start Autotest

Game cycles through each level. Each goal is started and completed.

Stop Autotest

Stops the autotest mode.

Dump Memcard Screenshots

Unknown.

Wireframe Toggle

Cycles through several wireframe modes.

Show Vert Polys

Only shows vert wireframes.

Show Wallride Polys

Only shows wallride wireframes.

Show Trigger Polys

Only shows trigger wireframes.

Show Camera Polys

Only shows camera wireframes.

Show Not Skateable

Only shows non-skateable wireframes

Show skater shadow

Only shows wireframes around some specific objects - not sure what criteria is.

Show no skater shadow

Only shows wireframes around some specific objects - not sure what criteria is.

Show no skater shadow wall

Only shows wireframes around some specific objects - not sure what criteria is.

CheckForHoles (Slow)

Pauses game, presumably to check for holes in level geometry.

Rail Display Toggle

Toggles debug markers on skatable objects.

Keyboard

Opens the keyboard display.

Screensaver

Only appears on College, shows bootstrap/demo menu.

Statistics Test

Shows a test statistics screen.

Secrets Test

Shows the secrets menu.

Cheats: DO NOT TEST#

Contains quick unlock options and level up options, as well as adding points to your score.

Select Shift#

Using the following code (for the USA PS2 release) will enable commands activated by holding Select and another button. An additional code is required to enable writing screenshots to the memory card.

Enable Select Button Combos
201e7a70 00000000
201e7150 00000000

Enable MemCard Screenshots
201b79d0 00000000
201b7a08 00000000
2016f338 00000000

Button Combo

Effect

Select + Cross

Toggles fixed camera

Select + Triangle

Toggles wireframe

Select + Square

Save screenshot to Memory Card 1

Select + Circle

Reloads current level

Unused Code#

Tony Hawk's Pro Skater 4's script files (in Neversoft's proprietary *.qb format) contain unused code.

Intro Skip#

If the skip_intro value is set to 1 in a *.qb script, the game will skip Atiba Jefferson's intro when first playing Career Mode.

This may be a debugging or demo leftover.

Early Debug Menu#

To do:
Is there a way that this code can be run, either in Pro Skater 3 or Pro Skater 4?

debugmenu.qb contains code for a debug menu which more closely resembles the Pro Skater 3 debug menu, rather than the Pro Skater 4 debug menu.

Empty Script Files#

Some of the game's script files contain no code.

Most of these have identical filenames to scripts from Tony Hawk's Pro Skater 3. Some had code in the PS2 demo build but were emptied before the retail builds.

Filename

Notes

Appears in Pro Skater 3?

Has code in PS2 demo?

AJC_Scripts.qb

✔

BDJ_Scripts.qb

✔

casmenu_old.qb

Named casmenu.qb in THPS3

✔

✔

casnames.qb

✔

✔

Comp_Scripts.qb

✔

✔

goal_manager.qb

GOAL_Scripts.qb

✔

✔

goal_secret_tape.qb

The secret tape appeared as a collectible in the PS2 demo, although the file is empty in the demo too.

iniskater.qb

✔

iniskater_f.qb

✔

✔

iniskater_secret.qb

✔

✔

iniskater_shared.qb

✔

iniskater_team.qb

✔

JKU_Scripts.qb

✔

✔

JS_Scripts.qb

✔

✔

level_goals_sch.qb

sch is used to refer to College internally

mainmenu.qb

✔

NewScreenElementTest.qb

sk4_PedImpress.qb

N/A

sk4_PedSecretReact.qb

N/A

tagsdb.qb

teamcheat.qb

✔

✔

Tutorials.qb

✔

✔

Previously Undocumented Cheat Codes#

While a handful of cheat codes were officially published for the game, the game's internal scripts actually contain definitions for many more. These cheat code definitions are stored as hashed values (iteratively hashed using CRC32), meaning they cannot be trivially decoded. Through brute-forcing possible strings, several additional cheat codes were discovered in the scripts that were never published in cheat books or official guides.

Cheat Identifier

PS2 Cheat Code

Xbox Cheat Code

GameCube Cheat Code

unlock_all_cheats

???

???

???

cheat_unlock_always_special

doasuper

i'myellow

g0lden

cheat_unlock_perfect_rail

ssbsts

belikeeric

???

cheat_unlock_perfect_skitch

???

bumperrub

???

cheat_unlock_stats_13

4nitwits

4p0sers

???

cheat_unlock_perfect_manual

mullenpower

???

2wheelin

cheat_unlock_moon_grav

superfly

moon$hot

giantsteps

cheat_unlock_matrix

nospoon

fbiagent

mrandersen

cheat_unlock_inline

???

???

???

give_50_stat_points

???

???

50reps

cheat_unlockmovies

cutcutcut

???

???

unlock_all_cheat_codes

???

moronsrus

???

cheat_give_skaters

homielist

homiesrus

???

cheat_reallygivelevels

???

???

???

GoPro

???

???

???

cheat_give_jenna

(o)(o)

(o)(o)

(o)(o)

Unused Graphics#

THPS 3 Leftovers#

All of the placeholder and joke images from the previous game are present here.

Xbox Save Icons#

Save icons from the Xbox version.

Test Fonts#

Test fonts, one of which spells out "Tony Hawks Pro Skater" in various fonts.

Unused Level#

To do:
Files are present in the console ports - can it be enabled in those?

There is an unused level called MotoX.

In the Windows version, it can be accessed by enabling the menu item for it through script modification, or by installing a mod such as THPS4 Level Expansion Pack. It consists of a few structures and a winding dirt track that is skateable in the street luge mode. It uses the background from Alcatraz.

Unused Text#

Scattered in the SLUS file are some developer notes.

aah ha! would have caused the crash!!!

**********************************************
*                                            *
*  Tell Mike if you see this line printing!  *


Checking for unvelded verts in object with %d verts
Found one, at dist %f,m check the magenta lines
Then Checking for holes in object with %d faces

Tell Matt Music buffer didn't load on time -- must increase IOP streaming buf 

size. Status %x
Tell Matt stream buffer didn't load on time -- must increase IOP streaming buf 

size. Status %x

(Hey, don't use GetTypeName on the CD!)

calling Mike test
DONE calling Mike test

Along with a couple of strings referencing a demo version.

Tony Hawk's Pro Skater 4 - Demo Disk Version

******  Exiting THPS Demo *****

Uncompiled Scripts#

Present only in the Japanese release are 44 extra files in the scripts folder with a BAK extension.

autotest.BAK
boardshop.BAK
cash_icons.BAK
cas_logos.BAK
colormenu.BAK
CPF_Scripts.BAK
decks.BAK
dialogbox.BAK
edit_tricks_menu.BAK
EdPieces.BAK
EdPieces2.BAK
gameflow.BAK
gamemenu.BAK
gamemode.BAK
gameoptions.BAK
game_progress_menu.BAK
goal_competition.BAK
goal_countercombo.BAK
goal_horse.BAK
goal_scores.BAK
goal_utilities.BAK
groundtricks.BAK
helper_text.BAK
keyboard.BAK
Levels.BAK
memcard.BAK
memcardmessages.BAK
MenuButtonRemap.BAK
minigame_pong.BAK
minigame_timedcombo.BAK
minigame_utilities.BAK
net.BAK
panelmessage.BAK
panelstuff.BAK
park_ed.BAK
pro_anims.BAK
pushmode.BAK
replay.BAK
secrets_menu.BAK
skateshop.BAK
skutils.BAK
startup.BAK
tricks.BAK
trick_attack.BAK

Opening these with a text editor reveals that they are actually uncompiled q script files. One can even discover leftover THPS3 related scripts in some files.

CPF Scripts#

This lengthy file contains level scripts for several THPS3 and THPS4 stages.

CPF_Scripts.BAK

// set up levels

// -------------------Begin goal cam setup and scripts section--------------------

/*
Script CPF_AP_Scripted1Start
Create name=TRG_Ped_Family03
Create name=TRG_Ped_Family05
Create name=Tickets
StopStream
PlayStream Random (
    @AP_FamIntro01
    @AP_FamIntro02
    @AP_FamIntro03
) 
Endscript

Script CPF_AP_Scripted1End
Kill name=TRG_Ped_Family03
Kill name=TRG_Ped_Family05
Kill name=Tickets
Endscript

Script CPF_AP_Scripted1CompleteStart
StopStream
PlayStream AP_FamOutro 
Endscript

Script CPF_AP_Scripted1CompleteEnd
StopStream
PlayStream AP_jetrev
Endscript

Script CPF_AP_Scripted2Start
Kill prefix="EO_Chopper"
Kill prefix = "TRG_Ped_CutsceneTerrorist"
Create prefix = "TRG_Ped_CutsceneTerrorist"
Create name=EO_Chopper01
Create name=EO_Chopper01a
Create name=EO_Chopper01b
Create name=EO_Chopper03
Create name=GO_Chopper02
Create name=GO_Chopper02a
StopStream
PlaySound terror_theme Vol=100
PlayStream Helioff
Wait 1 second
PlayStream Random (
//    @AP_TerIntro01
    @AP_TerIntro02
    @AP_TerIntro03
    @AP_TerIntro04
    ) 
Endscript

Script CPF_AP_Scripted2CompleteStart
Kill prefix="TRG_Ped_Terrorist"
Create prefix = "TRG_Ped_Cutscene2Terrorist"
StopStream
PlayStream AP_TerOutro01 
Endscript

Script CPF_AP_CreateAll
    Create prefix = "StartArea"
    Create prefix = "StartMidArea"
    Create prefix = "StartMidReflec"
    Create prefix = "LowArea"
    Create prefix = "MidArea"
    Create prefix = "MidReflec"
    Create prefix = "MidEndArea"
    Create prefix = "EndCorner"
    Create prefix = "EndArea"
    if GetGoal goal=GOAL_SCRIPTED2
//        Create name = ScrollSign_Done
    Else
//        Create name = ScrollSign_Start
    Endif
    if InMultiplayerGame
        Kill prefix="TRGP_EndArea_Flag_"
    Endif
    InVisible prefix="Windowshine"
Endscript

Script CPF_AP_GoalStartScript
    CPF_AP_CreateAll
    Visible prefix = "StartArea"
    Visible prefix = "StartMidArea"
    Visible prefix = "StartMidReflec"
    Visible prefix = "LowArea"
    Visible prefix = "MidArea"
    Visible prefix = "MidReflec"
    Visible prefix = "MidEndArea"
    Visible prefix = "EndCorner"
    Visible prefix = "EndArea"
    Kill prefix = "TRG_Ped_CutsceneTerrorist"
    Create name = Random (@TRG_Plane_Jet @TRG_Plane_Small @TRG_Plane_Small01)
;    Create name = TRG_Plane_Jet
;    Create name = TRG_Plane_Small
;    Create name = TRG_Plane_Small01
;    Create name = TRG_Tanker01
;    Create name = TRG_Tanker02
    if GetGoal goal=GOAL_SCRIPTED2
    Else
        Create prefix = "GO_Intro_Chopper"
    Endif
Endscript

Script CPF_AP_GoalCompleteStartScript
    CPF_AP_CreateAll
    Visible prefix = "StartArea"
    Visible prefix = "StartMidArea"
    Visible prefix = "StartMidReflec"
    Visible prefix = "LowArea"
    Visible prefix = "MidArea"
    Visible prefix = "MidReflec"
    Visible prefix = "MidEndArea"
    Visible prefix = "EndCorner"
    Visible prefix = "EndArea"
Endscript

Script CPF_AP_GoalEndScript
//    Kill prefix = "MidArea_"
//    Kill prefix = "MidReflec_"
//    Kill prefix = "EndArea_"
//    Kill prefix = "LowArea_"
if GetGoal goal = GOAL_SCRIPTED2
    Else
    Kill prefix="TRG_Ped_CutsceneTerrorist"
    Kill name=EO_Chopper01
    Kill name=EO_Chopper01a
    Kill name=EO_Chopper01b
    Kill name=EO_Chopper03
    Kill name=GO_Chopper02
    Kill name=GO_Chopper02a
Endif
Endscript

LosAngelesGoalParams = {
// game type scripts
Goal_Start_Script           = CPF_LA_GoalStartScript// stuff to happen at the start of the goals stuff
Goal_Complete_Start_Script  = CPF_LA_GoalCompleteStartScript// stuff to happen at the start of the goals stuff
NetPlayScript               = NullScript            // stuff to happen in a net game
CareerPlayScript            = NullScript            // stuff to happen in a career game
// goal camera names
CameraStart                 = "Cam_Goals"           // camera at start of intro movies
CameraTape                  = "Cam_Goal_04"         // camera for secret tape
CameraTrickspotVert         = "Cam_Goal_05vert"     // camera for vert trickspot
CameraTrickspotVertComplete = "Cam_Goal_Complete_05vert"     // camera for vert trickspot
CameraTrickspotStreet       = "Cam_Goal_05street"   // camera for street trickspot
CameraTrickspotStreetComplete="Cam_Goal_Complete_05street"   // camera for street trickspot
CameraScripted1             = "Cam_Goal_06"         // camera for scripted1 goal
CameraScripted1Complete     = "Cam_Goal_Complete_06"// end camera for scripted1 goal
CameraScripted2             = "Cam_Goal_07"         // camera for scripted2 goal
CameraScripted2Complete     = "Cam_Thieves2"// end camera for scripted2 goal
CameraScripted3             = "Cam_Goal_08"         // camera for scripted3 goal
// goal text
Goal_HighScore_Text         = "Get a HIGH SCORE:| 125,000 Points"
Goal_ProScore_Text          = "Get a PRO SCORE:| 250,000 Points"
Goal_SickScore_Text         = "Get a SICK SCORE:| 500,000 Points"
Goal_SKATE_Text             = "Collect S-K-A-T-E"
Goal_Tape_Text              = "Get the Secret Tape"
Goal_TrickspotStreet_Text   = "Varial Kickflip the| Tower Rails Gap"
Goal_TrickspotVert_Text     = "One Foot Japan the| Tower Poppin' Transfer"
Goal_Scripted1_Text         = "Start the Earthquake"
Goal_Scripted2_Text         = "Block the Car Chase"
Goal_Scripted3_Text         = "Free Ballin'"
// goal pre- and post- run scripts
Goal_Trickspot_VertAnimName = OneFootJapan
Goal_Trickspot_VertAnimFrame1 = 22
Goal_Trickspot_VertAnimFrame2 = 33
Goal_Trickspot_VertAnimFrame3 = 44
Goal_Trickspot_StreetAnimName = VarialKickflip
Goal_Trickspot_StreetAnimFrame1 = 3
Goal_Trickspot_StreetAnimFrame2 = 13
Goal_Trickspot_StreetAnimFrame3 = 23
Goal_Scripted1_Start_Script             = CPF_LA_Scripted1Start // for stuff you want to do before showing the scripted1 goal
Goal_Scripted1_End_Script               = CPF_LA_Scripted1End   // for stuff you want to do after showing the scripted1 goal
Goal_Scripted1_Complete_Start_Script    = CPF_LA_Scripted1CompleteStart // for stuff you want to do before showing the scripted1 goal
Goal_Scripted1_Complete_End_Script      = CPF_LA_Scripted1CompleteEnd   // for stuff you want to do after showing the scripted1 goal
Goal_Scripted2_Start_Script             = CPF_LA_Scripted2Start // for stuff you want to do before showing the scripted1 goal
Goal_Scripted2_Complete_Start_Script    = CPF_StopThieves2 // for stuff you want to do before showing the scripted1 goal
Goal_End_Script                         = CPF_LA_GoalEndScript  // for stuff you want to do after everything
Goal_Complete_End_Script                = CPF_LA_GoalEndScript  // for stuff you want to do after everything
}

Script CPF_LA_Scripted1Start
Endscript

Script CPF_LA_Scripted1End
Endscript

Script CPF_LA_Scripted1CompleteStart
Endscript

Script CPF_LA_Scripted1CompleteEnd
Endscript

Script CPF_LA_Scripted2Start
Kill prefix = "TRG_Looter_Car"
Kill prefix = "TRG_Police_Car"
Create name = TRG_Looter_Car
Create name = TRG_Police_Car01
Create name = TRG_Police_Car02
PlaySound la_gunshots2 Vol=150 pitch = 95
Wait 5 frames
// PlayStream la_auto_peelout vol = 200
PlaySound la_auto_peelout vol = 200
//SetSkaterCamAnimSkippable skater=0 skippable=1
PlaySound la_gunshots2 Vol=120 pitch = 120
PlaySound random (@ambulance2nl @ambulance3nl) Vol=50 
Endscript

Script CPF_LA_Scripted2CompleteStart
Endscript

Script CPF_LA_GoalStartScript
if IsCareerMode
    if GetGoal goal = GOAL_SCRIPTED1
        CPF_LA_StartWithQuakeDamage
    Endif    
Endif
Endscript

Script CPF_LA_GoalCompleteStartScript
if GetGoal goal = GOAL_SCRIPTED1
    KillSpawnedScript id=quakescript
    CPF_LA_StartWithQuakeDamage
Endif
Endscript

Script CPF_LA_GoalEndScript
Kill prefix = "TRG_CarOverpass"
//Kill name = TRG_Goal_Looter_Police
//Kill name = TRG_Goal_Looter_Van
Endscript


// -------------------End goal cam setup and scripts section--------------------

// flags
Script CPF_AP_LoadingScript
//printf " ||||||||||||||||||||||||||||||| Loading Script"
// SetUpSkaterDefaults
// Setting High and Pro scores
// Checking to create SKATE Letters---------------------------
CreateSkateLines
// Checking to create Deck Icon---------------------------
// CreateDeckIcon
// Checking to create Secret Tape---------------------------
CreateSecretTape
// Checking to create Trick Points---------------------------
// CreateTrickPoints
if IsCareerMode
    if GetGoal goal = GOAL_SCRIPTED1
    Else    
        Create name=TRG_GO_GotTicket
        Create name=Tickets
    Endif
    if GetGoal goal = GOAL_SCRIPTED2
    Else    
        if QueryFlag AP_TERRORIST_01 name=TRG_GO_TerroristCounter
        Else    
            Create name=TRG_Ped_Terrorist01
        Endif
        if QueryFlag AP_TERRORIST_05 name=TRG_GO_TerroristCounter
        Else    
            Create name=TRG_Ped_Terrorist05
        Endif
    Endif
    Kill prefix="TRG_Ped_CutsceneTerrorist"
Endif
if InMultiplayerGame
    Kill prefix="TRGP_EndArea_Flag_"
Else
    Create prefix="TRG_Ped_StartArea_"
    Create prefix="TRG_Ped_StartMid"
    Create name=EO_Chopper01
    Create name=EO_Chopper01a
    Create name=EO_Chopper01b
    Create name=EO_Chopper03
    Create name=EO_Chopper02
    Create name=EO_Chopper02a
    Create name=EO_Chopper04
    Create prefix="TRG_RailChopper"
Endif
//    CPF_AP_BeginAt_StartArea
KillSpawnedScript id=AP_Sounds
wait 1 frame
SpawnScript CPF_AP_Sounds id=AP_Sounds
endscript

Script CPF_AP_BeginAt_StartArea
//printf " ||||||||||||||||||||||||||||||| Start Area"
CPF_AP_CreateAll
Visible prefix = "StartArea"
Visible prefix = "StartMidArea"
Visible prefix = "StartMidReflec"
Invisible prefix = "LowArea"
Visible prefix = "MidArea"
Invisible prefix = "MidReflec"
Invisible prefix = "MidEndArea"
Invisible prefix = "EndCorner"
Invisible prefix = "EndArea"
Endscript

Script CPF_AP_BeginAt_StartMidArea
//printf " ||||||||||||||||||||||||||||||| Start Mid Area"
CPF_AP_CreateAll
Visible prefix = "StartArea"
Visible prefix = "StartMidArea"
Visible prefix = "StartMidReflec"
Visible prefix = "LowArea"
Visible prefix = "MidArea"
Visible prefix = "MidReflec"
Visible prefix = "MidEndArea"
Visible prefix = "EndCorner"
Invisible prefix = "EndArea"
Endscript

Script CPF_AP_BeginAt_LowArea
//printf " ||||||||||||||||||||||||||||||| Low Area"
CPF_AP_CreateAll
Invisible prefix = "StartArea"
Visible prefix = "StartMidArea"
Invisible prefix = "StartMidReflec"
Visible prefix = "LowArea"
Visible prefix = "MidArea"
Visible prefix = "MidReflec"
Visible prefix = "MidEndArea"
Visible prefix = "EndCorner"
Invisible prefix = "EndArea"
Endscript

Script CPF_AP_BeginAt_MidArea
//printf " ||||||||||||||||||||||||||||||| Mid Area"
CPF_AP_CreateAll
Invisible prefix = "StartArea"
Visible prefix = "StartMidArea"
Visible prefix = "StartMidReflec"
Visible prefix = "LowArea"
Visible prefix = "MidArea"
Visible prefix = "MidReflec"
Visible prefix = "MidEndArea"
Visible prefix = "EndCorner"
Invisible prefix = "EndArea"
Endscript

Script CPF_AP_BeginAt_MidEndArea
//printf " ||||||||||||||||||||||||||||||| Mid End Area"
CPF_AP_CreateAll
Invisible prefix = "StartArea"
Visible prefix = "StartMidArea"
Invisible prefix = "StartMidReflec"
Visible prefix = "LowArea"
Visible prefix = "MidArea"
Visible prefix = "MidReflec"
Visible prefix = "MidEndArea"
Visible prefix = "EndCorner"
Visible prefix = "EndArea"
Endscript

Script CPF_AP_BeginAt_EndArea
//printf " ||||||||||||||||||||||||||||||| End Area"
CPF_AP_CreateAll
Invisible prefix = "StartArea"
Invisible prefix = "StartMidArea"
Invisible prefix = "StartMidReflec"
Invisible prefix = "LowArea"
Invisible prefix = "MidArea"
Invisible prefix = "MidReflec"
Visible prefix = "MidEndArea"
Visible prefix = "EndCorner"
Visible prefix = "EndArea"
Endscript

Script CPF_AP_BeginAt_ShowAll
//printf " ||||||||||||||||||||||||||||||| Showing Whole level"
CPF_AP_CreateAll
Visible prefix = "StartArea"
Visible prefix = "StartMidArea"
Visible prefix = "StartMidReflec"
Visible prefix = "LowArea"
Visible prefix = "MidArea"
Visible prefix = "MidReflec"
Visible prefix = "MidEndArea"
Visible prefix = "EndCorner"
Visible prefix = "EndArea"
Endscript

Script CPF_LA_LoadingScript
// Setting up goals based on Skaters...
//printf "doing restart node stuff---------------------------------------------"
KillSpawnedScript id=quakescript
SetParticleSysVisibility system="Qke_Particle02" visible=0
SetParticleSysVisibility system="Qke_Particle03" visible=0
SetParticleSysVisibility system="Qke_Particle04" visible=0
SetParticleSysVisibility system="Qke_Particle05" visible=0
SetParticleSysVisibility system="Qke_Particle06" visible=0
SetParticleSysVisibility system="Qke_Particle07" visible=0
SetParticleSysVisibility system="Qke_Particle08" visible=0
SetParticleSysVisibility system="Qke_Particle09" visible=0
SetParticleSysVisibility system="Qke_Particle10" visible=0
SetParticleSysVisibility system="Qke_Particle11" visible=0
SetParticleSysVisibility system="Qke_Particle12" visible=0
SetParticleSysVisibility system="Qke_Particle13" visible=0
SetParticleSysVisibility system="Qke_Particle14" visible=0
SetParticleSysVisibility system="Qke_Particle15" visible=0
SetParticleSysVisibility system="Qke_Particle16" visible=0
SetParticleSysVisibility system="Qke_Particle17" visible=0
StopStream
// SetUpSkaterDefaults
// Setting High and Pro scores
// Checking to create SKATE Letters---------------------------
CreateSkateLines
// Checking to create Deck Icon---------------------------
// CreateDeckIcon
// Checking to create Secret Tape---------------------------
CreateSecretTape
// Checking to create Trick Points---------------------------
// CreateTrickPoints
SetParticleSysVisibility system="Qke_Particle01" visible=0
SetParticleSysVisibility system="NExtParticle_Puke" visible=0
UnPauseSkaters 
Kill name = TRG_Looter_Car
Kill name = TRG_Police_Car01
Kill name = TRG_Police_Car02
If GotParam DropIn
    MakeSkaterGoto DropIn
Endif
// Checking to create Quake Rubble and Triggers-----------
if IsCareerMode
    if GetGoal goal = GOAL_SCRIPTED1
        CPF_LA_StartWithQuakeDamage
    Endif    
// Checking to create Thieves car and police cars-----------
    if GetGoal goal = GOAL_SCRIPTED2
        Kill name = TRG_Rail_KenCar
        Kill name = TRGP_CarFall_E
        Kill name = TRGP_CarFall_W
        Kill name = FallingSign
        Kill name = Overpass_Car_Rocking
    Else                            
        Create name = TRG_Looter_Car
        Create name = TRG_Police_Car01
        Create name = TRG_Police_Car02
    Endif
Else                            
    if InMultiplayerGame
        Kill name = TRG_Car_Stop3_01
        Create name = TRG_Car_Stop3_03
    Else    
        if GetFlag flag=LA_QUAKE_DONE
//            LaunchConsoleMessage "Quake started"
            CPF_LA_StartWithQuakeDamage
        Endif
    Endif
Endif
if InMultiplayerGame
//    Kill name = TRGP_NorthTremor_E
//    Kill name = TRGP_NorthTremor_W
//    Kill name = TRGP_SouthTremor_E
//    Kill name = TRGP_SouthTremor_W
//    Kill name = TRGP_EastTremor_N
//    Kill name = TRGP_EastTremor_S
//    Kill name = TRGP_WestTremor_N
//    Kill name = TRGP_WestTremor_S
//    Create name = TRGP_NorthTremor_E01
//    Create name = TRGP_NorthTremor_W01
//    Create name = TRGP_SouthTremor_E01
//    Create name = TRGP_SouthTremor_W01
//    Create name = TRGP_EastTremor_N01
//    Create name = TRGP_EastTremor_S01
//    Create name = TRGP_WestTremor_N01
//    Create name = TRGP_WestTremor_S01
Else
    Create prefix = "Tall_Cone"
    Create prefix = "TRGP_GarbageCreator"
Endif
endscript

Script CPF_LA_StartWithQuakeDamage
    Kill name = TRGP_NorthTremor_E
    Kill name = TRGP_NorthTremor_W
    Kill name = TRGP_SouthTremor_E
    Kill name = TRGP_SouthTremor_W
    Kill name = TRGP_EastTremor_N
    Kill name = TRGP_EastTremor_S
    Kill name = TRGP_WestTremor_N
    Kill name = TRGP_WestTremor_S
    Create name = TRG_SignGetToRail
    Create name = TRGP_NorthTremor_E01
    Create name = TRGP_NorthTremor_W01
    Create name = TRGP_SouthTremor_E01
    Create name = TRGP_SouthTremor_W01
    Create name = TRGP_EastTremor_N01
    Create name = TRGP_EastTremor_S01
    Create name = TRGP_WestTremor_N01
    Create name = TRGP_WestTremor_S01
    Kill prefix = "TRG_RailGoodOverpass"
    Kill prefix = "TRG_CarOverpass"
    Kill prefix = "TRGP_Over_Car"
    Kill name = Overpass_Car_Rocking
    Kill prefix = "TRGP_Overpass_Killer"
    Kill prefix = "Overpass_Good"
    Kill prefix = "carwash_good_"
    Create prefix = "carwash_destroyed_"
    Create prefix = "Rubble01_"
    Create prefix = "Rubble02_"
    Create prefix = "Overpass_Destroyed"
    Create prefix = "TRG_Rail_Overpass"
    if IsCareerMode
        Create name = Overpass_Car_Rocking
        Create name = TRG_Rail_KenCar
        Create name = TRGP_CarFall_E
        Create name = TRGP_CarFall_W
        if GetGoal goal = GOAL_SCRIPTED2
            Kill prefix = "Overpass_Car_Rock"
        Endif    
    Endif
Endscript

Script CPF_LA_StartScript
if InMultiplayerGame
//    Kill name = TRGP_NorthTremor_E
//    Kill name = TRGP_NorthTremor_W
//    Kill name = TRGP_SouthTremor_E
//    Kill name = TRGP_SouthTremor_W
//    Kill name = TRGP_EastTremor_N
//    Kill name = TRGP_EastTremor_S
//    Kill name = TRGP_WestTremor_N
//    Kill name = TRGP_WestTremor_S
//    Create name = TRGP_NorthTremor_E01
//    Create name = TRGP_NorthTremor_W01
//    Create name = TRGP_SouthTremor_E01
//    Create name = TRGP_SouthTremor_W01
//    Create name = TRGP_EastTremor_N01
//    Create name = TRGP_EastTremor_S01
//    Create name = TRGP_WestTremor_N01
//    Create name = TRGP_WestTremor_S01
    else
    Create prefix = "Tall_Cone"
    Create prefix = "TRGP_GarbageCreator"
Endif
Endscript

Script CPF_LA_OverpassLoadingScript
if Obj_FlagSet GOAL_6_COMPLETE
else                            
    Kill prefix = "TRG_CarOverpass"
    Create prefix = "TRG_CarOverpass"
endif
Endscript

script Ap_Startup
LoadStreamHeader "streams\ap\streams"
LoadSound "Shared\Auto\CarLoop" vol = 50 dropoff = 150 PosUpdateWithDoppler 
LoadSound "Shared\Goals\GapSound" vol = 100 dropoff = 0   
LoadSound "Shared\Goals\GoalDone" vol = 100 dropoff = 0   
LoadSound "Shared\Hits\HitGlassPane2x" vol = 100 dropoff = 100   
LoadSound "Shared\Water\Flush2_11" vol = 100 dropoff = 0
LoadSound "ap\ap_scanner" vol = 100 dropoff = 0   
LoadSound "ap\ap_dryer" vol = 100 dropoff = 0 posupdate
LoadSound "ap\helicopter15" vol = 100 dropoff = 500 posupdatewithdoppler
LoadSound "ap\ap_escalator" vol = 100 dropoff = 200 posupdate
LoadSound "ap\ap_sink" vol = 100 dropoff = 200 posupdate
LoadSound "ap\ap_ripflag" vol = 100 dropoff = 200 posupdatewithdoppler
LoadSound "ap\ap_phone" vol = 300 dropoff = 200
LoadSound "Shared\Human\CPFSecurity_11" vol = 100 dropoff = 0
LoadSound "Shared\Misc\CPFheli" vol = 100 dropoff = 0
LoadSound "Shared\Misc\CPFjet_11" vol = 100 dropoff = 0
LoadSound "la\la_gunshots2" vol = 100 dropoff = 100
LoadSound "la\la_carwash_brushes1" vol = 100 dropoff = 100   posupdate
LoadSound "ap\terror_theme" vol = 100 dropoff = 100   
LoadSound "Shared\Auto\CarHorn_11" vol = 100 dropoff = 150   
LoadSound "ap\ap_baggage" vol = 400 dropoff = 75    posupdate
LoadSound "ap\ap_prop" vol = 600 dropoff = 700    posupdatewithdoppler
LoadSound "ap\ap_jetidle" vol = 100 dropoff = 600    posupdatewithdoppler
LoadSound "ap\ap_jetland" vol = 500 dropoff = 350   
LoadSound "ap\ap_beep" posupdatewithdoppler
LoadSound "ap\ap_phone2"
// ped vo
//LoadSound "la\la_vo_approach1_cr"  vol = 100 dropoff = 0   
//LoadSound "la\la_vo_approach2_cr"  vol = 100 dropoff = 0   
//LoadSound "la\la_vo_approach3_cr"  vol = 100 dropoff = 0   
//LoadSound "la\la_vo_approach4_cr"  vol = 100 dropoff = 0   
//LoadSound "la\la_vo_avoid1a_cr"  vol = 100 dropoff = 0   
//LoadSound "la\la_vo_avoid1b_cr"  vol = 100 dropoff = 0   
//LoadSound "la\la_vo_avoid1c_cr"  vol = 100 dropoff = 0   
//LoadSound "la\la_vo_avoid1d_cr"  vol = 100 dropoff = 0   
////LoadSound "la\la_vo_avoid1e_cr"  vol = 100 dropoff = 0   
////LoadSound "la\la_vo_avoid1f_cr"  vol = 100 dropoff = 0   
////LoadSound "la\la_vo_avoid1g_cr"  vol = 100 dropoff = 0   
//LoadSound "la\la_vo_avoid2a_cr"  vol = 100 dropoff = 0   
////LoadSound "la\la_vo_avoid2b_cr"  vol = 100 dropoff = 0   
//LoadSound "la\la_vo_avoid2c_cr"  vol = 100 dropoff = 0   
//LadSound "la\la_vo_avoid2d_cr"  vol = 100 dropoff = 0   
////LoadSound "la\la_vo_avoid2e_cr"  vol = 100 dropoff = 0   
//LoadSound "la\la_vo_avoid3a_cr"  vol = 100 dropoff = 0   
//LoadSound "la\la_vo_avoid3b_cr"  vol = 100 dropoff = 0   
//LoadSound "la\la_vo_avoid3c_cr"  vol = 100 dropoff = 0   
//LoadSound "la\la_vo_avoid3d_cr"  vol = 100 dropoff = 0   
////LoadSound "la\la_vo_avoid3e_cr"  vol = 100 dropoff = 0   
////LoadSound "la\la_vo_avoid3f_cr"  vol = 100 dropoff = 0   
//LoadSound "la\la_vo_knock1_cr"  vol = 100 dropoff = 0   
//LoadSound "la\la_vo_knock2_cr"  vol = 100 dropoff = 0   
//LoadSound "la\la_vo_knock3_cr"  vol = 100 dropoff = 0   
//LoadSound "la\la_vo_knock4_cr"  vol = 100 dropoff = 0   
////LoadSound "la\la_vo_knock5_cr"  vol = 100 dropoff = 0   
////LoadSound "la\la_vo_knock6_cr"  vol = 100 dropoff = 0   
endscript

script La_Startup
LoadStreamHeader "streams\la\streams"
LoadSound "Shared\Goals\GapSound" vol = 100 dropoff = 0   
LoadSound "Shared\Goals\GoalDone" vol = 100 dropoff = 0   
LoadSound "Shared\ambulance2nl" vol = 50 dropoff = 100   posupdateWithDoppler
LoadSound "Shared\ambulance3nl" vol = 50 dropoff = 100   posupdateWithDoppler
LoadSound "Shared\Hits\BonkBush" vol = 100 dropoff = 0   
LoadSound "la\LA_quake1_rumble" vol = 1000 dropoff = 0   
LoadSound "Shared\Auto\CarBrakeSqueal" vol = 60 dropoff = 150 PosUpdate
LoadSound "Shared\Auto\CarLoop" vol = 50 dropoff = 150 PosUpdateWithDoppler 
LoadSound "Shared\Auto\Carhorn_11" vol = 100 dropoff = 150   
LoadSound "la\la_auto_peelout" vol = 80 dropoff = 150   
LoadSound "Shared\Human\Looter" vol = 80 dropoff = 150   
LoadSound "Shared\Auto\LA_Skid" vol = 100 dropoff = 150   
//LoadSound "Shared\Human\LA_Police_11" vol = 100 dropoff = 0   
LoadSound "la\la_fire" vol = 100 dropoff = 100    posupdateWithDoppler
LoadSound "la\la_paper" vol = 200 dropoff = 100    posupdateWithDoppler
LoadSound "la\la_porn_no_sex" vol = 100 dropoff = 100    posupdateWithDoppler
//LoadSound "la\la_porn_sex_only" vol = 100 dropoff = 100    posupdateWithDoppler
//LoadSound "Shared\Human\KenHelp1" vol = 150 dropoff = 150    posupdate
//LoadSound "Shared\Human\KenHelp2" vol = 150 dropoff = 150    posupdate
//LoadSound "Shared\Human\KenHelp3" vol = 150 dropoff = 150    posupdate
//LoadSound "Shared\Human\KenHelp4" vol = 150 dropoff = 150    posupdate
LoadSound "la\la_gunshots2" vol = 100 dropoff = 100   
LoadSound "Shared\Misc\LA_GratesOpen" vol = 100 dropoff = 100   
LoadSound "Shared\Misc\Ricco1_11" vol = 100 dropoff = 100   
LoadSound "Shared\Misc\Ricco2_11" vol = 100 dropoff = 100   
LoadSound "Shared\Auto\LowriderLoop" vol = 100 dropoff = 100    posupdate
LoadSound "Shared\Hits\HitGlassPane2x" vol = 100 dropoff = 100   
LoadSound "la\la_carwash_brushes1" vol = 100 dropoff = 100    posupdatewithdoppler
LoadSound "la\la_hitcone" vol = 100 dropoff = 100    posupdatewithdoppler
LoadSound "la\la_rebar1" vol = 100 dropoff = 100   
LoadSound "la\la_rebar2" vol = 100 dropoff = 100   
//  Pedestrian VO
//LoadSound "la\la_vo_approach1_cr"  vol = 100 dropoff = 0   
//LoadSound "la\la_vo_approach2_cr"  vol = 100 dropoff = 0   
//LoadSound "la\la_vo_approach3_cr"  vol = 100 dropoff = 0   
//LoadSound "la\la_vo_approach4_cr"  vol = 100 dropoff = 0   
//LoadSound "la\la_vo_avoid1a_cr"  vol = 100 dropoff = 0   
//LoadSound "la\la_vo_avoid1b_cr"  vol = 100 dropoff = 0   
//LoadSound "la\la_vo_avoid1c_cr"  vol = 100 dropoff = 0   
//LoadSound "la\la_vo_avoid1d_cr"  vol = 100 dropoff = 0   
////LoadSound "la\la_vo_avoid1e_cr"  vol = 100 dropoff = 0   
////LoadSound "la\la_vo_avoid1f_cr"  vol = 100 dropoff = 0   
////LoadSound "la\la_vo_avoid1g_cr"  vol = 100 dropoff = 0   
//LoadSound "la\la_vo_avoid2a_cr"  vol = 100 dropoff = 0   
////LoadSound "la\la_vo_avoid2b_cr"  vol = 100 dropoff = 0   
//LoadSound "la\la_vo_avoid2c_cr"  vol = 100 dropoff = 0   
//LoadSound "la\la_vo_avoid2d_cr"  vol = 100 dropoff = 0   
////LoadSound "la\la_vo_avoid2e_cr"  vol = 100 dropoff = 0   
//LoadSound "la\la_vo_avoid3a_cr"  vol = 100 dropoff = 0   
//LoadSound "la\la_vo_avoid3b_cr"  vol = 100 dropoff = 0   
//LoadSound "la\la_vo_avoid3c_cr"  vol = 100 dropoff = 0   
//LoadSound "la\la_vo_avoid3d_cr"  vol = 100 dropoff = 0   
////LoadSound "la\la_vo_avoid3e_cr"  vol = 100 dropoff = 0   
////LoadSound "la\la_vo_avoid3f_cr"  vol = 100 dropoff = 0   
////LoadSound "la\la_vo_bail_over1_cr"  vol = 100 dropoff = 0   
////LoadSound "la\la_vo_bail_over2_cr"  vol = 100 dropoff = 0   
////LoadSound "la\la_vo_bail_over3_cr"  vol = 100 dropoff = 0   
////LoadSound "la\la_vo_bail_over4_cr"  vol = 100 dropoff = 0   
////LoadSound "la\la_vo_bail_over5_cr"  vol = 100 dropoff = 0   
//LoadSound "la\la_vo_bail_under1_cr"  vol = 100 dropoff = 0   
//LoadSound "la\la_vo_bail_under2_cr"  vol = 100 dropoff = 0   
//LoadSound "la\la_vo_bail_under3_cr"  vol = 100 dropoff = 0   
//LoadSound "la\la_vo_bail_under4_cr"  vol = 100 dropoff = 0   
////LoadSound "la\la_vo_bail_under5_cr"  vol = 100 dropoff = 0   
//LoadSound "la\la_vo_entice1_cr"  vol = 100 dropoff = 0   
//LoadSound "la\la_vo_entice2_cr"  vol = 100 dropoff = 0   
//LoadSound "la\la_vo_entice3_cr"  vol = 100 dropoff = 0   
//LoadSound "la\la_vo_entice4_cr"  vol = 100 dropoff = 0   
////LoadSound "la\la_vo_entice5_cr"  vol = 100 dropoff = 0   
//LoadSound "la\la_vo_knock1_cr"  vol = 100 dropoff = 0   
//LoadSound "la\la_vo_knock2_cr"  vol = 100 dropoff = 0   
//LoadSound "la\la_vo_knock3_cr"  vol = 100 dropoff = 0   
//LoadSound "la\la_vo_knock4_cr"  vol = 100 dropoff = 0   
////LoadSound "la\la_vo_knock5_cr"  vol = 100 dropoff = 0   
////LoadSound "la\la_vo_knock6_cr"  vol = 100 dropoff = 0   
//LoadSound "la\la_vo_thresh1_1_cr"  vol = 100 dropoff = 0   
//LoadSound "la\la_vo_thresh1_2_cr"  vol = 100 dropoff = 0   
//LoadSound "la\la_vo_thresh1_3_cr"  vol = 100 dropoff = 0   
//LoadSound "la\la_vo_thresh1_4_cr"  vol = 100 dropoff = 0   
//LoadSound "la\la_vo_thresh1_5_cr"  vol = 100 dropoff = 0   
////LoadSound "la\la_vo_thresh1_6_cr"  vol = 100 dropoff = 0   
////LoadSound "la\la_vo_thresh1_7_cr"  vol = 100 dropoff = 0   
////LoadSound "la\la_vo_thresh1_8_cr"  vol = 100 dropoff = 0   
//LoadSound "la\la_vo_thresh2_1_cr"  vol = 100 dropoff = 0   
//LoadSound "la\la_vo_thresh2_2_cr"  vol = 100 dropoff = 0   
//LoadSound "la\la_vo_thresh2_3_cr"  vol = 100 dropoff = 0   
//LoadSound "la\la_vo_thresh2_4_cr"  vol = 100 dropoff = 0   
//LoadSound "la\la_vo_thresh2_5_cr"  vol = 100 dropoff = 0   
////LoadSound "la\la_vo_thresh2_6_cr"  vol = 100 dropoff = 0   
//LoadSound "la\la_vo_under1_cr"  vol = 100 dropoff = 0   
////LoadSound "la\la_vo_under2_cr"  vol = 100 dropoff = 0   
//LoadSound "la\la_vo_under3_cr"  vol = 100 dropoff = 0   
//LoadSound "la\la_vo_under4_cr"  vol = 100 dropoff = 0   
//LoadSound "la\la_vo_under5_cr"  vol = 100 dropoff = 0   
////LoadSound "la\la_vo_under6_cr"  vol = 100 dropoff = 0   
 
 
SetParticleSysVisibility system="Qke_Particle01" visible=0
SetParticleSysVisibility system="Qke_Particle02" visible=0
SetParticleSysVisibility system="Qke_Particle03" visible=0
SetParticleSysVisibility system="Qke_Particle04" visible=0
SetParticleSysVisibility system="Qke_Particle05" visible=0
SetParticleSysVisibility system="Qke_Particle06" visible=0
SetParticleSysVisibility system="Qke_Particle07" visible=0
SetParticleSysVisibility system="Qke_Particle08" visible=0
SetParticleSysVisibility system="Qke_Particle09" visible=0
SetParticleSysVisibility system="Qke_Particle10" visible=0
SetParticleSysVisibility system="Qke_Particle11" visible=0
SetParticleSysVisibility system="Qke_Particle12" visible=0
SetParticleSysVisibility system="Qke_Particle13" visible=0
SetParticleSysVisibility system="Qke_Particle14" visible=0
SetParticleSysVisibility system="Qke_Particle15" visible=0
SetParticleSysVisibility system="Qke_Particle16" visible=0
SetParticleSysVisibility system="Qke_Particle17" visible=0
// vents
SetParticleSysVisibility system="NExtParticle20" visible=0
SetParticleSysVisibility system="NExtParticle21" visible=0
// Car wash
SetParticleSysVisibility system="NextParticle_Steam01" visible=0
SetParticleSysVisibility system="NextParticle_Steam02" visible=0
SetParticleSysVisibility system="NextParticle_Steam03" visible=0
// Killing EarthQuake
if InMultiplayerGame
//    Kill name = TRGP_NorthTremor_E
//    Kill name = TRGP_NorthTremor_W
//    Kill name = TRGP_SouthTremor_E
//    Kill name = TRGP_SouthTremor_W
//    Kill name = TRGP_EastTremor_N
//    Kill name = TRGP_EastTremor_S
//    Kill name = TRGP_WestTremor_N
//    Kill name = TRGP_WestTremor_S
//    Create name = TRGP_NorthTremor_E01
//    Create name = TRGP_NorthTremor_W01
//    Create name = TRGP_SouthTremor_E01
//    Create name = TRGP_SouthTremor_W01
//    Create name = TRGP_EastTremor_N01
//    Create name = TRGP_EastTremor_S01
//    Create name = TRGP_WestTremor_N01
//    Create name = TRGP_WestTremor_S01
    else
    Create prefix = "Tall_Cone"
    Create prefix = "TRGP_GarbageCreator"
Endif
UnSetFlag flag=LA_QUAKE_DONE
endscript

panel_message_timer={
    font="large.fnt"
    just=(0,0)
    dims=(600,112)
    colors=[
        {(128,128,128) alpha=128}
    ]
    key_points=[
        {pos=(320,112) alpha=128 scale=2 time=0}
        {scale = .5 alpha = 0 time=.7}
    ]
}

//      Pedestrians -----------------------------


// -------------------------Specific Ped Scripts----------

script Ped_Photographer
//      Setting up parameters
; Removed by Mick >>>> Obj_SetGroundOffset 3.1 feet
Obj_StickToGround distAbove = 3 distBelow = 6
Obj_StickToGround off
Obj_SetConstantHeight
Obj_PlayAnim Anim=idle cycle
if IsCareerMode
Else
Die
Endif
if GetGoal goal = GOAL_TRICKSPOT
Die
Endif
//KillSpawnedScript DayToNight
wait 1 frame
//SpawnScript DayToNight
//Goto Skate4_Timer
Goto Ped_Photographer_Waiting
Endscript

Script Photo_Flash
DoFlash duration = 0.05 start_r = 120 start_g = 150 start_b = 150 start_a = 40 end_r = 190 end_g = 150 end_b = 150 end_a = 40
//DoFlash duration=0.6 start_r=128 start_g=128 start_b=128 start_a=90 end_r=128 end_g=128 end_b=128 end_a=0
Endscript

script Ped_Photographer_Waiting
Obj_ClearExceptions
Obj_SetException ex = SkaterInRadius scr = Photographer_FallForSkater
Obj_SetInnerRadius 10
Begin
if Obj_ObjectInRadius radius = 90 feet type = skater
    Obj_PlayAnim Anim=idleToPhotoidle
    begin
    Obj_LookAtObject    type = skater time = .3
    Obj_WaitAnimFinished
    Obj_PlayAnim Anim=Photodle
    Obj_WaitAnimFinished
        Obj_LookAtObject    type = skater time = .3
        Random (
            @Obj_PlayAnim Anim=Photodle
            // series 1
            @Obj_PlayAnim Anim=PhotoBeckon
            // series 2
            @Obj_PlayAnim Anim=Photodle
        )
        if Obj_ObjectInRadius radius = 50 feet type = skater
            if GetGoal goal = GOAL_TRICKSPOT
                Obj_PlayAnim Anim=PhotoIdleToIdle
                Obj_WaitAnimFinished
                Begin
                Obj_LookAtObject    type = skater time = .3
                Random (
                    @Obj_PlayAnim Anim=Idle
                    @Obj_PlayAnim Anim=PlayerPoint
                    @Obj_PlayAnim Anim=Clap
                    @Obj_PlayAnim Anim=Cheering
                )
                Obj_WaitAnimFinished
                Repeat
            Else
                begin
                Obj_LookAtObject    type = skater time = .2
                Random (
                    @Obj_PlayAnim Anim=PhotoSnap1
                    Wait .5 seconds
                    Playsound hud_jumpgap
//                    SpawnSkaterScript Photo_Flash
                    Wait .2 seconds
                    Playsound hud_jumpgap
//                    SpawnSkaterScript Photo_Flash
                    Wait .4 seconds
                    Playsound hud_jumpgap
                    Obj_WaitAnimFinished
                    @Obj_PlayAnim Anim=PhotoSnap2
                    Wait .5 seconds
                    Playsound hud_jumpgap
                    Wait .3 seconds
//                    SpawnSkaterScript Photo_Flash
                    Playsound hud_jumpgap
                    Wait .2 seconds
                    Playsound hud_jumpgap
                    Obj_WaitAnimFinished
                    @Obj_PlayAnim Anim=PhotoBeckon
                    Photographer_Beckon_Skater
                    Obj_WaitAnimFinished
                    @Obj_PlayAnim Anim=PhotoBeckon
                    Photographer_Beckon_Skater
                    Obj_WaitAnimFinished
                )
                repeat 1
            endif
        endif
        Obj_WaitAnimFinished
    repeat
endif
wait .5 seconds
Repeat
endscript     

Script Photographer_Beckon_Skater
Random (
@
If ProfileEquals is_custom
//Obj_PlayStream photo_01
Endif
If ProfileEquals is_named=hawk
Obj_PlayStream photo_01 vol=150 dropoff=200
Endif
If ProfileEquals is_named=caballero
Obj_PlayStream photo_02 vol=150 dropoff=200
Endif
If ProfileEquals is_named=campbell
Obj_PlayStream photo_03 vol=150 dropoff=200
Endif
If ProfileEquals is_named=glifberg
Obj_PlayStream photo_04 vol=150 dropoff=200
Endif
If ProfileEquals is_named=koston
Obj_PlayStream photo_05 vol=150 dropoff=200
Endif
If ProfileEquals is_named=lasek
Obj_PlayStream photo_06 vol=150 dropoff=200
Endif
If ProfileEquals is_named=margera
Obj_PlayStream photo_07 vol=150 dropoff=200
Endif
If ProfileEquals is_named=mullen
Obj_PlayStream photo_08 vol=150 dropoff=200
Endif
If ProfileEquals is_named=muska
Obj_PlayStream photo_09 vol=150 dropoff=200
Endif
If ProfileEquals is_named=reynolds
Obj_PlayStream photo_10 vol=150 dropoff=200
Endif
If ProfileEquals is_named=rowley
Obj_PlayStream photo_11 vol=150 dropoff=200
Endif
If ProfileEquals is_named=steamer
Obj_PlayStream photo_12 vol=150 dropoff=200
Endif
If ProfileEquals is_named=thomas
Obj_PlayStream photo_13 vol=150 dropoff=200
Endif
If ProfileEquals is_named=carrera
Obj_PlayStream photo_15 vol=150 dropoff=200
Endif
If ProfileEquals Is_Named = Dick
Obj_PlayStream photo_14 vol=150 dropoff=200
Endif
If ProfileEquals Is_Named = demoness
Obj_PlayStream photo_16 vol=150 dropoff=200
Endif
If ProfileEquals Is_Named = wolverine
Obj_PlayStream photo_17 vol=150 dropoff=200
Endif
If ProfileEquals Is_Named = maul
Obj_PlayStream photo_18 vol=150 dropoff=200
Endif
If ProfileEquals Is_Named = slater
Obj_PlayStream photo_19 vol=150 dropoff=200
Endif
If ProfileEquals Is_Named = ollie
Obj_PlayStream photo_20 vol=150 dropoff=200
Endif
If ProfileEquals Is_Named = eyeball
Obj_PlayStream photo_21 vol=150 dropoff=200
Endif
Wait 1.5 seconds
Random (
@Obj_PlayStream photo_22 vol=150 dropoff=200
@Obj_Playstream photo_23 vol=150 dropoff=200
@Obj_Playstream photo_24 vol=150 dropoff=200
@Obj_Playstream photo_25 vol=150 dropoff=200
@Obj_Playstream photo_26 vol=150 dropoff=200
)
@Obj_PlayStream photo_22 vol=150 dropoff=200
@Obj_Playstream photo_23 vol=150 dropoff=200
@Obj_Playstream photo_24 vol=150 dropoff=200
@Obj_Playstream photo_25 vol=150 dropoff=200
@Obj_Playstream photo_26 vol=150 dropoff=200
)
Endscript 

Script Photographer_FallForSkater
Obj_ClearExceptions
Obj_SetInnerRadius 0
// Goal_StartTrickSpotRun
if SkaterCurrentScorePotLessThan 1
    // //LaunchConsoleMessage "Ped pushed2"
    MakeSkaterGoto  SkaterPushPed params = <...>
Endif
//Obj_PlaySound bail04 Vol=100
// Obj_PlaySound Random (@la_vo_approach1_cr @la_vo_approach2_cr @la_vo_approach3_cr @la_vo_approach4_cr) Vol=400 
Obj_PlayAnim Anim=PhotoBeckon
Obj_StopAlongPath
Obj_WaitAnimFinished
Obj_SetException ex = SkaterOutOfRadius scr = Photographer_GetUpAfterFall
Obj_SetOuterRadius 5
Endscript

Script Photographer_GetUpAfterFall
Obj_ClearExceptions
Obj_SetException ex = SkaterInRadius scr = Photographer_FallForSkater
Obj_SetInnerRadius 2
Obj_PlayAnim Anim=GetUp
Obj_WaitAnimFinished
Goto Ped_Photographer_Waiting
endscript
*/

script CC_Startup
//LoadStreamHeader "streams\streams"
//ResetAllOfTheGoals
//SetGlobalFlag flag=CHEAT_PERFECT_RAIL
//SetGlobalFlag flag=CHEAT_PERFECT_MANUAL
Endscript

script CPF_Playa
CPF_SetUpStandardPed
Obj_FollowPathLinked
Begin
Random (
@Obj_PlayAnim Anim=Ped_BP_RunFromIdle
@Obj_PlayAnim Anim=Ped_BP_RunFromIdle
)
Obj_WaitAnimFinished
Repeat
Endscript

OBJFLAG_BBALL_NAV1=1
OBJFLAG_BBALL_NAV2=2
OBJFLAG_BBALL_NAV3=3
OBJFLAG_BBALL_NAV4=4

Script Sch_CheckCallForBall
Random (
@ wait 1 frame
@Obj_PlayAnim Anim=Ped_BP_CallForPass
Obj_WaitAnimFinished
)
Endscript

script Sch_BB_RunToNav Sch_BBall_Nav=TRG_Ped_BB_O_Nav01
Obj_LookAtNode name=<Sch_BBall_Nav>
Obj_PlayAnim Anim=Ped_BP_RunFromIdle
Obj_MoveToNode name=<Sch_BBall_Nav> speed=10 mph
Obj_WaitAnimFinished
Obj_PlayAnim Anim=Ped_BP_Run Cycle
Obj_WaitMove
Obj_PlayAnim Anim=Ped_BP_RunToIdle
Obj_LookAtNode name=TRG_Ped_BB_O_Shooter
Obj_WaitAnimFinished
Endscript
script Sch_BB_Offense_Goal
CPF_SetUpStandardPed
Begin
//Random (
RandomNoRepeat (
//@   // Idle
//Begin
//Obj_PlayAnim Anim=Ped_BP_Idle
//Obj_WaitAnimFinished
//Repeat Random (@1 @2)
@   // CallForPass
Obj_PlayAnim Anim=Ped_BP_CallForPass
Obj_WaitAnimFinished
@   // running to Nav 01
SendFlag name=TRG_Ped_BB_D_Goal OBJFLAG_BBALL_NAV1
Sch_BB_RunToNav Sch_BBall_Nav=TRG_Ped_BB_O_Nav01
Sch_CheckCallForBall
@   // running to Nav 02
SendFlag name=TRG_Ped_BB_D_Goal OBJFLAG_BBALL_NAV2
Sch_BB_RunToNav Sch_BBall_Nav=TRG_Ped_BB_O_Nav02
Sch_CheckCallForBall
@   // running to Nav 03
SendFlag name=TRG_Ped_BB_D_Goal OBJFLAG_BBALL_NAV3
Sch_BB_RunToNav Sch_BBall_Nav=TRG_Ped_BB_O_Nav03
Sch_CheckCallForBall
@   // running to Nav 01
SendFlag name=TRG_Ped_BB_D_Goal OBJFLAG_BBALL_NAV4
Sch_BB_RunToNav Sch_BBall_Nav=TRG_Ped_BB_O_Nav04
Sch_CheckCallForBall
)
Repeat
Endscript
script Sch_BB_Defense_Goal
CPF_SetUpStandardPed
Begin
Obj_PlayAnim Anim=Ped_BP_GuardPlayer Cycle
Begin
if Obj_FlagSet OBJFLAG_BBALL_NAV1
    Obj_ClearFlag OBJFLAG_BBALL_NAV1
    wait Random (@10 frames @20 frames @30 frames)
    Sch_BB_RunToNav Sch_BBall_Nav=TRG_Ped_BB_D_Nav01
    Obj_LookAtNode name=TRG_Ped_BB_O_Nav01
    Break
Endif
if Obj_FlagSet OBJFLAG_BBALL_NAV2
    Obj_ClearFlag OBJFLAG_BBALL_NAV2
    wait Random (@10 frames @20 frames @30 frames)
    Sch_BB_RunToNav Sch_BBall_Nav=TRG_Ped_BB_D_Nav02
    Obj_LookAtNode name=TRG_Ped_BB_O_Nav02
    Break
Endif
if Obj_FlagSet OBJFLAG_BBALL_NAV3
    Obj_ClearFlag OBJFLAG_BBALL_NAV3
    wait Random (@10 frames @20 frames @30 frames)
    Sch_BB_RunToNav Sch_BBall_Nav=TRG_Ped_BB_D_Nav03
    Obj_LookAtNode name=TRG_Ped_BB_O_Nav03
    Break
Endif
if Obj_FlagSet OBJFLAG_BBALL_NAV4
    Obj_ClearFlag OBJFLAG_BBALL_NAV4
    wait Random (@10 frames @20 frames @30 frames)
    Sch_BB_RunToNav Sch_BBall_Nav=TRG_Ped_BB_D_Nav04
    Obj_LookAtNode name=TRG_Ped_BB_O_Nav04
    Break
Endif
wait 10 frame
Repeat
Repeat
Endscript

Script Sch_BB_JukeBeforeRun
Random (
@   // Juke
Obj_PlayAnim Anim=Ped_BP_DribbleJukeFromIdle
Obj_WaitAnimFinished
Obj_PlayAnim Anim=Ped_BP_DribbleJuke
Obj_SpawnScript Sch_BB_Sound_BallJuke id=BBallSound
Obj_WaitAnimFinished
Obj_PlayAnim Anim=Ped_BP_DribbleJukeToIdle
Obj_WaitAnimFinished
@   // QuickJuke
Obj_PlayAnim Anim=Ped_BP_QuickJuke
Obj_SpawnScript Sch_BB_Sound_BallJuke id=BBallSound
Obj_WaitAnimFinished
@   // nothing
)
Endscript

script Sch_BB_DribbleRunToNav Sch_BBall_Nav=TRG_Ped_BB_O_Nav01
Obj_LookAtNode name=<Sch_BBall_Nav>
Obj_PlayAnim Anim=Ped_BP_DribbleRunFromIdle
Obj_MoveToNode name=<Sch_BBall_Nav> speed=10 mph
Obj_WaitAnimFinished
Obj_PlayAnim Anim=Ped_BP_DribbleRun Cycle
Obj_WaitMove
Obj_PlayAnim Anim=Ped_BP_DribbleRunToIdle
Obj_LookAtNode name=TRG_Ped_BB_D_Shooter
Obj_WaitAnimFinished
Endscript
script Sch_BB_Sound_BallMake
Obj_playsound Random (@BBallSwish_11 @BBallSwish2_11 @BBallSwish3_11 @BBallSwish4_11)
endscript
script Sch_BB_Sound_BallMiss
Obj_playsound Random (@BBallhitbasket_11 @BBallhitbasket2_11)
endscript
script Sch_BB_Sound_BallJuke
wait 40 frames
Obj_playsound Random (@BBallBounce_11 @BBallBounce2_11 @BBallBounce3_11)
wait 20 frames
begin
Obj_playsound Random (@BBallBounce_11 @BBallBounce2_11 @BBallBounce3_11)
wait 15 frames
Obj_playsound Random (@BBallBounce_11 @BBallBounce2_11 @BBallBounce3_11)
wait 28 frames
repeat 2
endscript
script Sch_BB_Sound_BallSlowDribble
begin
Obj_playsound Random (@BBallBounce_11 @BBallBounce2_11 @BBallBounce3_11)
wait 53 frames
repeat 2
wait 13 frames
Obj_playsound Random (@BBallBounce_11 @BBallBounce2_11 @BBallBounce3_11)
wait 43 frames
Obj_playsound Random (@BBallBounce_11 @BBallBounce2_11 @BBallBounce3_11)
wait 43 frames
Obj_playsound Random (@BBallBounce_11 @BBallBounce2_11 @BBallBounce3_11)
endscript
script Sch_BB_Sound_BallRun
begin
Obj_playsound Random (@BBallBounce_11 @BBallBounce2_11 @BBallBounce3_11)
wait 25 frames
repeat
Endscript

script Sch_BB_Offense_Shooter
CPF_SetUpStandardPed
Begin
//Random (
Obj_KillSpawnedScript id=BBallSound
RandomNoRepeat (
@   // ShootAndMake
Obj_PlayAnim Anim=Ped_BP_ShootBall
wait 80 frames
Obj_SpawnScript Sch_BB_Sound_BallMake id=BBallSound
Obj_WaitAnimFinished
Obj_PlayAnim Anim=Ped_BP_BallMake1
Obj_WaitAnimFinished
Obj_PlayAnim Anim=Ped_BP_DribbleInPlace
Obj_SpawnScript Sch_BB_Sound_BallSlowDribble id=BBallSound
Obj_WaitAnimFinished
@   // ShootAndMiss
Obj_PlayAnim Anim=Ped_BP_ShootBall
wait 80 frames
Obj_SpawnScript Sch_BB_Sound_BallMiss id=BBallSound
Obj_WaitAnimFinished
Obj_PlayAnim Anim=Ped_BP_BallMiss1
Obj_WaitAnimFinished
Obj_PlayAnim Anim=Ped_BP_DribbleInPlace
Obj_SpawnScript Sch_BB_Sound_BallSlowDribble id=BBallSound
Obj_WaitAnimFinished
@   // Juke
Obj_PlayAnim Anim=Ped_BP_DribbleJukeFromIdle
Obj_WaitAnimFinished
Obj_PlayAnim Anim=Ped_BP_DribbleJuke
Obj_SpawnScript Sch_BB_Sound_BallJuke id=BBallSound
Obj_WaitAnimFinished
Obj_PlayAnim Anim=Ped_BP_DribbleJukeToIdle
Obj_WaitAnimFinished
@   // QuickJuke
Obj_PlayAnim Anim=Ped_BP_QuickJuke
Obj_SpawnScript Sch_BB_Sound_BallJuke id=BBallSound
Obj_WaitAnimFinished
@   // running to Nav 01
Sch_BB_JukeBeforeRun
Obj_SpawnScript Sch_BB_Sound_BallRun id=BBallSound
SendFlag name=TRG_Ped_BB_D_Shooter OBJFLAG_BBALL_NAV1
Sch_BB_DribbleRunToNav Sch_BBall_Nav=TRG_Ped_BB_O2_Nav01
@   // running to Nav 02
Sch_BB_JukeBeforeRun
Obj_SpawnScript Sch_BB_Sound_BallRun id=BBallSound
SendFlag name=TRG_Ped_BB_D_Shooter OBJFLAG_BBALL_NAV2
Sch_BB_DribbleRunToNav Sch_BBall_Nav=TRG_Ped_BB_O2_Nav02
@   // running to Nav 03
Sch_BB_JukeBeforeRun
Obj_SpawnScript Sch_BB_Sound_BallRun id=BBallSound
SendFlag name=TRG_Ped_BB_D_Shooter OBJFLAG_BBALL_NAV3
Sch_BB_DribbleRunToNav Sch_BBall_Nav=TRG_Ped_BB_O2_Nav03
@   // running to Nav 04
Sch_BB_JukeBeforeRun
Obj_SpawnScript Sch_BB_Sound_BallRun id=BBallSound
SendFlag name=TRG_Ped_BB_D_Shooter OBJFLAG_BBALL_NAV4
Sch_BB_DribbleRunToNav Sch_BBall_Nav=TRG_Ped_BB_O2_Nav04
)
Repeat
Endscript
script Sch_BB_Defense_Shooter
CPF_SetUpStandardPed
Begin
Obj_PlayAnim Anim=Ped_BP_GuardPlayer Cycle
Begin
if Obj_FlagSet OBJFLAG_BBALL_NAV1
    Obj_ClearFlag OBJFLAG_BBALL_NAV1
    wait Random (@10 frames @20 frames @30 frames)
    Sch_BB_RunToNav Sch_BBall_Nav=TRG_Ped_BB_D2_Nav01
    Obj_LookAtNode name=TRG_Ped_BB_O2_Nav01
    Break
Endif
if Obj_FlagSet OBJFLAG_BBALL_NAV2
    Obj_ClearFlag OBJFLAG_BBALL_NAV2
    wait Random (@10 frames @20 frames @30 frames)
    Sch_BB_RunToNav Sch_BBall_Nav=TRG_Ped_BB_D2_Nav02
    Obj_LookAtNode name=TRG_Ped_BB_O2_Nav02
    Break
Endif
if Obj_FlagSet OBJFLAG_BBALL_NAV3
    Obj_ClearFlag OBJFLAG_BBALL_NAV3
    wait Random (@10 frames @20 frames @30 frames)
    Sch_BB_RunToNav Sch_BBall_Nav=TRG_Ped_BB_D2_Nav03
    Obj_LookAtNode name=TRG_Ped_BB_O2_Nav03
    Break
Endif
if Obj_FlagSet OBJFLAG_BBALL_NAV4
    Obj_ClearFlag OBJFLAG_BBALL_NAV4
    wait Random (@10 frames @20 frames @30 frames)
    Sch_BB_RunToNav Sch_BBall_Nav=TRG_Ped_BB_D2_Nav04
    Obj_LookAtNode name=TRG_Ped_BB_O2_Nav04
    Break
Endif
wait 10 frame
Repeat
Repeat
Endscript

/*
Script CPF_AP_FLAG_COUNTER
Playsound ap_ripflag pitch=random (@80 @100 @120 @130 @140 @150)
If GotParam USA
    if InMultiplayerGame
    Else
        // LaunchLocalMessage id=country "Don't Mess with Texas" panel_message_secondarypickup
    Endif
    StartGap GapID=AP_Flag1
    wait 1 frame
    EndGap GapID=AP_Flag1 text="American Made" score=50
    if IsCareerMode
        if GetGoal goal = GOAL_SCRIPTED3
        Else
            if QueryFlag AP_FLAG_USA name=TRG_FlagCounter
                // LaunchLocalMessage id=country "Already been to USA" panel_message_secondarypickup
            Else
                SendFlag name=TRG_FlagCounter AP_FLAGS_HIT
                wait 1 frame
                SendFlag name=TRG_FlagCounter AP_FLAG_USA
            Endif
        Endif
    Endif
Endif
If GotParam UK
    if InMultiplayerGame
    Else
        // LaunchLocalMessage id=country "Football? Soccer?" panel_message_secondarypickup
    Endif
    StartGap GapID=AP_Flag2
    wait 1 frame
    EndGap GapID=AP_Flag2 text="Tea Time" score=50
    if IsCareerMode
        if GetGoal goal = GOAL_SCRIPTED3
        Else
            if QueryFlag AP_FLAG_UK name=TRG_FlagCounter
                // LaunchLocalMessage id=country "Already been to the UK" panel_message_secondarypickup
            Else
                SendFlag name=TRG_FlagCounter AP_FLAGS_HIT
                wait 1 frame
                SendFlag name=TRG_FlagCounter AP_FLAG_UK
            Endif
        Endif
    Endif
Endif
If GotParam Russia
    if InMultiplayerGame
    Else
        // LaunchLocalMessage id=country "Welcome to Mother Russia" panel_message_secondarypickup
    Endif
    StartGap GapID=AP_Flag3
    wait 1 frame
    EndGap GapID=AP_Flag3 text="Zdrasvuite!" score=50
    if IsCareerMode
        if GetGoal goal = GOAL_SCRIPTED3
        Else
            if QueryFlag AP_FLAG_RUSSIA name=TRG_FlagCounter
                // LaunchLocalMessage id=country "Already been to Russia" panel_message_secondarypickup
            Else
                SendFlag name=TRG_FlagCounter AP_FLAGS_HIT
                wait 1 frame
                SendFlag name=TRG_FlagCounter AP_FLAG_RUSSIA
            Endif
        Endif
    Endif
Endif
If GotParam Mexico
    if InMultiplayerGame
    Else
        // LaunchLocalMessage id=country "South of the Border!" panel_message_secondarypickup
    Endif
    StartGap GapID=AP_Flag4
    wait 1 frame
    EndGap GapID=AP_Flag4 text="HOLA!" score=50
    if IsCareerMode
        if GetGoal goal = GOAL_SCRIPTED3
        Else
            if QueryFlag AP_FLAG_MEXICO name=TRG_FlagCounter
                // LaunchLocalMessage id=country "Already been to Mexico" panel_message_secondarypickup
            Else
                SendFlag name=TRG_FlagCounter AP_FLAGS_HIT
                wait 1 frame
                SendFlag name=TRG_FlagCounter AP_FLAG_MEXICO
            Endif
        Endif
    Endif
Endif    
If GotParam France
    if InMultiplayerGame
    Else
        // LaunchLocalMessage id=country "Mon Dieu!" panel_message_secondarypickup
    Endif
    StartGap GapID=AP_Flag5
    wait 1 frame
    EndGap GapID=AP_Flag5 text="Parlez-Vous Skate?" score=50
    if IsCareerMode
        if GetGoal goal = GOAL_SCRIPTED3
        Else
            if QueryFlag AP_FLAG_FRANCE name=TRG_FlagCounter
                // LaunchLocalMessage id=country "Already been to France" panel_message_secondarypickup
            Else
                SendFlag name=TRG_FlagCounter AP_FLAGS_HIT
                wait 1 frame
                SendFlag name=TRG_FlagCounter AP_FLAG_FRANCE
            Endif
        Endif
    Endif
Endif
If GotParam Chad
    if InMultiplayerGame
    Else
        // LaunchLocalMessage id=country "Republique du Tchad" panel_message_secondarypickup
    Endif
    StartGap GapID=AP_Flag6
    wait 1 frame
    EndGap GapID=AP_Flag6 text="Golden!" score=50
    if IsCareerMode
        if GetGoal goal = GOAL_SCRIPTED3
        Else
            if QueryFlag AP_FLAG_CHAD name=TRG_FlagCounter
                // LaunchLocalMessage id=country "Already been to Chad" panel_message_secondarypickup
            Else
                SendFlag name=TRG_FlagCounter AP_FLAGS_HIT
                wait 1 frame
                SendFlag name=TRG_FlagCounter AP_FLAG_CHAD
            Endif
        Endif
    Endif
Endif
If GotParam Canada
    if InMultiplayerGame
    Else
        // LaunchLocalMessage id=country "Bonjour, eh?" panel_message_secondarypickup
    Endif
    StartGap GapID=AP_Flag7
    wait 1 frame
    EndGap GapID=AP_Flag7 text="Welcome, eh?" score=50
    if IsCareerMode
        if GetGoal goal = GOAL_SCRIPTED3
        Else
            if QueryFlag AP_FLAG_CANADA name=TRG_FlagCounter
                // LaunchLocalMessage id=country "Already been to Canada" panel_message_secondarypickup
            Else
                SendFlag name=TRG_FlagCounter AP_FLAGS_HIT
                wait 1 frame
                SendFlag name=TRG_FlagCounter AP_FLAG_CANADA
            Endif
        Endif
    Endif
Endif
If GotParam Bermuda
    if InMultiplayerGame
    Else
        // LaunchLocalMessage id=country "Where are we?" panel_message_secondarypickup
    Endif
    StartGap GapID=AP_Flag8
    wait 1 frame
    EndGap GapID=AP_Flag8 text="Welcom to the Triangle" score=50
    if IsCareerMode
        if GetGoal goal = GOAL_SCRIPTED3
        Else
            if QueryFlag AP_FLAG_BERMUDA name=TRG_FlagCounter
                // LaunchLocalMessage id=country "Already been to Bermuda" panel_message_secondarypickup
            Else
                SendFlag name=TRG_FlagCounter AP_FLAGS_HIT
                wait 1 frame
                SendFlag name=TRG_FlagCounter AP_FLAG_BERMUDA
            Endif
        Endif
    Endif
Endif
If GotParam Bahamas
    if InMultiplayerGame
    Else
        // LaunchLocalMessage id=country "Bahamas... beautiful" panel_message_secondarypickup
    Endif
    StartGap GapID=AP_Flag9
    wait 1 frame
    EndGap GapID=AP_Flag9 text="Country of 700 islands" score=50
    if IsCareerMode
        if GetGoal goal = GOAL_SCRIPTED3
        Else
            if QueryFlag AP_FLAG_BAHAMAS name=TRG_FlagCounter
                // LaunchLocalMessage id=country "Already been to the Bahamas" panel_message_secondarypickup
            Else
                SendFlag name=TRG_FlagCounter AP_FLAGS_HIT
                wait 1 frame
                SendFlag name=TRG_FlagCounter AP_FLAG_BAHAMAS
            Endif
        Endif
    Endif
Endif
If GotParam Aussie
    if InMultiplayerGame
    Else
        // LaunchLocalMessage id=country "Australian for |Kick Ass Game, mate!" panel_message_secondarypickup
    Endif
    StartGap GapID=AP_Flag10
    wait 1 frame
    EndGap GapID=AP_Flag10 text="G'Day" score=50
    if IsCareerMode
        if GetGoal goal = GOAL_SCRIPTED3
        Else
            if QueryFlag AP_FLAG_AUSSIE name=TRG_FlagCounter
                // LaunchLocalMessage id=country "Already been to Australia" panel_message_secondarypickup
            Else
                SendFlag name=TRG_FlagCounter AP_FLAGS_HIT
                wait 1 frame
                SendFlag name=TRG_FlagCounter AP_FLAG_AUSSIE
            Endif
        Endif
    Endif
Endif

Endscript
// flags

LA_QUAKE_DONE   = 21    // level flag
AP_TERRORIST_HIT= 0
AP_GUNSHIP_HIT  = 1
AP_TERROR_HIT   = 2
AP_TERRORIST_01 = 11
AP_TERRORIST_02 = 12
AP_TERRORIST_03 = 13
AP_TERRORIST_04 = 14
AP_TERRORIST_05 = 15
AP_FLAG_USA     = 16
AP_FLAG_UK      = 17
AP_FLAG_CHAD    = 18
AP_FLAG_RUSSIA  = 19
AP_FLAG_FRANCE  = 20
AP_FLAG_BERMUDA = 21
AP_FLAG_AUSSIE  = 22
AP_FLAG_BAHAMAS = 23
AP_FLAG_CANADA  = 24
AP_FLAG_MEXICO  = 25

Script CPF_AP_TerroristCounter
if IsCareerMode
    if GetGoal goal = GOAL_SCRIPTED2
        Die
    Else
//        
Obj_VarSet var=0 value=0
        Begin
        // // //LaunchConsoleMessage "Terrorist Counter"
        if Obj_FlagSet AP_TERRORIST_HIT
            Obj_ClearFlag AP_TERRORIST_HIT
            if Obj_FlagSet AP_TERROR_HIT
                Obj_ClearFlag AP_TERROR_HIT
                Obj_VarInc var=0
                if Obj_VarEQ var=0 value=1
                    LaunchPanelMessage "1 of 5 PickPockets Stopped"
                Endif
                if Obj_VarEQ var=0 value=2
                    LaunchPanelMessage "2 of 5 PickPockets Stopped"
                Endif
                if Obj_VarEQ var=0 value=3
                    LaunchPanelMessage "3 of 5 PickPockets Stopped"
                Endif
                if Obj_VarEQ var=0 value=4
                    LaunchPanelMessage "4 of 5 PickPockets Stopped"
                Endif
                if Obj_VarEQ var=0 value=5
                    LaunchPanelMessage "5 of 5 PickPockets Stopped"
//                    if Obj_FlagSet AP_GUNSHIP_HIT
                        Wait 10 frames
//                        Got_Scripted2 
//                    Else
//                        LaunchPanelMessage "Still need to stop the Gunship!"
//                    Endif
                Endif
            Else
//            Endif
            if Obj_FlagSet AP_GUNSHIP_HIT
                if Obj_VarEQ var=0 value=5
//                    LaunchPanelMessage "All PickPockets Stopped"
                    PlayStream AP_TerHelo1 
                    Wait 10 frames
//                    Got_Scripted2 
                Else
                    PlayStream AP_TerHelo2 
//                    LaunchPanelMessage "Still need to stop the terorists!"
//                    Obj_ClearFlag AP_GUNSHIP_HIT
                Endif
            Endif
            Endif
        Endif
        Wait 2 frames
        Repeat
    Endif
Endif
Endscript

AP_FLAGS_HIT = 0

Script CPF_AP_FlagCounter
if IsCareerMode
    if GetGoal goal = GOAL_SCRIPTED3
        Die
    Else
        Obj_VarSet var=0 value=0
        Begin
        // // //LaunchConsoleMessage "Flag Counter"
        if Obj_FlagSet AP_FLAGS_HIT
            Obj_ClearFlag AP_FLAGS_HIT
            Obj_VarInc var=0
            if Obj_VarEQ var=0 value=1
                LaunchPanelMessage "1 of 10 Countries Visited"
            Endif
            if Obj_VarEQ var=0 value=2
                LaunchPanelMessage "2 of 10 Countries Visited"
            Endif       
            if Obj_VarEQ var=0 value=3
                LaunchPanelMessage "3 of 10 Countries Visited"
            Endif
            if Obj_VarEQ var=0 value=4
                LaunchPanelMessage "4 of 10 Countries Visited"
            Endif
            if Obj_VarEQ var=0 value=5
                LaunchPanelMessage "5 of 10 Countries Visited"
            Endif
            if Obj_VarEQ var=0 value=6
                LaunchPanelMessage "6 of 10 Countries Visited"
            Endif
            if Obj_VarEQ var=0 value=7
                LaunchPanelMessage "7 of 10 Countries Visited"
            Endif       
            if Obj_VarEQ var=0 value=8
                LaunchPanelMessage "8 of 10 Countries Visited"
            Endif
            if Obj_VarEQ var=0 value=9
                LaunchPanelMessage "9 of 10 Countries Visited"
            Endif
            if Obj_VarEQ var=0 value=10
                LaunchPanelMessage "10 of 10 Countries Visited"
                Wait 40 frames
                LaunchPanelMessage " "
//                Got_Scripted3 
            Endif
        Endif
        Wait 2 frames
        Repeat
    Endif
Endif
Endscript

//      Soon to be killed Pedestrian Scripts ------------

script CPF_PedTest
// Obj_AutoAnimate
; Removed by Mick >>>> Obj_SetGroundOffset 3.1 feet
Obj_StickToGround distAbove = 3 distBelow = 6
Obj_SetPathTurnDist 2.5 feet
Obj_PathHeading On
Obj_SetPathVelocity 5 fps
Begin
Obj_FollowPath name = TRG_LA_Pedestrian_Nav01
Obj_WaitMove
Obj_FollowPath name = TRG_LA_Pedestrian_Nav03
Obj_WaitMove
Repeat
// FollowWayPointPath TRG_LA_Pedestrian_Nav01
// Begin
// CycleAnim "lookleft" 6
// FollowWayPointPath TRG_LA_Pedestrian_Nav03
// Repeat
endscript     

              
script CPF_Ped_Sidewalk
// Begin
Obj_AutoAnimate
; Removed by Mick >>>> Obj_SetGroundOffset 3.1 feet
Obj_StickToGround distAbove = 3 distBelow = 6
Obj_SetPathTurnDist 2.5 feet
Obj_PathHeading On
Obj_SetPathVelocity 5 fps
Begin
Obj_FollowPath name = TRG_LA_Pedestrian_Nav05
Obj_WaitMove
Obj_FollowPath name = TRG_LA_Pedestrian_Nav07
Obj_WaitMove
Repeat
// FollowWayPointPath TRG_LA_Pedestrian_Nav05
// RunAnim "walktostand"
// CycleAnim "lookright" 6
// RunAnim "standtowalk"
// FollowWayPointPath TRG_LA_Pedestrian_Nav07
// RunAnim "walktostand"
// CycleAnim "push" 6
// RunAnim "standtowalk"
// Repeat
endscript                 


script CPF_Ped_Pershing1
// Begin
Obj_AutoAnimate
; Removed by Mick >>>> Obj_SetGroundOffset 3.1 feet
Obj_StickToGround distAbove = 3 distBelow = 6
Obj_SetPathTurnDist 2.5 feet
Obj_PathHeading On
Obj_SetPathVelocity 5 fps
Begin
Obj_FollowPath name = TRG_LA_Pedestrian_Nav09
Obj_WaitMove
Repeat
// FollowWayPointPath name = TRG_LA_Pedestrian_Nav09
// Repeat
endscript

                  
script CPF_Ped_Pershing2
// Begin
// FollowWayPointPath TRG_LA_Pedestrian_Nav13 
// Repeat
endscript                 

script CPF_Ped_Library1
// Begin
Obj_AutoAnimate
; Removed by Mick >>>> Obj_SetGroundOffset 3.1 feet
Obj_StickToGround distAbove = 3 distBelow = 6
Obj_SetPathTurnDist 2.5 feet
Obj_PathHeading On
Obj_SetPathVelocity 5 fps
Begin
Obj_FollowPath name = TRG_LA_Pedestrian_Nav16
Obj_WaitMove
Obj_FollowPath name = TRG_LA_Pedestrian_Nav18
Obj_WaitMove
Repeat
// FollowWayPointPath TRG_LA_Pedestrian_Nav16
// RunAnim "walktostand"
// CycleAnim "lookright" 6
// RunAnim "standtowalk"
// FollowWayPointPath TRG_LA_Pedestrian_Nav18
// RunAnim "walktostand"
// CycleAnim "lookright" 6
// RunAnim "standtowalk"
// Repeat
endscript                 

script CPF_Ped_CarWash1
// Begin
Obj_AutoAnimate
; Removed by Mick >>>> Obj_SetGroundOffset 3.1 feet
Obj_StickToGround distAbove = 3 distBelow = 6
Obj_SetPathTurnDist 2.5 feet
Obj_PathHeading On
Obj_SetPathVelocity 5 fps
Obj_FollowPathLinked
endscript                 

script CPF_Ped_Airport1
// FollowWayPointPath TRG_LA_Pedestrian_Nav03
Obj_AutoAnimate
; Removed by Mick >>>> Obj_SetGroundOffset 3.1 feet
Obj_StickToGround distAbove = 3 distBelow = 6
Obj_SetPathTurnDist 2.5 feet
Obj_PathHeading On
Obj_SetPathVelocity 5 fps
Begin
Obj_FollowPath name = TRG_LA_Pedestrian_Nav01
Obj_WaitMove
Obj_FollowPath name = TRG_LA_Pedestrian_Nav07
Obj_WaitMove
Obj_FollowPath name = TRG_LA_Pedestrian_Nav05
Obj_WaitMove
Repeat
// Begin
// RunAnim "walktostand"
// CycleAnim "lookright" 6
// RunAnim "standtowalk"
// FollowWayPointPath TRG_LA_Pedestrian_Nav01
// FollowWayPointPath TRG_LA_Pedestrian_Nav07
// RunAnim "walktostand"
// CycleAnim "lookright" 6
// RunAnim "standtowalk"
// FollowWayPointPath TRG_LA_Pedestrian_Nav05
// RunAnim "walktostand"
// CycleAnim "lookright" 6
// RunAnim "standtowalk"
// Repeat
endscript     


//      Cars  -----------------------------------------

// flags
SKATER_IN_WAY_OF_STOP = 0
BULLET_HIT = 1


Script CPF_CarGeneric
//      Setting up parameters
; Removed by Mick >>>> Obj_SetGroundOffset  0 feet
Obj_StickToGround distAbove = 6 distBelow = 6
Obj_StickToGround off
Obj_SetConstantHeight
Obj_SetPathTurnDist 10 feet
Obj_PathHeading On
Obj_SetPathAcceleration 65 fpsps
Obj_SetPathDeceleration 90 fpsps
Obj_SetPathVelocity 45 fps
//      Start following the path that it's linked to
Obj_FollowPathLinked
endscript

Script CPF_CarGenericTest
begin
    if Obj_ObjectInRect dist = 40 type = skater
//        if Obj_ObjectInRadius radius = 10 feet type = skater
//                //LaunchConsoleMessage "Car sees Player"
                Obj_PlaySound CarHorn_11 Vol=100 
                Wait 2 seconds
        else
        endif
        Wait 1 frame
repeat
endscript

Script CPF_Car_Overpass
//      Setting up parameters
// ; Removed by Mick >>>> Obj_SetGroundOffset  0 feet
// Obj_StickToGround distAbove = 6 distBelow = 6
Obj_StickToGround off
Obj_SetConstantHeight
Obj_SetPathTurnDist 10 feet
Obj_PathHeading On
Obj_SetPathAcceleration 165 fpsps
Obj_SetPathDeceleration 90 fpsps
Obj_SetPathVelocity 85 fps
//      Start following the path that it's linked to
// Wait 1 second
Obj_FollowPathLinked
endscript

Script CPF_CarGenericStop1
//      Setting up parameters
//      Start following the path that it's linked to
Obj_FollowPathLinked
Wait 1 second
Obj_SwitchScript CPF_CarStop1_Moving
endscript

Script CPF_CarStop1_Moving
begin
        // checking for skater in front of car - if so then stop        
    if Obj_ObjectInRect dist = 40 type = skater
//        if Obj_ObjectInRadius radius = 15 feet type = skater
                // tell other cars to stop
                SendFlag prefix = "TRG_Car_Stop1" SKATER_IN_WAY_OF_STOP
                // stop
                Obj_StopAlongPath 5
//                //LaunchConsoleMessage "Car stops for Player"
                // play stopped sounds
                Obj_PlaySound LA_Skid_11 Vol=100 
                Obj_PlaySound CarHorn_11 Vol=100 
                // switch to a stopped script
                Obj_SwitchScript CPF_CarStop1_StoppedByPlayer
        else
                Wait 1 frame
        endif
        // checking for skater in front of another car - if so then stop        
        if Obj_FlagSet SKATER_IN_WAY_OF_STOP clear
                Obj_StopAlongPath
//                //LaunchConsoleMessage "Other Car stops for Player"
                Obj_SwitchScript CPF_CarStop1_StoppedByOther
        else
                Wait 1 frame
        endif
        Wait 1 frame
repeat
endscript

Script CPF_CarStop1_StoppedByPlayer
// loop checking for when player leaves radius
Begin
    if Obj_ObjectInRect dist = 40 type = skater
//        if Obj_ObjectInRadius radius = 40 feet type = skater
                SendFlag prefix = "TRG_Car_Stop1" SKATER_IN_WAY_OF_STOP
        else
//                //LaunchConsoleMessage "Starting to move again"
                Wait 1 frame
                Obj_StartAlongPath
                ClearFlag prefix = "TRG_Car_Stop1" SKATER_IN_WAY_OF_STOP
                Obj_SwitchScript CPF_CarStop1_Moving
        endif
        Wait 1 frame
repeat
endscript



Script CPF_CarStop1_StoppedByOther
// checking for skater in front of car - if so then stop        
begin        
        if Obj_FlagSet SKATER_IN_WAY_OF_STOP
                Obj_SwitchScript CPF_CarStop1_Moving
        else
//                //LaunchConsoleMessage "Starting to move again"
                Wait 1 frame
                Obj_StartAlongPath
                Obj_SwitchScript CPF_CarStop1_Moving
        endif
        Wait 1 frame
repeat
endscript


Script CPF_CarGenericStop2
//      Setting up parameters
//      Start following the path that it's linked to
Obj_FollowPathLinked
Wait 1 second
Obj_SwitchScript CPF_CarStop2_Moving
endscript

Script CPF_CarStop2_Moving
begin
        // checking for skater in front of car - if so then stop        
    if Obj_ObjectInRect dist = 40 type = skater
//        if Obj_ObjectInRadius radius = 15 feet type = skater
                // tell other cars to stop
                SendFlag prefix = "TRG_Car_Stop1" SKATER_IN_WAY_OF_STOP
                // stop
                Obj_StopAlongPath 5
//                //LaunchConsoleMessage "Car stops for Player"
                // play stopped sounds
                Obj_PlaySound LA_Skid_11 Vol=100 
                Obj_PlaySound CarHorn_11 Vol=100 
                // switch to a stopped script
                Obj_SwitchScript CPF_CarStop2_StoppedByPlayer
        else
                Wait 1 frame
        endif
        // checking for skater in front of another car - if so then stop        
        if Obj_FlagSet SKATER_IN_WAY_OF_STOP clear
                Obj_StopAlongPath
//                //LaunchConsoleMessage "Other Car stops for Player"
                Obj_SwitchScript CPF_CarStop2_StoppedByOther
        else
                Wait 1 frame
        endif
        Wait 1 frame
repeat
endscript

Script CPF_CarStop2_StoppedByPlayer
// loop checking for when player leaves radius
Begin
    if Obj_ObjectInRect dist = 40 type = skater
//        if Obj_ObjectInRadius radius = 40 feet type = skater
                SendFlag prefix = "TRG_Car_Stop2" SKATER_IN_WAY_OF_STOP
        else
//                //LaunchConsoleMessage "Starting to move again"
                Wait 1 frame
                Obj_StartAlongPath
                ClearFlag prefix = "TRG_Car_Stop2" SKATER_IN_WAY_OF_STOP
                Obj_SwitchScript CPF_CarStop1_Moving
        endif
        Wait 1 frame
repeat
endscript



Script CPF_CarStop2_StoppedByOther
// checking for skater in front of car - if so then stop        
begin        
        if Obj_FlagSet SKATER_IN_WAY_OF_STOP
                Obj_SwitchScript CPF_CarStop1_Moving
        else
//                //LaunchConsoleMessage "Starting to move again"
                Wait 1 frame
                Obj_StartAlongPath
                Obj_SwitchScript CPF_CarStop2_Moving
        endif
        Wait 1 frame
repeat
endscript


Script CPF_Car_Police
//      Setting up parameters
if IsCareerMode
Else
    Die
Endif
; Removed by Mick >>>> Obj_SetGroundOffset  .1
Obj_StickToGround distAbove = 6 distBelow = 6
Obj_SetPathTurnDist 10 feet
Obj_PathHeading On
Obj_SetPathVelocity 75 fps
Obj_SetPathAcceleration 0 fpsps
//      Start following the path that it's linked to
Obj_FollowPathLinked
wait random (@1 frame @5 frames @10 frames)
begin
        if Obj_ObjectInRadius radius = 20 feet type = skater
                Random (@Obj_PlaySound CarHorn_11 @PlayStream la_new01)
                Wait 2 seconds
        else
        endif
        Obj_PlaySound random (@ambulance2nl @ambulance3nl) Vol=70 
        Wait 37 frames
repeat
endscript

Script CPF_Car_Looter
//      Setting up parameters
if IsCareerMode
Else
    Die
Endif
; Removed by Mick >>>> Obj_SetGroundOffset  .1
Obj_StickToGround distAbove = 6 distBelow = 6
Obj_SetPathTurnDist 10 feet
Obj_PathHeading On
Obj_SetPathVelocity 75 fps
Obj_SetPathAcceleration 0 fpsps
//      Start following the path that it's linked to
Obj_FollowPathLinked
begin
        if Obj_ObjectInRadius radius = 10 feet type = skater
                Obj_PlaySound random (@CarHorn_11) Vol=200 
                Wait 2 seconds
        else
        endif
        Wait 17 frames
repeat
endscript

Script CPF_Car_Looter01
//      Setting up parameters
; Removed by Mick >>>> Obj_SetGroundOffset  .1
Obj_StickToGround distAbove = 6 distBelow = 6
Obj_StickToGround off
Obj_SetConstantHeight
Obj_SetPathTurnDist 10 feet
Obj_PathHeading On
Obj_SetPathAcceleration 100 fpsps
Obj_SetPathDeceleration 100 fpsps
Obj_SetPathVelocity 95 fps
//      Start following the path that it's linked to
Wait .3 seconds
Obj_FollowPathLinked
Wait 3.0 seconds
Obj_PathHeading Off
Obj_PlaySound LA_Skid_11  vol = 200 dropoff = 300
Obj_Rotate relative = (0, -90, 0) time = .5
Wait 2 seconds
create name = Gun_Looter
begin
Random (
@Wait 1 frame
@Wait 1 frame
@Wait 1 frame
@Wait 1 frame
@Wait 1 frame
@Wait 1 frame
@Wait .6 seconds
@Wait .8 seconds
)
Obj_Rotate relative = (0, 0, -1) time = .01
create name = MuzzleFlash
Obj_PlaySound la_gunshots2  vol = 200 dropoff = 300
wait 3 frames
kill name = MuzzleFlash
SendFlag name = TRG_Cutscene_Police02 BULLET_HIT
Random (
@create name = BulletPing01
wait 2 frames
kill name = BulletPing01
@create name = BulletPing02
wait 2 frames
kill name = BulletPing02
@create name = BulletPing04
wait 2 frames
kill name = BulletPing04
@create name = BulletPing05
wait 2 frames
kill name = BulletPing05
)
Obj_Rotate relative = (0, 0, 1) time = .01
repeat
endscript

Script CPF_LA_Looter_Dead
Endscript

script CPF_LA_policecutscene
; Removed by Mick >>>> Obj_SetGroundOffset  -.102 
Obj_StickToGround distAbove = 6 distBelow = 6
Obj_StickToGround off
Obj_SetConstantHeight
Obj_SetPathTurnDist 10 feet
Obj_PathHeading On
Obj_SetPathAcceleration 100 fpsps
Obj_SetPathDeceleration 100 fpsps
Obj_SetPathVelocity 95 fps
//      Start following the path that it's linked to
Wait 2.8 seconds
Obj_FollowPathLinked
Wait 1.9 seconds
Obj_PathHeading Off
Obj_PlaySound LA_Skid_11  vol = 200 dropoff = 300
Obj_Rotate relative = (0, -130, 0) time = .5
endscript

script CPF_LA_policecutscene2
; Removed by Mick >>>> Obj_SetGroundOffset  -.102
Obj_StickToGround distAbove = 6 distBelow = 6
Obj_StickToGround off
Obj_SetConstantHeight
Obj_SetPathTurnDist 10 feet
Obj_PathHeading On
Obj_SetPathAcceleration 100 fpsps
Obj_SetPathDeceleration 100 fpsps
Obj_SetPathVelocity 95 fps
//      Start following the path that it's linked to
Wait 2.3 seconds
Obj_FollowPathLinked
Wait 2.1 seconds
Obj_PathHeading Off
Obj_Rotate relative = (0, 40, 0) time = .3
Wait .2 seconds
Obj_PlaySound LA_Skid_11  vol = 200 dropoff = 400
Wait 1 second
begin
if Obj_FlagSet BULLET_HIT clear
    Obj_Rotate relative = (0, 0, -1) time = .01
    Obj_PlaySound random (@Ricco1_11 @Ricco2_11)  vol = 200 dropoff = 300
    wait 1 frame
    Obj_Rotate relative = (0, 0, 1) time = .01
endif
wait 1 frame
repeat
endscript

Script CPF_Car_Cutscene
//      Setting up parameters
; Removed by Mick >>>> Obj_SetGroundOffset  1 inch
Obj_StickToGround distAbove = 6 distBelow = 6
Obj_SetPathTurnDist 10 feet
Obj_PathHeading Off
Obj_SetPathVelocity 75 fps
Obj_SetPathAcceleration 80 fpsps
//      Start following the path that it's linked to
//Wait 1 second
Obj_FollowPathLinked
//Wait 1 frame
Obj_PathHeading On
Obj_WaitMove
Die
Endscript

Script CPF_AP_Kart1
//      Setting up parameters
Obj_PlaySound la_carwash_brushes1 pitch=155 volume=100
; Removed by Mick >>>> Obj_SetGroundOffset .1 feet
Obj_StickToGround distAbove = 6 distBelow = 6
Obj_StickToGround off
Obj_SetConstantHeight
Obj_SetPathTurnDist 10 feet
Obj_PathHeading On
Obj_SetPathAcceleration 10 fpsps
Obj_SetPathDeceleration 20 fpsps
Obj_SetPathVelocity 25 fps
Obj_FollowPathLinked
Begin
if Obj_ObjectInRect dist = 10 width = 10 type = ped offset = ( 0, 0, 10 )
    //LaunchConsoleMessage "KART sees Pedestrian!!!"
    Obj_StopAlongPath
    Random (@Obj_PlaySound CarHorn_11 pitch=110 volume=200
            @Playstream Random(@Ap_cart_new_01
                                   @Ap_cart_new_02
                                   @Ap_cart_new_03
                                   @Ap_cart_new_04
                                   @Ap_cart_new_05
                                   @Ap_cart_new_06
                                   @Ap_cart_new_07
                                   @Ap_cart_new_08
                                   @Ap_cart_new_09
                                   @Ap_cart_new_10
                                   @Ap_cart_new_11
                                   )
            )
    Wait 5 seconds
    if Obj_ObjectInRect dist = 30 width = 15 type = ped offset = ( 0, 0, 10 )
        Obj_PlaySound CarHorn_11 pitch=110 volume=200
        Wait 10 frames
        Obj_PlaySound CarHorn_11 pitch=110 volume=200
        Wait 5 seconds
    Else
        Obj_StartAlongPath
    Endif
Else
    Obj_StartAlongPath
Endif
if Obj_ObjectInRect dist = 10 width = 10 type = skater offset = ( 0, 0, 10 )
    //LaunchConsoleMessage "KART sees Pedestrian!!!"
    Obj_StopAlongPath
    Random (@Obj_PlaySound CarHorn_11 pitch=110 volume=200
            @Playstream Random(@Ap_cart_new_01
                                   @Ap_cart_new_02
                                   @Ap_cart_new_03
                                   @Ap_cart_new_04
                                   @Ap_cart_new_05
                                   @Ap_cart_new_06
                                   @Ap_cart_new_07
                                   @Ap_cart_new_08
                                   @Ap_cart_new_09
                                   @Ap_cart_new_10
                                   @Ap_cart_new_11
                                   )
            )
    Wait 5 seconds
    if Obj_ObjectInRect dist = 30 width = 15 type = ped offset = ( 0, 0, 10 )
        Obj_PlaySound CarHorn_11 pitch=110 volume=200
        Wait 10 frames
        Obj_PlaySound CarHorn_11 pitch=110 volume=200
        Wait 5 seconds
    Else
        Obj_StartAlongPath
    Endif
Else
    Obj_StartAlongPath
Endif
Wait 5
Repeat
Endscript

Script CPF_AP_Kart2
//      Setting up parameters
; Removed by Mick >>>> Obj_SetGroundOffset .1 feet
Obj_StickToGround distAbove = 6 distBelow = 6
Obj_StickToGround off
Obj_SetConstantHeight
Obj_PathHeading Off
Obj_SetPathAcceleration 10 fpsps
Obj_SetPathDeceleration 20 fpsps
Obj_SetPathVelocity 25 fps
//Obj_FollowPath name = TRG_Baggage_KartNav01
Begin
if Obj_ObjectInRect dist = 10 width = 10 type = ped offset = ( 0, 0, 10 )
    //LaunchConsoleMessage "KART sees Pedestrian!!!"
    Obj_StopAlongPath
    Obj_PlaySound CarHorn_11 pitch=110 volume=200
    Wait 2 seconds
    if Obj_ObjectInRect dist = 30 width = 15 type = ped offset = ( 0, 0, 10 )
        Obj_PlaySound CarHorn_11 pitch=110 volume=200
        Wait 10 frames
        Obj_PlaySound CarHorn_11 pitch=110 volume=200
        Wait 2 seconds
    Else
        Obj_StartAlongPath
    Endif
Else
    Obj_StartAlongPath
Endif
Wait 5
Repeat
Endscript

Script Kart_Random_Sound
    Random (@Obj_PlaySound CarHorn_11 pitch=110 volume=200
            @Obj_Playstream Random(@Ap_cart_new_01
                                   @Ap_cart_new_02
                                   @Ap_cart_new_03
                                   @Ap_cart_new_04
                                   @Ap_cart_new_05
                                   @Ap_cart_new_06
                                   @Ap_cart_new_07
                                   @Ap_cart_new_08
                                   @Ap_cart_new_09
                                   @Ap_cart_new_10
                                   @Ap_cart_new_11
                                   )
            )
Endscript

Script CPF_AP_Kart_GoForward
Obj_WaitMove
Obj_WaitRotate
//Obj_PlaySound ap_beep
//LaunchConsoleMessage "Going Back"
Obj_FollowPath name = TRG_Baggage_KartNav16
Obj_Rotate relative = (0, 90, 0) time = 21
Endscript

Script CPF_AP_Kart_GoBack
Obj_WaitMove
Obj_WaitRotate
//Obj_StopSound
//LaunchConsoleMessage "Going Forward"
Obj_FollowPath name = TRG_Baggage_KartNav01
Obj_Rotate relative = (0, -90, 0) time = 21
Endscript

Script CPF_AP_WavyFingers
begin
Obj_Rotate absolute = (0, 0, 0) time = .2 FLAG_MAX_COORDS
wait .2 seconds
Obj_Rotate absolute = (-4, 0, 0) time = .2 FLAG_MAX_COORDS
wait .2 seconds
Obj_Rotate absolute = (-7, 0, 0) time = .2 FLAG_MAX_COORDS
wait .2 seconds
Obj_Rotate absolute = (-8, 0, 0) time = .2 FLAG_MAX_COORDS
wait .2 seconds
Obj_Rotate absolute = (-9, 0, 0) time = .2 FLAG_MAX_COORDS
wait .2 seconds
Obj_Rotate absolute = (-9, 0, 0) time = .2 FLAG_MAX_COORDS
wait .2 seconds                   
Obj_Rotate absolute = (-8, 0, 0) time = .2 FLAG_MAX_COORDS
wait .2 seconds
Obj_Rotate absolute = (-7, 0, 0) time = .2 FLAG_MAX_COORDS
wait .2 seconds
Obj_Rotate absolute = (-4, 0, 0) time = .2 FLAG_MAX_COORDS
wait .2 seconds
Obj_Rotate absolute = (0, 0, 0) time = .2 FLAG_MAX_COORDS
wait .2 seconds
Obj_Rotate absolute = (4, 0, 0) time = .2 FLAG_MAX_COORDS
wait .2 seconds
Obj_Rotate absolute = (7, 0, 0) time = .2 FLAG_MAX_COORDS
wait .2 seconds
Obj_Rotate absolute = (8, 0, 0) time = .2 FLAG_MAX_COORDS
wait .2 seconds
Obj_Rotate absolute = (9, 0, 0) time = .2 FLAG_MAX_COORDS
wait .2 seconds
Obj_Rotate absolute = (9, 0, 0) time = .2 FLAG_MAX_COORDS
wait .2 seconds                   
Obj_Rotate absolute = (8, 0, 0) time = .2 FLAG_MAX_COORDS
wait .2 seconds
Obj_Rotate absolute = (7, 0, 0) time = .2 FLAG_MAX_COORDS
wait .2 seconds
Obj_Rotate absolute = (4, 0, 0) time = .2 FLAG_MAX_COORDS
wait .2 seconds
repeat
Endscript
*/
script CPF_AutoAccel
////LaunchConsoleMessage "Speeding up"
Obj_AdjustSound CarLoop volumePercent = 100 volumeStep = 0.7 pitchPercent = 100 pitchStep = 0.7
Obj_SetPathVelocity 50 mph
endscript

script CPF_AutoDecel
////LaunchConsoleMessage "Slowing down"
Obj_AdjustSound CarLoop volumePercent = 80 volumeStep = 2 pitchPercent = 50 pitchStep = 1
Obj_SetPathVelocity 25
endscript

script CPF_ChaseCarCheckDistance
wait 10 gameframes
if Obj_ObjectInRect dist = 40 name = TRG_Looter_Car
    // //LaunchConsoleMessage "Too Close To Looter"
    Obj_SetPathVelocity 65 fps
    wait 20 gameframes
    Obj_SetPathVelocity 75 fps
endif
    if Obj_ObjectInRect dist = 20 name = TRG_Police_Car02
        // //LaunchConsoleMessage "Too Close To Police Car2"
        Obj_SetPathVelocity 65 fps
        wait 20 gameframes
        Obj_SetPathVelocity 75 fps
    endif
endscript

Script CPF_Chase180Left
////LaunchConsoleMessage "Pulling 180"
Obj_PlaySound Random (@CarBrakeSqueal @LA_Skid_11) Random (@Pitch=50 @Pitch=80 @Pitch=100 @Pitch=130) vol=50
//Obj_SetPathVelocity 15 mph
Obj_PathHeading Off
Obj_Rotate relative = (0, 0, 90) time = .3 FLAG_MAX_COORDS
Obj_WaitRotate
Obj_Rotate relative = (0, 0, 120) time = .4 FLAG_MAX_COORDS
Obj_WaitRotate
Obj_Rotate relative = (0, 0, -40) time = .2 FLAG_MAX_COORDS
Obj_WaitRotate
Obj_PlaySound Random (@CarBrakeSqueal @LA_Skid_11) Random (@Pitch=150 @Pitch=80 @Pitch=100 @Pitch=130) vol=30
Obj_Rotate relative = (0, 0, 15) time = .1 FLAG_MAX_COORDS
Obj_WaitRotate
Obj_Rotate relative = (0, 0, -5) time = .1 FLAG_MAX_COORDS
Obj_WaitRotate
Obj_PathHeading On
Obj_SetPathVelocity 75 mph
Endscript // CPF_Chase180Left

script CPF_ChaseTurnRight
////LaunchConsoleMessage "Turning Right"
//Obj_PlaySound Random (@CarBrakeSqueal @LA_Skid_11) Random (@Pitch=50 @Pitch=80 @Pitch=100 @Pitch=130) vol=50
Obj_SetPathVelocity 15 mph
Obj_PathHeading Off
Obj_Rotate relative = (0, 0, -120) time = .5 FLAG_MAX_COORDS
Obj_WaitRotate
Obj_Rotate relative = (0, 0, 40) time = .2 FLAG_MAX_COORDS
Obj_WaitRotate
//Obj_PlaySound Random (@CarBrakeSqueal @LA_Skid_11) Random (@Pitch=150 @Pitch=80 @Pitch=100 @Pitch=130) vol=30
Obj_Rotate relative = (0, 0, -15) time = .1 FLAG_MAX_COORDS
Obj_WaitRotate
Obj_Rotate relative = (0, 0, 5) time = .1 FLAG_MAX_COORDS
Obj_WaitRotate
Obj_PathHeading On
Obj_SetPathVelocity 75 mph
endscript

script CPF_ChaseTurnLeft
////LaunchConsoleMessage "Turning Right"
//printf "turning left hard.............................."
//Obj_PlaySound Random (@CarBrakeSqueal @LA_Skid_11) Random (@Pitch=50 @Pitch=80 @Pitch=100 @Pitch=130) vol=50
//Obj_SetPathVelocity 15 mph
Obj_PathHeading Off
Obj_Rotate relative = (0, 0, 120) time = .5 FLAG_MAX_COORDS
Obj_WaitRotate
Obj_Rotate relative = (0, 0, -40) time = .2 FLAG_MAX_COORDS
Obj_WaitRotate
//Obj_PlaySound Random (@CarBrakeSqueal @LA_Skid_11) Random (@Pitch=150 @Pitch=80 @Pitch=100 @Pitch=130) vol=30
Obj_Rotate relative = (0, 0, 15) time = .1 FLAG_MAX_COORDS
Obj_WaitRotate
Obj_Rotate relative = (0, 0, -5) time = .1 FLAG_MAX_COORDS
Obj_WaitRotate
Obj_PathHeading On
//Obj_SetPathVelocity 75 mph
endscript

/*
script CPF_ChaseAutoAccel
////LaunchConsoleMessage "Speeding up"
//Obj_AdjustSound CarLoop volumePercent = 100 volumeStep = 0.7 pitchPercent = 100 pitchStep = 0.7
Obj_SetPathVelocity 75 mph
endscript

script CPF_ChaseAutoDecel
////LaunchConsoleMessage "Slowing down"
//Obj_AdjustSound CarLoop volumePercent = 80 volumeStep = 2 pitchPercent = 50 pitchStep = 1
Obj_SetPathVelocity 25
endscript

Script Car_Squeal
// //LaunchConsoleMessage "Squeal tires"
Obj_PlaySound Random (@CarBrakeSqueal @LA_Skid_11) Random (@Pitch=50 @Pitch=80 @Pitch=100 @Pitch=130) vol=50
Endscript
*/
Script Car_HeightCheck
// //LaunchConsoleMessage "Sticking to Ground"
//printf "Car is checkinbg height"
Obj_StickToGround distAbove = 3 distBelow = 3
//Obj_StickToGround On
Endscript

Script Car_NoHeightCheck
// //LaunchConsoleMessage "Not Sticking to Ground"
//printf "Car is not checkinbg height"
Obj_StickToGround Off
Obj_SetConstantHeight
Endscript

/*
//      Others ---------------------------------------


Script CPF_Security_Gate
if IsCareerMode
    if GetGoal goal=GOAL_SCRIPTED1
    Else
        if QueryFlag GOT_TICKET name=TRG_GO_GotTicket
            ClearFlag GOT_TICKET name=TRG_GO_GotTicket
            LaunchPanelMessage "Ticket Voided"
            // LaunchLocalMessage id=T01 "`" panel_message_PickUpVoided
            PlaySound CPFSecurity_11 Vol=100 
        Endif
    Endif
Endif
PlaySound ap_scanner Vol=100 
wait 2 seconds
Endscript

Script CPF_Urinals
// LaunchPanelMessage "Stop That Person!!!" 1
PlaySound Flush2_11 Vol=100 
Endscript

 
//      Game Objects  ------------------------------------

Script CPF_AP_BustingVent TRGPname = TRGP_BustVent01
Kill name = <TRGPname>
Playsound la_gunshots2 pitch=50
Shatter name = <TRGPname> area = 10000 variance = 4.6 vel_x = Random (@0.0 @30 @-30) vel_y = Random (@10 @30 @50)  vel_z = Random (@0 @30 @-30) spread = 1.0
Endscript

Script CPF_AP_BustingFlag Flagname = TRGP_EndArea_Flag_01
//LaunchConsoleMessage "Flag Shatter"
Kill name = <Flagname>
Shatter name = <Flagname> area = 10000 variance = 4.6 vel_x = Random (@0.0 @50 @-50) vel_y = Random (@0 @50 @-50)  vel_z = Random (@0 @50 @-50) spread = .7
Endscript

Script CPF_ChopperChangeover
Kill name = EO_Chopper01
Kill name = EO_Chopper01a
Kill name = EO_Chopper03
Kill name = EO_Chopper02
Kill name = EO_Chopper02a
Kill name = EO_Chopper04
Create name = GO_Chopper01
Create name = GO_Chopper03
Kill prefix = "TRG_RailChopper"
//SendFlag name=TRG_GO_TerroristCounter AP_TERRORIST_HIT
//SendFlag name=TRG_GO_TerroristCounter AP_GUNSHIP_HIT
Endscript

Script CPF_Chopper_Leaving
Kill prefix = "TRG_RailChopper"
Playstream helitakeoff2
Obj_SetPathAcceleration 3 fpsps
Obj_SetPathVelocity 25 fps
Wait 2 seconds
Obj_PathHeading Off
Obj_FollowPathLinked
Obj_RotZ angle=5 speed=5
Obj_RotX angle=5 speed=5
Obj_WaitRotate
Kill name = EO_Chopper01b
Obj_RotZ angle=-10 speed=5
Obj_RotX angle=-10 speed=5
Obj_WaitRotate
Obj_RotZ angle=10 speed=5
Obj_RotX angle=10 speed=5
Obj_WaitRotate
Obj_RotZ angle=-10 speed=5
Obj_RotX angle=-10 speed=5
Obj_WaitRotate
Obj_RotZ angle=10 speed=5
Obj_RotX angle=10 speed=5
Obj_WaitRotate
Obj_RotZ angle=-10 speed=5
Obj_RotX angle=-10 speed=5
Obj_WaitRotate
Obj_RotZ angle=5 speed=5
Obj_RotX angle=5 speed=5
Obj_WaitMove
Kill name = GO_Chopper03
Die
Endscript

Script CPF_MovingWalkway
PAUSEPHYSICS 
SpawnSkaterScript MoveSkaterZ dist = 20
SpawnSkaterScript MoveSkaterx dist = 200
UNPAUSEPHYSICS 
//LaunchConsoleMessage "On Walkway2"
Endscript

Script CPF_AP_JetSound
Obj_Playsound ap_jetidle // pitch = 830 
Endscript

Script CPF_AP_PlaneLight
Obj_SetPathTurnDist 2.5 feet
// Obj_PathHeading On
Obj_SetPathAcceleration 500 fpsps
Obj_SetPathVelocity 150 fps
Obj_Playsound ap_prop pitch = 130
Obj_MoveToLink time = 3 second
Obj_Rotate time = .5 relative = ( 0, 0, 20 ) 
wait .5 second
Obj_Rotate time = 1 relative = ( 0, 0, -40 ) 
wait 1 second
Obj_Rotate time = .5 relative = ( 0, 0, 20 ) 
wait .5 second
Obj_Rotate time = .5 relative = ( -10, 0, 10 ) 
wait .5 second
Obj_Rotate time = .5 relative = ( -10, 0, -10 ) 
Obj_WaitMove
Obj_Rotate time = .1 relative = ( 20, 0, 0 ) 
Obj_MoveToLink time = 3 second
Obj_Playsound ap_jetland 
StopStream
wait 1.4 second
Playstream ap_planecrash2 vol=1000
wait 1 second
Die
Endscript

Script CPF_AP_PlaneLight2
Obj_SetPathTurnDist 2.5 feet
// Obj_PathHeading On
Obj_SetPathAcceleration 500 fpsps
Obj_SetPathVelocity 250 fps
//Obj_Playsound ap_prop pitch = 130
StopStream
wait .1 second
Playstream ap_planespin vol=200
Obj_MoveToLink time = 5 second
Obj_Rotate time = 1 relative = ( 0, 0, 180 ) 
Obj_WaitRotate
Obj_Rotate time = 1 relative = ( 0, 0, 180 ) 
Obj_WaitRotate
Obj_Rotate time = 1 relative = ( 0, 0, 180 ) 
Obj_WaitRotate
Obj_Rotate time = 1 relative = ( 0, 0, 180 ) 
Obj_WaitMove
Die
Endscript

script CPF_LA_RockingCar
begin
Obj_Rotate absolute = (0, 0, 0) time = .2 FLAG_MAX_COORDS
wait .2 seconds
Obj_Rotate absolute = (-1, 0, 0) time = .2 FLAG_MAX_COORDS
wait .2 seconds
Obj_Rotate absolute = (-2, 0, 0) time = .2 FLAG_MAX_COORDS
wait .2 seconds
Obj_Rotate absolute = (-5, 0, 0) time = .2 FLAG_MAX_COORDS
wait .2 seconds
Obj_Rotate absolute = (-9, 0, 0) time = .2 FLAG_MAX_COORDS
wait .2 seconds
Obj_Rotate absolute = (-14, 0, 0) time = .2 FLAG_MAX_COORDS
wait .2 seconds
Obj_Rotate absolute = (-18, 0, 0) time = .2 FLAG_MAX_COORDS
wait .2 seconds
Obj_Rotate absolute = (-21, 0, 0) time = .2 FLAG_MAX_COORDS
wait .2 seconds
Obj_Rotate absolute = (-23, 0, 0) time = .2 FLAG_MAX_COORDS
wait .2 seconds
Obj_Rotate absolute = (-24, 0, 0) time = .2 FLAG_MAX_COORDS
wait .2 seconds
Obj_Rotate absolute = (-23, 0, 0) time = .2 FLAG_MAX_COORDS
wait .2 seconds
Obj_Rotate absolute = (-21, 0, 0) time = .2 FLAG_MAX_COORDS
wait .2 seconds
Obj_Rotate absolute = (-18, 0, 0) time = .2 FLAG_MAX_COORDS
wait .2 seconds
Obj_Rotate absolute = (-14, 0, 0) time = .2 FLAG_MAX_COORDS
wait .2 seconds
Obj_Rotate absolute = (-9, 0, 0) time = .2 FLAG_MAX_COORDS
wait .2 seconds                   
Obj_Rotate absolute = (-5, 0, 0) time = .2 FLAG_MAX_COORDS
wait .2 seconds
Obj_Rotate absolute = (-2, 0, 0) time = .2 FLAG_MAX_COORDS
wait .2 seconds
Obj_Rotate absolute = (-1, 0, 0) time = .2 FLAG_MAX_COORDS
wait .2 seconds
Obj_PlayStream Random (@la_carguy_01 @la_carguy_02 @la_carguy_03 @la_carguy_04) Vol=120 dropoff=250
repeat
Endscript

script CPF_LA_FallingCar
Obj_SetPathAcceleration 12 fpsps
Obj_SetPathDeceleration 999 fpsps
Obj_SetPathVelocity 34 fps
wait .1 seconds
Obj_PathHeading Off
Obj_FollowPathLinked
wait .5 seconds
Obj_Rotate absolute = (-179, 0, 70) time = 2.5 FLAG_MAX_COORDS
//wait 2.5 seconds
PlayStream la_carguy_05
Obj_WaitMove
PlaySound la_gunshots2 Vol=300 pitch = 20
Obj_MoveToRelPos (0,10,0) time=.1
wait 0.1 seconds
Obj_MoveToRelPos (0,-10,0) time=.1
wait .3 seconds
PlaySound la_gunshots2 Vol=200 pitch = 35
Obj_MoveToRelPos (0,0,250) time=.2
Obj_Rotate relative = (10, -20, 0) time = .1
wait .1 seconds
Obj_Rotate relative = (5, -18, 0) time = .1
wait .1 seconds
Obj_Rotate relative = (2, -16, 0) time = .1
wait .1 seconds
Obj_Rotate relative = (1, -14, 0) time = .1
wait .1 seconds
Obj_Rotate relative = (-1, -12, 0) time = .1
wait .1 seconds
Obj_Rotate relative = (-2, -10, 0) time = .1
wait .1 seconds
Obj_Rotate relative = (-3, -8, 0) time = .1
wait .1 seconds
Obj_Rotate relative = (-2, -6, 0) time = .1
wait .1 seconds
Obj_Rotate relative = (-1, -4, 0) time = .1
wait .1 seconds
Obj_Rotate relative = (0, -3, 0) time = .1
wait .1 seconds
Obj_Rotate relative = (1, -2, 0) time = .1
wait .1 seconds
Obj_Rotate relative = (2, -1, 0) time = .1
wait .1 seconds
Obj_Rotate relative = (1, -1, 0) time = .1
Endscript

Script CPF_LA_FallingSign
Obj_SetPathAcceleration 22 fpsps
Obj_SetPathDeceleration 999 fpsps
Obj_SetPathVelocity 34 fps
wait .5 seconds
Obj_PathHeading Off
Obj_FollowPathLinked
//Obj_Rotate relative = (-30, 0, -0) time = 1.5 FLAG_MAX_COORDS
Obj_WaitMove
Obj_Rotate relative = (60, 0, -0) time = .5 FLAG_MAX_COORDS
Obj_MoveToRelPos (0,-10,0) time=.1
wait 0.1 seconds
Obj_MoveToRelPos (0,10,0) time=.1
wait .1 seconds
Obj_MoveToRelPos (0,5,0) time=.1
wait 0.1 seconds
Obj_MoveToRelPos (0,-5,0) time=.1
wait .2 seconds
Obj_Rotate relative = (-60, 0, -0) time = .5 FLAG_MAX_COORDS
wait .5 seconds
begin
Obj_Rotate relative = (-20, 0, -0) time = .2 FLAG_MAX_COORDS
wait .2 seconds
Obj_Rotate relative = (-10, 0, -0) time = .2 FLAG_MAX_COORDS
wait .2 seconds
Obj_Rotate relative = (-5, 0, -0) time = .2 FLAG_MAX_COORDS
wait .2 seconds
Obj_Rotate relative = (-2, 0, -0) time = .2 FLAG_MAX_COORDS
wait .4 seconds
Obj_Rotate relative = (2, 0, -0) time = .2 FLAG_MAX_COORDS
wait .2 seconds
Obj_Rotate relative = (5, 0, -0) time = .2 FLAG_MAX_COORDS
wait .2 seconds
Obj_Rotate relative = (10, 0, -0) time = .2 FLAG_MAX_COORDS
wait .2 seconds
Obj_Rotate relative = (20, 0, -0) time = .2 FLAG_MAX_COORDS
wait .2 seconds
Obj_Rotate relative = (20, 0, -0) time = .2 FLAG_MAX_COORDS
wait .2 seconds
Obj_Rotate relative = (10, 0, -0) time = .2 FLAG_MAX_COORDS
wait .2 seconds
Obj_Rotate relative = (5, 0, -0) time = .2 FLAG_MAX_COORDS
wait .2 seconds
Obj_Rotate relative = (2, 0, -0) time = .2 FLAG_MAX_COORDS
wait .4 seconds
Obj_Rotate relative = (-2, 0, -0) time = .2 FLAG_MAX_COORDS
wait .2 seconds
Obj_Rotate relative = (-5, 0, -0) time = .2 FLAG_MAX_COORDS
wait .2 seconds
Obj_Rotate relative = (-10, 0, -0) time = .2 FLAG_MAX_COORDS
wait .2 seconds
Obj_Rotate relative = (-20, 0, -0) time = .2 FLAG_MAX_COORDS
wait .2 seconds
repeat
Endscript

Script CPF_LA_FallingSign2
Obj_SetPathAcceleration 22 fpsps
Obj_SetPathDeceleration 999 fpsps
Obj_SetPathVelocity 34 fps
PlaySound Looter
wait .5 seconds
Obj_PathHeading Off
Obj_FollowPathLinked
Obj_Rotate relative = (-93, 30, -7) time = 1.5 FLAG_MAX_COORDS
Obj_WaitMove
Kill name = TRG_Looter_Car01
Kill name = Gun_Looter
Kill name = MuzzleFlash
Kill name = BulletPing01
Kill name = BulletPing02
// Kill name = BulletPing03
Kill name = BulletPing04
Kill name = BulletPing05
Create prefix = "Car_Looter_Dead"
PlaySound la_gunshots2 Vol=300 pitch = 20
Obj_MoveToRelPos (0,10,0) time=.1
wait 0.1 seconds
Obj_MoveToRelPos (0,-10,0) time=.1
wait .1 seconds
Obj_MoveToRelPos (0,5,0) time=.1
wait 0.1 seconds
Obj_MoveToRelPos (0,-5,0) time=.1
wait .2 seconds
PlaySound la_gunshots2 Vol=300 pitch = 40
wait .7 seconds
Endscript

Script CPF_LA_WireEast
wait .5 seconds
Obj_Rotate relative = (0, 27, -19) time = 1.6 FLAG_MAX_COORDS
Endscript

Script CPF_LA_WireWest
wait .5 seconds
Obj_Rotate relative = (0, -55.5, 12.5) time = 1.6 FLAG_MAX_COORDS
Endscript

Script CPF_LA_Spinning_Bristles
Obj_PlaySound la_carwash_brushes1
Obj_RotY speed=1000
Obj_PathHeading Off
Obj_SetPathAcceleration 12 fpsps
Obj_SetPathDeceleration 12 fpsps
Obj_SetPathVelocity 6 fps
Obj_FollowPathLinked
Endscript

BALL_SCRATCHED = 0

Script BallChecker
begin
if Obj_ObjectInRadius radius = 4 feet type = skater
    Obj_PlaySound la_gunshots2  vol = 100 pitch = 50
    Obj_SetFlag BALL_SCRATCHED
    MakeSkaterGoto SkaterCollideBall
    wait 4 seconds
else
    wait 2 frames 
endif
    wait 2 frames 
repeat
Endscript

Script CPF_LA_Ball01
// Obj_PlaySound CarLoop pitch=25 vol=60
wait 10 frames 
if IsCareerMode
    if GetGoal goal = GOAL_SCRIPTED3
    Else
        LaunchPanelMessage "1 Ball Free"
    Endif
Endif
Obj_RotY speed=-100
Obj_MoveToNode name = TRG_GO_BallNav01 speed = 10
Obj_WaitMove
Obj_MoveToNode name = TRG_GO_BallNav02 speed = 10
Obj_WaitMove
Obj_MoveToNode name = TRG_GO_BallNav03 speed = 15
Obj_RotY speed=-150
Obj_WaitMove
Obj_MoveToNode name = TRG_GO_BallNav04 speed = 15
Obj_WaitMove
Obj_MoveToNode name = TRG_GO_BallNav05 speed = 20
Obj_RotY speed=-250
Obj_WaitMove
Obj_SpawnScript BallChecker
Obj_PathHeading Off
Obj_SetPathAcceleration 2 fpsps
Obj_SetPathDeceleration 2 fpsps
Obj_SetPathVelocity 20 fps
begin 
Obj_MoveToNode name = TRG_GO_BallNav06 speed = 20
Obj_WaitMove
Obj_MoveToNode name = TRG_GO_BallNav07 speed = 15
Obj_RotY speed=-180
Obj_WaitMove
Obj_MoveToNode name = TRG_GO_BallNav08 speed = 10
Obj_RotY speed=-140
Obj_WaitMove
Obj_MoveToNode name = TRG_GO_BallNav09 speed = 5
Obj_RotY speed=-60
Obj_WaitMove
Obj_MoveToNode name = TRG_GO_BallNav12 speed = 2
Obj_RotY speed=-20
Obj_WaitMove
Obj_RotY speed=0
Wait 2 frames
Obj_MoveToNode name = TRG_GO_BallNav09 speed = 2
Obj_RotY speed=20
Obj_WaitMove
Obj_MoveToNode name = TRG_GO_BallNav08 speed = 5
Obj_RotY speed=60
Obj_WaitMove
Obj_MoveToNode name = TRG_GO_BallNav07 speed = 10
Obj_RotY speed=140
Obj_WaitMove
Obj_MoveToNode name = TRG_GO_BallNav06 speed = 15
Obj_RotY speed=220
Obj_WaitMove
Obj_MoveToNode name = TRG_GO_BallNav05 speed = 20
Obj_RotY speed=280
Obj_WaitMove
Obj_MoveToNode name = TRG_GO_BallNav10 speed = 15
Obj_RotY speed=220
Obj_WaitMove
Obj_MoveToNode name = TRG_GO_BallNav04 speed = 10
Obj_RotY speed=140
Obj_WaitMove
Obj_MoveToNode name = TRG_GO_BallNav11 speed = 5
Obj_RotY speed=60
Obj_WaitMove
Obj_MoveToNode name = TRG_GO_BallNav13 speed = 2
Obj_RotY speed=20
Obj_WaitMove
Obj_RotY speed=0
Wait 2 frames
Obj_MoveToNode name = TRG_GO_BallNav11 speed = 2
Obj_RotY speed=-20
Obj_WaitMove
Obj_MoveToNode name = TRG_GO_BallNav04 speed = 5
Obj_RotY speed=-60
Obj_WaitMove
Obj_MoveToNode name = TRG_GO_BallNav10 speed = 10
Obj_RotY speed=-140
Obj_WaitMove
Obj_MoveToNode name = TRG_GO_BallNav05 speed = 15
Obj_RotY speed=-220
Obj_WaitMove
repeat
Endscript

Script CPF_LA_Ball02
wait 10 frames 
if IsCareerMode
    if GetGoal goal = GOAL_SCRIPTED3
    Else
        LaunchPanelMessage "1 Ball Free"
    Endif
Endif
Obj_PlaySound CarLoop pitch=25 vol=60
Obj_RotY speed=-100
Obj_MoveToNode name = TRG_GO_BallNav20 speed = 10
Obj_WaitMove
Obj_MoveToNode name = TRG_GO_BallNav15 speed = 10
Obj_WaitMove
Obj_MoveToNode name = TRG_GO_BallNav16 speed = 15
Obj_RotY speed=-150
Obj_WaitMove
Obj_MoveToNode name = TRG_GO_BallNav17 speed = 15
Obj_WaitMove
Obj_MoveToNode name = TRG_GO_BallNav18 speed = 20
Obj_RotY speed=-280
Obj_WaitMove
Obj_SpawnScript BallChecker
begin 
Obj_MoveToNode name = TRG_GO_BallNav19 speed = 20
Obj_WaitMove
Obj_MoveToNode name = TRG_GO_BallNav14 speed = 15
Obj_RotY speed=-220
Obj_WaitMove
Obj_MoveToNode name = TRG_GO_BallNav21 speed = 10
Obj_RotY speed=-140
Obj_WaitMove
Obj_MoveToNode name = TRG_GO_BallNav22 speed = 5
Obj_RotY speed=-60
Obj_WaitMove
Obj_MoveToNode name = TRG_GO_BallNav25 speed = 2
Obj_RotY speed=-20
Obj_WaitMove
Obj_RotY speed=0
Wait 2 frames
Obj_MoveToNode name = TRG_GO_BallNav22 speed = 2
Obj_RotY speed=20
Obj_WaitMove
Obj_MoveToNode name = TRG_GO_BallNav21 speed = 5
Obj_RotY speed=60
Obj_WaitMove
Obj_MoveToNode name = TRG_GO_BallNav14 speed = 10
Obj_RotY speed=140
Obj_WaitMove
Obj_MoveToNode name = TRG_GO_BallNav19 speed = 15
Obj_RotY speed=220
Obj_WaitMove
Obj_MoveToNode name = TRG_GO_BallNav18 speed = 20
Obj_RotY speed=280
Obj_WaitMove
Obj_MoveToNode name = TRG_GO_BallNav23 speed = 15
Obj_RotY speed=220
Obj_WaitMove
Obj_MoveToNode name = TRG_GO_BallNav17 speed = 10
Obj_RotY speed=140
Obj_WaitMove
Obj_MoveToNode name = TRG_GO_BallNav24 speed = 5
Obj_RotY speed=60
Obj_WaitMove
Obj_MoveToNode name = TRG_GO_BallNav26 speed = 2
Obj_RotY speed=20
Obj_WaitMove
Obj_RotY speed=0
Wait 2 frames
Obj_MoveToNode name = TRG_GO_BallNav24 speed = 2
Obj_RotY speed=-20
Obj_WaitMove
Obj_MoveToNode name = TRG_GO_BallNav17 speed = 5
Obj_RotY speed=-60
Obj_WaitMove
Obj_MoveToNode name = TRG_GO_BallNav23 speed = 10
Obj_RotY speed=-140
Obj_WaitMove
Obj_MoveToNode name = TRG_GO_BallNav18 speed = 15
Obj_RotY speed=-220
Obj_WaitMove
repeat
Endscript

script CPF_LA_BlownLeaf
Obj_RotX speed = Random (@-240 @-140 @0 @140 @240)
Obj_RotY speed = Random (@-240 @-140 @0 @140 @240)
Obj_RotZ speed = Random (@-240 @-140 @0 @140 @240)
Random (
@
Obj_MoveToRelPos (0,20,0) time=.1
wait 0.1 seconds
Obj_MoveToRelPos (0,16,0) time=.1
wait 0.1 seconds
Obj_MoveToRelPos (0,12,0) time=.1
wait 0.1 seconds
Obj_MoveToRelPos (0,8,0) time=.1
wait 0.1 seconds
Obj_MoveToRelPos (0,4,0) time=.1
wait 0.1 seconds
Obj_MoveToRelPos (0,-4,0) time=.1
wait 0.1 seconds
Obj_MoveToRelPos (0,-8,0) time=.1
wait 0.1 seconds
Obj_MoveToRelPos (0,-12,0) time=.1
wait 0.1 seconds
Obj_MoveToRelPos (0,-16,0) time=.1
wait 0.1 seconds
Obj_MoveToRelPos (0,-20,0) time=.1
wait .1 seconds
@
Obj_MoveToRelPos (0,30,0) time=.12
wait 0.12 seconds
Obj_MoveToRelPos (0,20,0) time=.12
wait 0.12 seconds
Obj_MoveToRelPos (0,12,0) time=.12
wait 0.12 seconds
Obj_MoveToRelPos (0,5,0) time=.12
wait 0.12 seconds
Obj_MoveToRelPos (0,2,0) time=.12
wait 0.12 seconds
Obj_MoveToRelPos (0,-2,0) time=.12
wait 0.12 seconds
Obj_MoveToRelPos (0,-5,0) time=.12
wait 0.12 seconds
Obj_MoveToRelPos (0,-12,0) time=.12
wait 0.12 seconds
Obj_MoveToRelPos (0,-20,0) time=.12
wait 0.12 seconds
Obj_MoveToRelPos (0,-30,0) time=.12
wait .12 seconds
@
Obj_MoveToRelPos (0,15,0) time=.05
wait 0.05 seconds
Obj_MoveToRelPos (0,12,0) time=.05
wait 0.05 seconds
Obj_MoveToRelPos (0,8,0) time=.05
wait 0.05 seconds
Obj_MoveToRelPos (0,4,0) time=.05
wait 0.05 seconds
Obj_MoveToRelPos (0,2,0) time=.05
wait 0.05 seconds
Obj_MoveToRelPos (0,-2,0) time=.05
wait 0.05 seconds
Obj_MoveToRelPos (0,-4,0) time=.05
wait 0.05 seconds
Obj_MoveToRelPos (0,-8,0) time=.05
wait 0.05 seconds
Obj_MoveToRelPos (0,-12,0) time=.05
wait 0.05 seconds
Obj_MoveToRelPos (0,-15,0) time=.05
wait .05 seconds
@
Obj_MoveToRelPos (0,19,0) time=.08
wait 0.08 seconds
Obj_MoveToRelPos (0,13,0) time=.08
wait 0.08 seconds
Obj_MoveToRelPos (0,7,0) time=.08
wait 0.08 seconds
Obj_MoveToRelPos (0,4,0) time=.08
wait 0.08 seconds
Obj_MoveToRelPos (0,2,0) time=.08
wait 0.08 seconds
Obj_MoveToRelPos (0,-2,0) time=.08
wait 0.08 seconds
Obj_MoveToRelPos (0,-4,0) time=.08
wait 0.08 seconds
Obj_MoveToRelPos (0,-7,0) time=.08
wait 0.08 seconds
Obj_MoveToRelPos (0,-13,0) time=.08
wait 0.08 seconds
Obj_MoveToRelPos (0,-19,0) time=.08
wait .08 seconds
)
Die
Endscript

Script CPF_AP_Radar
begin
Obj_Rotate time = 2 absolute = ( 20, 180, 0 ) 
Obj_WaitRotate
Obj_Rotate time = 2 absolute = ( 20, 0, 0 ) 
Obj_WaitRotate
repeat
Endscript

Script CPF_AP_Chopper
begin
Obj_LookAtRelPos (0, 50, 0 ) time = 10000
Obj_MoveToRelPos (0, 250, 0 ) time = 10000
Obj_WaitMove
Obj_LookAtRelPos (50, 0, 0 ) time = 10000
Obj_MoveToRelPos (0, 250, 0 ) time = 10000
Obj_WaitMove
Obj_LookAtRelPos (0, -50, 0 ) time = 10000
Obj_MoveToRelPos (0, -250, 0 ) time = 10000
Obj_WaitMove
Obj_LookAtRelPos (-50, 0, 0 ) time = 10000
Obj_MoveToRelPos (0, -250, 0 ) time = 10000
Obj_WaitMove
repeat
Endscript

Script CPF_AP_Chopper_Rotor
begin
Obj_LookAtRelPos (0, 50, 0 ) time = 30
Obj_WaitRotate
Obj_LookAtRelPos (50, 0, 0 ) time = 30
Obj_WaitRotate
Obj_LookAtRelPos (0, -50, 0 ) time = 30
Obj_WaitRotate
Obj_LookAtRelPos (-50, 0, 0 ) time = 30
Obj_WaitRotate
repeat
Endscript


//       Anims --------------------------------------

//  Generic wait for camera to finish script
script CPF_WaitCamAnimFinished Cam=1 ; Default to 1
begin
    if CamAnimFinished Cam=<Cam>
        break
    endif    
    wait 1 gameframe
repeat
endscript


Script CPF_AP_CameraAnim1
// PlaySkaterCamAnim skater=0 name="Camera03"
wait 2 seconds
Endscript


//      Misc  -----------------------------------------


Script CPF_Lowrider
begin
Obj_PlaySound LowriderLoop Vol=800
wait 2.4 seconds
repeat
Endscript

Script CPF_GrateOpen
if InMultiplayerGame
    else
    Kill prefix = "GrateClosed"
    Kill prefix = "GrateOpen"
    Create prefix = "GrateOpen"
    Create prefix = "TRG_Rail_LibTop"
    wait 10 frames
    Playsound LA_GratesOpen vol=300
Endif    
Endscript

Script CPF_LA_North_Peds
if InMultiplayerGame
    else
    ////LaunchConsoleMessage "North pedestrians"
    Kill prefix = "TRG_Ped_South_"
    Kill prefix = "TRG_Ped_North_"
    Kill prefix = "GO_spinning_Bristles"
    Create prefix = "TRG_Ped_North_"
Endif    
Endscript

Script CPF_LA_South_Peds
if InMultiplayerGame
    else
    ////LaunchConsoleMessage "South pedestrians"
    Kill prefix = "TRG_Ped_South_"
    Kill prefix = "TRG_Ped_North_"
    Kill prefix = "GO_spinning_Bristles"
    Create prefix = "TRG_Ped_South_"
    Create prefix = "GO_spinning_Bristles"
Endif
Endscript

Script CPF_LA_CreateOverCars
if InMultiplayerGame
    else
    Create prefix = "TRG_CarOverpass"
Endif    
Endscript

Script CPF_LA_KillOverCars
if InMultiplayerGame
    else
    Kill prefix = "TRG_CarOverpass"
Endif    
Endscript

Script CPF_LA_Screenshots
// //LaunchConsoleMessage "Screenshot Version"
PlaySound GapSound Vol=100 
Create prefix = "TRG_Screen_"
PlaySound GoalDone Vol=100 
Endscript

Script CPF_Skater_Quake
Create name=TRG_Quaker
// CPF_LA_QuakeStart
Endscript

Script CPF_Skater_Movie
CarPlantAndMovies
Endscript

//      Sounds -------------------------------------------

Script CPF_AP_Sounds
Wait 2 seconds
Begin
Random (
    @PlayStream Random (
        @AP_Spkr01
        @AP_Spkr02
        @AP_Spkr03
        @AP_Spkr04
        @AP_Spkr04a
        @AP_Spkr05
        @AP_Spkr05a
        @AP_Spkr06
        @AP_Spkr07
        @AP_Spkr08
    ) 
    @PlaySound CPFjet_11 Vol=100 
    @PlaySound CPFheli Vol=100 Pitch=40
    @PlaySound CPFjet_11 Vol=100 
    @PlaySound CPFheli Vol=100 Pitch=40
)
Wait Random (@8 @15 @25) seconds
Repeat
endscript

Script CPF_LA_Fire
// begin
Wait 3 frames
Obj_PlaySound la_fire Vol=500 
// Wait 30 frames
// Obj_StopSound Fire01
// repeat
endscript

//      GOALS --------------------------------

// panel message types

panel_message_smallquake={
    font="trick.fnt"
    just=(0,0)
    dims=(600,112)
    colors=[
        {(128,128,128) alpha=128}
    ]
    key_points=[
        {pos=(320,124) alpha=128 scale=1 time=0}
        {pos=(315,134) alpha=128 scale=.5 time=.3}
        {pos=(320,124) alpha=128 scale=1.2 time=.6}
        {pos=(320,134) alpha=128 scale=1 time=.9}
        {pos=(330,114) alpha=128 scale=1 time=1.2}
        {pos=(310,134) alpha=128 scale=.7 time=1.5}
        {pos=(320,124) alpha=128 scale=1 time=1.8}
        {pos=(320,114) alpha=128 scale=1.2 time=2.1}
    ]
}

panel_message_quake={
    font="title.fnt"
    just=(0,0)
    dims=(600,112)
    colors=[
        {(128,0,0) alpha=128}
    ]
    key_points=[
        {pos=(320,224) alpha=128 scale=2 time=0}
        {pos=(315,234) alpha=128 scale=1.5 time=.1}
        {pos=(320,224) alpha=128 scale=2.2 time=.2}
        {pos=(320,234) alpha=128 scale=2 time=.3}
        {pos=(330,214) alpha=128 scale=2 time=.4}
        {pos=(310,234) alpha=128 scale=1.7 time=.5}
        {pos=(320,224) alpha=128 scale=2 time=.6}
        {pos=(320,214) alpha=128 scale=2.2 time=.7}
        {pos=(330,224) alpha=128 scale=2 time=.8}
        {pos=(320,234) alpha=128 scale=2 time=.9}
        {pos=(330,224) alpha=128 scale=1.5 time=1}
        {pos=(320,224) alpha=128 scale=2 time=0}
        {pos=(315,234) alpha=128 scale=1.5 time=.1}
        {pos=(320,224) alpha=128 scale=2.2 time=.2}
        {pos=(320,234) alpha=128 scale=2 time=.3}
        {pos=(330,214) alpha=128 scale=2 time=.4}
        {pos=(310,234) alpha=128 scale=1.7 time=.5}
        {pos=(320,224) alpha=128 scale=2 time=.6}
        {pos=(320,214) alpha=128 scale=2.2 time=.7}
        {pos=(330,224) alpha=128 scale=2 time=.8}
        {pos=(320,234) alpha=128 scale=2 time=.9}
        {pos=(330,224) alpha=128 scale=1.5 time=1}
        {pos=(320,224) alpha=128 scale=2 time=0}
        {pos=(315,234) alpha=128 scale=1.5 time=.1}
        {pos=(320,224) alpha=128 scale=2.2 time=.2}
        {pos=(320,234) alpha=128 scale=2 time=.3}
        {pos=(330,214) alpha=128 scale=2 time=.4}
        {pos=(310,234) alpha=128 scale=1.7 time=.5}
        {pos=(320,224) alpha=128 scale=2 time=.6}
        {pos=(320,214) alpha=128 scale=2.2 time=.7}
        {pos=(330,224) alpha=128 scale=2 time=.8}
        {pos=(320,234) alpha=128 scale=2 time=.9}
        {pos=(330,224) alpha=128 scale=1.5 time=1}
    ]
}

// flags

LEVEL_QUAKE_01 = 0
LEVEL_QUAKE_02 = 1
LEVEL_QUAKE_03 = 2
LEVEL_QUAKE_04 = 3

script CPF_QuakeChecker
begin
if Obj_FlagSet LEVEL_QUAKE_01
    Wait 1 frame
    if Obj_FlagSet LEVEL_QUAKE_02
        Wait 1 frame
        if Obj_FlagSet LEVEL_QUAKE_03
            Wait 1 frame
            if Obj_FlagSet LEVEL_QUAKE_04
                Wait 1 frame
//                MakeSkaterGoto CPF_Skater_Quake
//                if InMultiplayerGame
//                Wait 1 frame
//                Else                  
                spawnscript CPF_StartEarthquake NetEnabled=1 Permanent=1
//                Endif
                  break
            endif
        endif
    endif
endif
Wait 10 frames
repeat
//printf "exiting loop"
Endscript


Script CPF_QuakeIncrease
wait 1 frame
Vibrate Actuator=1 Percent=90 s duration=2
PlaySound Random (@la_rebar1 @la_rebar2)
Endscript

script CPF_StartEarthquake
// //LaunchConsoleMessage "Quake!"
spawnscript CPF_Skater_Quake
endscript

Script CPF_StartNorthernQuake
// //LaunchConsoleMessage "Quake Increase"
LaunchPanelMessage "Northern Quake Rail!"  properties = panel_message_smallquake
//printf "Gap Hit"
PlaySound LA_quake1_rumble
PlaySound Random (@la_rebar1 @la_rebar2)
Vibrate Actuator=1 Percent=62 duration=.3
Create name = Quake_North
Endscript

Script CPF_StartSouthernQuake
// //LaunchConsoleMessage "Quake Increase"
LaunchPanelMessage "Southern Quake Rail!"  properties = panel_message_smallquake
PlaySound LA_quake1_rumble 
PlaySound Random (@la_rebar1 @la_rebar2)
Vibrate Actuator=1 Percent=62 duration=.3
Create name = Quake_South
Endscript

Script CPF_StartEasternQuake
// //LaunchConsoleMessage "Quake Increase"
LaunchPanelMessage "Eastern Quake Rail!"  properties = panel_message_smallquake
PlaySound LA_quake1_rumble 
PlaySound Random (@la_rebar1 @la_rebar2)
Vibrate Actuator=1 Percent=62 duration=.3
Create name = Quake_East
Endscript

Script CPF_StartWesternQuake
// //LaunchConsoleMessage "Quake Increase"
LaunchPanelMessage "Western Quake Rail!"  properties = panel_message_smallquake
PlaySound LA_quake1_rumble 
PlaySound Random (@la_rebar1 @la_rebar2)
Vibrate Actuator=1 Percent=62 duration=.3
Create name = Quake_West
Endscript

Script CPF_Quake_North
//printf "QuakeNorth"
// //LaunchConsoleMessage "Northern Quake"
Wait 1 frame
SendFlag prefix = "Quake_Check" LEVEL_QUAKE_01
Endscript

Script CPF_Quake_South
// //LaunchConsoleMessage "Southern Quake"
Wait 1 frame
SendFlag prefix = "Quake_Check" LEVEL_QUAKE_02
Endscript

Script CPF_Quake_East
// //LaunchConsoleMessage "Eastern Quake"
Wait 1 frame
SendFlag prefix = "Quake_Check" LEVEL_QUAKE_03
Endscript

Script CPF_Quake_West
// //LaunchConsoleMessage "Western Quake"
Wait 1 frame
SendFlag prefix = "Quake_Check" LEVEL_QUAKE_04
Endscript

Script CPF_LA_QuakeStart
Spawnscript CPF_LA_QuakeStart2
Endscript

Script CPF_LA_QuakeStart2 id=quakescript
//printf "Quake01"
//SetFlag flag=DELAY_END_STUFF
if IsCareerMode
//    Got_Scripted1 
Endif
If InSplitScreenGame
Else
    // LaunchLocalMessage "EarthQuake!!"  panel_message_quake
Endif
//LaunchConsoleMessage "starting the quake"
Wait 1 frame
PlaySound GapSound Vol=100 
Kill prefix = "TRG_RailGoodOverpass"
Kill prefix = "TRG_CarOverpass"
Kill prefix = "TRGP_Over_Car"
Kill prefix = "TRGP_Overpass_Killer"
Kill prefix = "ADestroyed_"
Kill prefix = "carwash_destroyed_"
Wait 1 frame
// tell pedestrians to panic
//if IsCareerMode
if InMultiplayerGame
Else    
    SendFlag prefix = "TRG_Ped_" PED_IN_PANIC
endif
// Vibrate Actuator=1 Percent=62       
PlaySound  LA_quake1_rumble 
wait .1 seconds
PlayStream quake3_big
// turn on particle systems
SetParticleSysVisibility system="Qke_Particle01" visible=1
SetParticleSysVisibility system="Qke_Particle02" visible=1
SetParticleSysVisibility system="Qke_Particle03" visible=1
SetParticleSysVisibility system="Qke_Particle04" visible=1
SetParticleSysVisibility system="Qke_Particle05" visible=1
SetParticleSysVisibility system="Qke_Particle06" visible=1
SetParticleSysVisibility system="Qke_Particle07" visible=1
SetParticleSysVisibility system="Qke_Particle08" visible=1
SetParticleSysVisibility system="Qke_Particle09" visible=1
SetParticleSysVisibility system="Qke_Particle10" visible=1
SetParticleSysVisibility system="Qke_Particle11" visible=1
SetParticleSysVisibility system="Qke_Particle12" visible=1
SetParticleSysVisibility system="Qke_Particle13" visible=1
SetParticleSysVisibility system="Qke_Particle14" visible=1
SetParticleSysVisibility system="Qke_Particle15" visible=1
SetParticleSysVisibility system="Qke_Particle16" visible=1
SetParticleSysVisibility system="Qke_Particle17" visible=1
//LaunchConsoleMessage "Creating destroyed overpass"
Create prefix = "ADestroyed_"
Kill prefix = "Overpass_Good"
Kill prefix = "carwash_good_"
Create prefix = "carwash_destroyed_"
Create prefix = "Destroyed_"
Wait 1 seconds
PlaySound Random (@la_rebar1 @la_rebar2)
Create prefix = "Destroyed_"
Wait 1 seconds
// PlayStream  LA_quake1_rumble 
PlaySound  LA_quake1_rumble pitch = 25
Create prefix = "Destroyed_"
Wait 1 seconds
Create prefix = "Destroyed_"
Wait 1 seconds
Create prefix = "Rubble01_"
Create prefix = "Destroyed_"
Wait 1 seconds
PlaySound Random (@la_rebar1 @la_rebar2)
Create prefix = "Rubble02_"
Create prefix = "Destroyed_"
PlaySound  LA_quake1_rumble 
// PlayStream  LA_quake1_rumble pitch = 50 
Wait 1 seconds
Create prefix = "Destroyed_"
Wait 1 seconds
// Vibrate Off
SetFlag flag=LA_QUAKE_DONE
//LaunchConsoleMessage "Killing and Creating"
Wait 1 frame
Create prefix = "Overpass_Destroyed"
Create prefix = "TRG_Rail_Overpass"
Create name = TRG_SignGetToRail
if IsCareerMode
//    Got_Scripted1 
    Create name = TRG_Rail_KenCar
    Create name = TRGP_CarFall_E
    Create name = TRGP_CarFall_W
    Create name = Overpass_Car_Rocking
Endif
Kill prefix = "ADestroyed_"
Create prefix = "Destroyed_"
Wait 1 seconds
Create prefix = "Destroyed_"
Wait 1 seconds
// turn off particle systems
SetParticleSysVisibility system="Qke_Particle02" visible=0
SetParticleSysVisibility system="Qke_Particle03" visible=0
SetParticleSysVisibility system="Qke_Particle04" visible=0
SetParticleSysVisibility system="Qke_Particle05" visible=0
SetParticleSysVisibility system="Qke_Particle06" visible=0
SetParticleSysVisibility system="Qke_Particle07" visible=0
SetParticleSysVisibility system="Qke_Particle08" visible=0
SetParticleSysVisibility system="Qke_Particle09" visible=0
SetParticleSysVisibility system="Qke_Particle10" visible=0
SetParticleSysVisibility system="Qke_Particle11" visible=0
SetParticleSysVisibility system="Qke_Particle12" visible=0
SetParticleSysVisibility system="Qke_Particle13" visible=0
SetParticleSysVisibility system="Qke_Particle14" visible=0
SetParticleSysVisibility system="Qke_Particle15" visible=0
SetParticleSysVisibility system="Qke_Particle16" visible=0
SetParticleSysVisibility system="Qke_Particle17" visible=0
Kill name = TRGP_NorthTremor_E
Kill name = TRGP_NorthTremor_W
Kill name = TRGP_SouthTremor_E
Kill name = TRGP_SouthTremor_W
Kill name = TRGP_EastTremor_N
Kill name = TRGP_EastTremor_S
Kill name = TRGP_WestTremor_N
Kill name = TRGP_WestTremor_S
Create name = TRGP_NorthTremor_E01
Create name = TRGP_NorthTremor_W01
Create name = TRGP_SouthTremor_E01
Create name = TRGP_SouthTremor_W01
Create name = TRGP_EastTremor_N01
Create name = TRGP_EastTremor_S01
Create name = TRGP_WestTremor_N01
Create name = TRGP_WestTremor_S01
Wait 3 seconds
if InMultiplayerGame
Else    
//if IsCareerMode
    ClearFlag prefix = "TRG_Ped_" PED_IN_PANIC
endif
Endscript

Script CPF_LA_Secret_Tape
Obj_RotY speed=200
endscript

Script CPF_LA_SKATE_Letter_S
Obj_RotY speed=200
endscript

Script CPF_LA_SKATE_Letter_K
Obj_RotY speed=200
endscript

Script CPF_LA_SKATE_Letter_A
Obj_RotY speed=200
endscript

Script CPF_LA_SKATE_Letter_T
Obj_RotY speed=200
endscript

Script CPF_LA_SKATE_Letter_E
Obj_RotY speed=200
endscript

Script CPF_StopThieves
Playsound GapSound
//        MakeSkaterGoto FreezeSkater          
PauseSkaters 
SetParticleSysVisibility system="Qke_Particle01" visible=0
Kill name = Overpass_Car_Falling
Kill name = Overpass_Car_Rocking
Kill name = GO_FallingSign
Kill prefix = "TRG_Police_Car"
Kill name = TRG_Looter_Car
Kill name = TRG_Looter_Car01
Kill name = TRG_Cutscene_Police01
Kill name = TRG_Cutscene_Police02
Kill name = TRG_Rail_KenCar
Kill name = TRGP_CarFall_E
Kill name = TRGP_CarFall_W
Kill name = FallingSign
Kill name = GO_FallingSign2
Kill name = GO_WireEast
Kill name = GO_WireWest
Create name = Overpass_Car_Falling
Create name = GO_FallingSign
Create name = GO_WireEast
Create name = GO_WireWest
Create name = TRG_Rail_Sign01
Create name = TRG_Rail_Sign02
VibrationOff
PlaySkaterCamAnim skater=0 name="Cam_Thieves"
Create name = TRG_Looter_Car01
Create name = TRG_Cutscene_Police01
Create name = TRG_Cutscene_Police02
//WaitForSkippable
//wait 20 frames
SetSkaterCamAnimSkippable skater=0 skippable=1
begin
    if SkaterCamAnimFinished skater = 0 name = "Cam_Thieves"
        break
    endif    
    wait 1 gameframe
repeat
//Got_Scripted2
SetGlobalFlag flag=SKATESHOP_JUST_GOT_LEVEL7_GOAL 
Kill name = Overpass_Car_Falling
Create prefix = "DestroyedCar_Geometry"
VibrationOn
UnPauseSkaters 
Endscript

Script CPF_StopThieves2
Playsound GapSound
Kill name = GO_FallingSign
Kill name = GO_FallingSign2
Kill name = TRG_Rail_Sign01
Kill name = TRG_Rail_Sign02
Create name = GO_FallingSign2
VibrationOff 
//PlaySkaterCamAnim skater=0 name="Cam_Thieves2"
//WaitForSkippable
// wait 20 frames
SetSkaterCamAnimSkippable skater=0 skippable=1
begin
    if SkaterCamAnimFinished skater = 0 name = "Cam_Thieve2"
        break
    endif    
    wait 1 gameframe
repeat
VibrationOn
Kill name = GO_FallingSign2
Create name = FallingSign01
Create name = FallingSign03
Kill name = TRG_Looter_Car01
Kill name = Gun_Looter
Kill name = MuzzleFlash
Kill name = BulletPing01
Kill name = BulletPing02
Kill name = BulletPing04
Kill name = BulletPing05
Kill prefix = "Car_Looter_Dead"
Create prefix = "Car_Looter_Dead"
//Got_Scripted2 
Endscript


CROWD_MOOD_A = 0
CROWD_MOOD_B = 1
CROWD_MOOD_C = 2
CROWD_MOOD_D = 3

Script CrowdCheers
Obj_SetException Ex=SkaterLanded Scr=CrowdSeesTrick params = {<...>}
Obj_SetException Ex=SkaterBailed Scr=CrowdSeesBail params = {<...>}
Obj_SetFlag CROWD_MOOD_C
GotoPreserveParams CrowdIsWaiting
Endscript

Script CrowdIsWaiting
Wait 3 seconds
Obj_SetException Ex=SkaterLanded Scr=CrowdSeesTrick params = {<...>}
Obj_SetException Ex=SkaterBailed Scr=CrowdSeesBail params = {<...>}
Begin
//LaunchConsoleMessage "Crowd is Waiting"
Wait 1 second
if SkaterCurrentScorePotGreaterThan 500
PlaySound Random (@crowdI01 @crowdI02)
Wait 1 second
if SkaterCurrentScorePotGreaterThan 1500
PlaySound Random (@crowdM01 @crowdM02)
Wait 1 second
if SkaterCurrentScorePotGreaterThan 3500
PlaySound Random (@crowdB01 @crowdB02)
Wait 1 second
if SkaterCurrentScorePotGreaterThan 5500
PlaySound Random (@crowdA01 @crowdA02)
Wait 1 second
Endif
Endif
Endif
Endif
Repeat
Endscript

Script CrowdSeesTrick
// //LaunchConsoleMessage "Saw trick"
Obj_ClearExceptions
Obj_SetException Ex=SkaterBailed Scr=CrowdSeesBail params = {<...>}
if Obj_FlagSet CROWD_MOOD_A // Wicked Stoked
    if SkaterLastScoreLandedGreaterThan 10000
        //LaunchConsoleMessage "A - IMPRESSED!"
        PlaySound Random (@crowdA01 @crowdA02)
        PlaySound Random (@crowdG01 @crowdG02)
        wait 2 seconds
        PlaySound Random (@crowdB01 @crowdB02)
        PlaySound Random (@crowdI01 @crowdI02)
        wait 2 seconds
        PlaySound Random (@crowdM01 @crowdM02)
        PlaySound Random (@crowdI01 @crowdI02)
    Else 
        if SkaterLastScoreLandedGreaterThan 2000
            //LaunchConsoleMessage "A - Not Bad!"
            PlaySound Random (@crowdA01 @crowdA02)
        Else
            if SkaterLastScoreLandedGreaterThan 200
                //LaunchConsoleMessage "A - Whatever"
                PlaySound Random (@crowdB01 @crowdB02)
            Endif
        Endif
    Endif
    GotoPreserveParams CrowdIsWaiting
Endif
if Obj_FlagSet CROWD_MOOD_B // Stoked
    if SkaterLastScoreLandedGreaterThan 10000
        //LaunchConsoleMessage "B - IMPRESSED!"
        PlaySound Random (@crowdA01 @crowdA02)
        PlaySound Random (@crowdI01 @crowdI02)
        Obj_SetFlag CROWD_MOOD_A
        Obj_ClearFlag CROWD_MOOD_B
    Else 
        if SkaterLastScoreLandedGreaterThan 2000
            //LaunchConsoleMessage "B - Not Bad!"
            PlaySound Random (@crowdB01 @crowdB02)
            PlaySound Random (@crowdI01 @crowdI02)
        Else
            if SkaterLastScoreLandedGreaterThan 200
                //LaunchConsoleMessage "B - Whatever"
                PlaySound Random (@crowdM01 @crowdM02)
            Endif
        Endif
    Endif
    GotoPreserveParams CrowdIsWaiting
Endif
if Obj_FlagSet CROWD_MOOD_C // Whatever
    if SkaterLastScoreLandedGreaterThan 5000
        //LaunchConsoleMessage "C - IMPRESSED!"
        PlaySound Random (@crowdB01 @crowdB02)
        PlaySound Random (@crowdK01 @crowdK02)
        Obj_SetFlag CROWD_MOOD_B
        Obj_ClearFlag CROWD_MOOD_C
    Else 
        if SkaterLastScoreLandedGreaterThan 1500
            //LaunchConsoleMessage "B - Not Bad!"
            PlaySound Random (@crowdM01 @crowdM02)
        Else
            if SkaterLastScoreLandedGreaterThan 200
                //LaunchConsoleMessage "B - Whatever"
                PlaySound Random (@crowdM01 @crowdM02)
            Endif
        Endif
    Endif
    GotoPreserveParams CrowdIsWaiting
Endif
if Obj_FlagSet CROWD_MOOD_D // Bored
    if SkaterLastScoreLandedGreaterThan 1000
        //LaunchConsoleMessage "D - IMPRESSED!"
        PlaySound Random (@crowdM01 @crowdM02)
        Obj_SetFlag CROWD_MOOD_C
        Obj_ClearFlag CROWD_MOOD_D
    Else 
        if SkaterLastScoreLandedGreaterThan 500
            //LaunchConsoleMessage "D - Not Bad!"
            PlaySound Random (@crowdM01 @crowdM02)
        Else
            if SkaterLastScoreLandedGreaterThan 100
                //LaunchConsoleMessage "D - Whatever"
                PlaySound Random (@crowdM01 @crowdM02)
            Endif
        Endif
    Endif
    GotoPreserveParams CrowdIsWaiting
Endif
GotoPreserveParams CrowdIsWaiting
Endscript

Script CrowdSeesBail params = <...>
Obj_ClearExceptions
if Obj_FlagSet CROWD_MOOD_A // Wicked Stoked
    PlaySound Random (@crowdF01 @crowdF03)
    wait 1 seconds
    PlaySound Random (@crowdL01 @crowdL03)
    Obj_SetFlag CROWD_MOOD_B
    Obj_ClearFlag CROWD_MOOD_A
    GotoPreserveParams CrowdIsWaiting
Endif
if Obj_FlagSet CROWD_MOOD_B
    PlaySound Random (@crowdL01 @crowdL03)
    wait 1 seconds
    PlaySound Random (@crowdL01 @crowdL03)
    Obj_SetFlag CROWD_MOOD_C
    Obj_ClearFlag CROWD_MOOD_B
    GotoPreserveParams CrowdIsWaiting
Endif
if Obj_FlagSet CROWD_MOOD_C
    PlaySound Random (@crowdL01 @crowdL03)
    wait 1 seconds
    PlaySound Random (@crowdE01 @crowdE02)
    Obj_SetFlag CROWD_MOOD_D
    Obj_ClearFlag CROWD_MOOD_C
    GotoPreserveParams CrowdIsWaiting
Endif
if Obj_FlagSet CROWD_MOOD_D
    PlaySound Random (@crowdE01 @crowdE02)
    wait 1 seconds
    PlaySound Random (@crowdE01 @crowdE02)
    GotoPreserveParams CrowdIsWaiting
Endif
wait 10 seconds
GotoPreserveParams CrowdIsWaiting
Endscript

Script CPF_SquashPerson
Obj_ApplyScaling x=1.5 y=0.1 z=1.5
PauseSkaters
Wait 3 second
UnPauseSkaters
Obj_ApplyScaling x=1.0 y=1.0 z=1.0
Endscript

Script CPF_LA_Siren
Playstream la_siren
Endscript

Script CPF_PlayPhone
Playsound ap_phone2
Endscript

Script CPF_LA_TheaterSound
Wait 3 frames
Obj_PlaySound la_porn_no_sex
//Obj_PlaySound la_porn_sex_only
endscript


Script CPF_AP_BailCheck
//LaunchConsoleMessage "Checking Bail"
if GetGoal goal = GOAL_SCRIPTED1
Else
if IsInBail
    //LaunchConsoleMessage "Bailed"
    if QueryFlag GOT_TICKET name=TRG_GO_GotTicket
        ClearFlag name=TRG_GO_GotTicket GOT_TICKET
        LaunchPanelMessage "Dropped the Tickets while Bailing" properties=panel_message_goalcomplete
        // LaunchLocalMessage id=T01 "`" panel_message_PickUpDropped
        Create name=Tickets
    Endif
Endif
Endif
Endscript

Script CPF_AP_GotTicket
if IsCareerMode
    if GetGoal goal = GOAL_SCRIPTED1
    Else    
        //LaunchConsoleMessage "Got the tickets?"
        if IsAlive name=TRG_GO_GotTicket
            if QueryFlag GOT_TICKET name=TRG_GO_GotTicket
            Else    
                SendFlag name=TRG_GO_GotTicket GOT_TICKET
                Playsound GoalDone
                LaunchPanelMessage "Got the Tickets" properties=panel_message_goalcomplete
                // LaunchLocalMessage id=T01 "`" panel_message_PickUp
                Kill name=Tickets
            Endif
        Endif
    Endif
Endif
Endscript

Script CPF_AP_Xray
DoFlash duration = 0.05 start_r = 250 start_g = 250 start_b = 250 start_a = 250 end_r = 250 end_g = 250 end_b = 250 end_a = 0
Playsound hud_jumpgap
wait 3 frames
DoFlash duration = 0.05 start_r = 250 start_g = 250 start_b = 250 start_a = 250 end_r = 250 end_g = 250 end_b = 250 end_a = 0
Playsound hud_jumpgap
wait 3 frames
DoFlash duration = 0.05 start_r = 250 start_g = 250 start_b = 250 start_a = 250 end_r = 250 end_g = 250 end_b = 250 end_a = 0
Playsound hud_jumpgap
wait 3 frames
DoFlash duration = 0.05 start_r = 250 start_g = 250 start_b = 250 start_a = 250 end_r = 250 end_g = 250 end_b = 250 end_a = 0
Playsound hud_jumpgap
wait 3 frames
DoFlash duration = 0.05 start_r = 250 start_g = 250 start_b = 250 start_a = 250 end_r = 250 end_g = 250 end_b = 250 end_a = 0
Playsound hud_jumpgap
wait 3 frames
DoFlash duration = 1.05 start_r = 250 start_g = 250 start_b = 250 start_a = 150 end_r = 250 end_g = 250 end_b = 250 end_a = 0
Playsound hud_jumpgap
StartGap GapID=XRAYGap
wait 1 frame
EndGap GapID=XRAYGap text="X-RAY" score=100
Endscript

//      Gaps  ---------------------------------------------

GOT_TICKET = 0

// AIRPORT GAPS

Script CPF_Walkway1
StartGap GapID=AP_Walkway1to2 flags = [Cancel_Ground]
EndGap GapID=AP_Walkway2to1 gapscript = CPF_WalkwayGap
Endscript
Script CPF_Walkway2
StartGap GapID=AP_Walkway2to1 flags = [Cancel_Ground]
EndGap GapID=AP_Walkway1to2 gapscript = CPF_WalkwayGap
Endscript
Script CPF_WalkwayGap
StartGap GapID=CF_Walkway
Wait 1 frame
EndGap GapID=CF_Walkway text="Walkway Hop" score=50 
Endscript

Script CPF_Couches1
StartGap GapID=AP_Couches1to2 flags = [Cancel_Ground]
EndGap GapID=AP_Couches2to1 gapscript = CPF_CouchesGap
Endscript
Script CPF_Couches2
StartGap GapID=AP_Couches2to1 flags = [Cancel_Ground]
EndGap GapID=AP_Couches1to2 gapscript = CPF_CouchesGap
Endscript
Script CPF_CouchesGap
StartGap GapID=CF_Couches
Wait 1 frame
EndGap GapID=CF_Couches text="Off the Couch" score=100
Endscript

Script CPF_Escalator1
StartGap GapID=AP_Escalator1to2 flags = [Cancel_Ground]
EndGap GapID=AP_Escalator2to1 gapscript = CPF_EscalatorGap
Endscript
Script CPF_Escalator2
StartGap GapID=AP_Escalator2to1 flags = [Cancel_Ground]
EndGap GapID=AP_Escalator1to2 gapscript = CPF_EscalatorGap
Endscript
Script CPF_EscalatorGap
StartGap GapID=CPF_Escalator
Wait 1 frame
EndGap GapID=CPF_Escalator text="Escalator Hop" score=50 
Endscript

Script CPF_HeloBaggage1
StartGap GapID=CPF_HeloBaggage1to2 flags = [Cancel_Ground]
EndGap GapID=CPF_HeloBaggage2to1 gapscript = CPF_HeloBaggageGap
//printf "helo baggage 1"
Endscript
Script CPF_HeloBaggage2
StartGap GapID=CPF_HeloBaggage2to1 flags = [Cancel_Ground]
EndGap GapID=CPF_HeloBaggage1to2 gapscript = CPF_HeloBaggageGap
//printf "helo baggage 2"
Endscript
Script CPF_HeloBaggageGap
StartGap GapID=CPF_HeloBaggage
Wait 1 frame
EndGap GapID=CPF_HeloBaggage text="Heliport Baggage" score=50 
Endscript

Script CPF_APRailHop1
StartGap GapID=APRailHop1to2 flags = [Cancel_Ground]
EndGap GapID=APRailHop2to1 gapscript = APRailHopGap
Endscript
Script CPF_APRailHop2
StartGap GapID=APRailHop2to1 flags = [Cancel_Ground]
EndGap GapID=APRailHop1to2 gapscript = APRailHopGap
Endscript
Script APRailHopGap
StartGap GapID=APRailHop
Wait 1 frame
EndGap GapID=APRailHop text="Rail Hop" score=50 
Endscript
Script CPF_LowHangLight1
StartGap GapID=LowHangLight1to2 flags = [Cancel_Ground]
EndGap GapID=LowHangLight2to1 gapscript = CPF_LowHangLightGap
StartGap GapID=LightPop1to2 flags = [Cancel_Ground]
EndGap GapID=LightPop2to1 gapscript = CPF_LightPopGap
Endscript
Script CPF_LowHangLight2
StartGap GapID=LowHangLight2to1 flags = [Cancel_Ground]
EndGap GapID=LowHangLight1to2 gapscript = CPF_LowHangLightGap
StartGap GapID=LightPop1to2 flags = [Cancel_Ground]
EndGap GapID=LightPop2to1 gapscript = CPF_LightPopGap
Endscript
Script CPF_LowHangLightGap
StartGap GapID=CPF_LowHangLight
Wait 1 frame
EndGap GapID=CPF_LowHangLight text="Light Hop!" score=100
Endscript
Script CPF_LightPopGap
StartGap GapID=CPF_LightPop
Wait 1 frame
EndGap GapID=CPF_LightPop text="Light Pop!" score=100
Endscript

Script CPF_AP_GateHop
StartGap GapID=AP_GateHop2
EndGap GapID=AP_GateHop2 text="Gate Hop!" score=100
Endscript

Script CPF_StartGateGap2
StartGap GapID=AP_GateGap2 flags=[cancel_ground]
Endscript

Script CPF_AP_CheckHighRoadGap
// //LaunchConsoleMessage "Checking Gap"
endgap GapID=AP_HighRoad text="Takin' the High Road" score=100 
endscript

Script CPF_Escalatin1
StartGap GapID=AP_Escalatin1 flags = [Cancel_Ground]
EndGap GapID=AP_Escalatin2 gapscript = CPF_AP_CheckEscalatinGap
Endscript
Script CPF_Escalatin2
StartGap GapID=AP_Escalatin2 flags = [Cancel_Ground]
EndGap GapID=AP_Escalatin1 gapscript = CPF_AP_CheckEscalatinGap
Endscript
Script CPF_AP_CheckEscalatinGap
StartGap GapID=AP_Escalatin
Wait 1 frame
EndGap GapID=AP_Escalatin text="Escalatin' the Situation!" score=100 gapscript = CPF_AP_Escalator
endscript

Script CPF_BaggageHop1
StartGap GapID=AP_CPF_BaggageHop1 flags = [Cancel_Ground]
EndGap GapID=AP_CPF_BaggageHop2 gapscript = CPF_AP_CPF_BaggageHopGap
Endscript
Script CPF_BaggageHop2
StartGap GapID=AP_CPF_BaggageHop2 flags = [Cancel_Ground]
EndGap GapID=AP_CPF_BaggageHop1 gapscript = CPF_AP_CPF_BaggageHopGap
Endscript
Script CPF_AP_CPF_BaggageHopGap
StartGap GapID=AP_CPF_BaggageHop
Wait 1 frame
EndGap GapID=AP_CPF_BaggageHop text="Claim Hop!" score=50
endscript

Script CPF_AP_Escalator
if ProfileEquals trickstyle=vert
    StartGapTrick tricktext="Airwalk" gapscript = CPF_AP_Escalator2
Endif
Endscript
Script CPF_AP_Escalator2
//LaunchConsoleMessage "found airwalk"
if GetGoal goal = GOAL_TRICKSPOT
Else    
//    Got_TrickSpot 
endif
Endscript

Script CPF_AP_MusicalChairsEast
StartGap GapID=AP_MC_EtoW flags = [Cancel_Ground]
EndGap GapID=AP_MC_WtoE gapscript = CPF_MusicalChairsGap
Endscript
Script CPF_AP_MusicalChairsWest
StartGap GapID=AP_MC_WtoE flags = [Cancel_Ground]
EndGap GapID=AP_MC_EtoW gapscript = CPF_MusicalChairsGap
Endscript
Script CPF_MusicalChairsGap
StartGap GapID=CPF_MusicalChairs
Wait 1 frame
EndGap GapID=CPF_MusicalChairs text="Musical Chairs" score=100
Endscript

Script CPF_AP_DishGrind
Wait 1 frame
EndGap GapID=AP_GrindTheDish1
Wait 1 frame
EndGap GapID=AP_GrindTheDish2
Wait 1 frame
EndGap GapID=AP_GrindTheDish3
Wait 1 frame
EndGap GapID=AP_GrindTheDish4
Wait 1 frame
//if GetGoal goal = GOAL_TRICKSPOT
//Else    
//    if ProfileEquals trickstyle=street
//        Got_TrickSpot 
//    endif
//endif
Endscript

Script CPF_AP_BaggageGrind
if ProfileEquals trickstyle=street
StartGapTrick tricktext="Crooked" gapscript = CPF_AP_BaggageGrind2
Endif
Wait 1 frame
EndGap GapID=AP_GrindBaggage1
Wait 1 frame
EndGap GapID=AP_GrindBaggage2 
Wait 1 frame
EndGap GapID=AP_GrindBaggage3 
Wait 1 frame
EndGap GapID=AP_GrindBaggage4 
Wait 1 frame
//LaunchConsoleMessage "Checking Crooked"
Endscript

Script CPF_AP_BaggageGrind2
//LaunchConsoleMessage "Found Crooked"
if GetGoal goal = GOAL_TRICKSPOT
Else    
    if ProfileEquals trickstyle=street
//        Got_TrickSpot 
    endif
endif
Endscript

Script CPF_GapSound
//PlaySound GapSound Vol=100 
endscript

Script CPF_LA_ArcoGap
if ProfileEquals trickstyle=street
    StartGapTrick tricktext="Varial Kickflip" gapscript = CPF_LA_Varial Kickflip_Arco
Endif
Endscript

script CPF_LA_Varial Kickflip_Arco
if GetGoal goal = GOAL_TRICKSPOT
Else
//    Got_TrickSpot 
Endif
endscript

Script CPF_LA_CheckQuake1Gap
// //LaunchConsoleMessage "Checking Gap"
endgap <...> CPF_LA_Quake1 text="Earthquake!!!" score=100 gapscript = CPF_LA_QuakeStart
endscript

Script CPF_LA_ArcoPoppin
StartGap GapID=ArcoPop
Wait 1 frame
EndGap GapID=ArcoPop text = "Tower Poppin'" score = 100  GapScript = CPF_LA_ArcoVert
Endscript

Script CPF_LA_ArcoVert
//LaunchConsoleMessage "Checking One Footed Japan"
if ProfileEquals trickstyle=vert
    StartGapTrick tricktext="One Foot Japan" gapscript = CPF_LA_OneFootJapan_Arco
Endif
Endscript

script CPF_LA_OneFootJapan_Arco
if GetGoal goal = GOAL_TRICKSPOT
Else
//    Got_TrickSpot 
Endif
endscript

script CPF_Sc_Boardslide_Gate
if GetGoal goal = GOAL_TRICKSPOT
Else
//    Got_TrickSpot 
Endif
endscript

Script CPF_FroggerNorth
StartGap GapID=LA_Over_NtoS flags = [Cancel_Ground]
EndGap GapID=LA_Over_StoN gapscript = CPF_FroggerGap
Endscript

Script CPF_FroggerSouth
StartGap GapID=LA_Over_StoN flags=Cancel_Ground
EndGap GapID=LA_Over_NtoS gapscript = CPF_FroggerGap
Endscript

Script CPF_FroggerGap
StartGap GapID=CF_Frogger
Wait 1 frame
EndGap GapID=CF_Frogger text="To Get To The Other Side, Baby!" score=200 
Endscript

Script CPF_TowerTest1
//LaunchConsoleMessage "TowerTest1"
StartGap GapID=LA_TowerTestE_W flags = [cancel_ground cancel_manual]
EndGap GapID=LA_TowerTestW_E gapscript = CPF_TowerTestGap
Endscript
Script CPF_TowerTest2
//LaunchConsoleMessage "TowerTest2"
StartGap GapID=LA_TowerTestW_E flags = [cancel_ground cancel_manual]
EndGap GapID=LA_TowerTestE_W gapscript = CPF_TowerTestGap
Endscript
Script CPF_TowerTestGap
//LaunchConsoleMessage "TowerTest!"
StartGap GapID=CF_LA_Tower
Wait 1 frame
EndGap GapID=CF_LA_Tower text = "Tower Rails GAP" score = 200  GapScript = CPF_LA_ArcoGap 
Endscript

Script CPF_TowerDoor1
StartGap GapID=CPF_TowerDoor1to2 flags = [Cancel_Ground]
EndGap GapID=CPF_TowerDoor2to1 gapscript = CPF_TowerDoor1Gap
Endscript
Script CPF_TowerDoor2
StartGap GapID=CPF_TowerDoor2to1 flags = [Cancel_Ground]
EndGap GapID=CPF_TowerDoor1to2 gapscript = CPF_TowerDoor1Gap
Endscript
Script CPF_TowerDoor1Gap
StartGap GapID=CPF_TowerDoor
Wait 1 frame
EndGap GapID=CPF_TowerDoor text="Doorway Hop" score=50 
Endscript

Script CPF_Fountain1
StartGap GapID=CPF_Fountain1to2 flags = [Cancel_Ground]
EndGap GapID=CPF_Fountain2to1 gapscript = CPF_FountainHopGap
Endscript
Script CPF_Fountain2
StartGap GapID=CPF_Fountain2to1 flags = [Cancel_Ground]
EndGap GapID=CPF_Fountain1to2 gapscript = CPF_FountainHopGap
Endscript
Script CPF_FountainHopGap
StartGap GapID=CPF_FountainHop
Wait 1 frame
EndGap GapID=CPF_FountainHop text="Fountain Hop" score=100 
Endscript

Script CPF_PershingRamp1
StartGap GapID=CPF_PershingRamp1to2 flags = [Cancel_Ground]
EndGap GapID=CPF_PershingRamp2to1 gapscript = CPF_PershingRampGap
Endscript
Script CPF_PershingRamp2
StartGap GapID=CPF_PershingRamp2to1 flags = [Cancel_Ground]
EndGap GapID=CPF_PershingRamp1to2 gapscript = CPF_PershingRampGap
Endscript
Script CPF_PershingRampGap
StartGap GapID=CPF_PershingRamp
Wait 1 frame
EndGap GapID=CPF_PershingRamp text="Pershing Ramp" score=100 
Endscript

Script CPF_OverpassRumble1
StartGap GapID=CPF_OverpassRumble1to2 flags = [Cancel_Ground]
EndGap GapID=CPF_OverpassRumble2to1 gapscript = CPF_OverpassRumbleGap
Endscript
Script CPF_OverpassRumble2
StartGap GapID=CPF_OverpassRumble2to1 flags = [Cancel_Ground]
EndGap GapID=CPF_OverpassRumble1to2 gapscript = CPF_OverpassRumbleGap
Endscript
Script CPF_OverpassRumbleGap
StartGap GapID=CPF_OverpassRumble
Wait 1 frame
EndGap GapID=CPF_OverpassRumble text="Overpass Aftershock" score=100  gapscript=CPF_QuakeIncrease
Endscript

Script CPF_TowerRailSwapNorth
StartGap GapID=LA_TowerNtoS flags = [Cancel_Ground]
EndGap GapID=LA_TowerStoN gapscript = CPF_TowerRailSwapGap
Endscript
Script CPF_TowerRailSwapSouth
StartGap GapID=LA_TowerStoN flags=Cancel_Ground
EndGap GapID=LA_TowerNtoS gapscript = CPF_TowerRailSwapGap
Endscript
Script CPF_TowerRailSwapGap
StartGap GapID=CPF_TowerRailSwap
Wait 1 frame
EndGap GapID=CPF_TowerRailSwap text="Tower Rail Swap!" score=100 
Endscript

Script CPF_CloseOneEast
StartGap GapID=LA_CloseOneEtoW flags = [Cancel_Ground]
EndGap GapID=LA_CloseOneWtoE gapscript = CPF_CloseOneGap
Endscript
Script CPF_CloseOneWest
StartGap GapID=LA_CloseOneWtoE flags=Cancel_Ground
EndGap GapID=LA_CloseOneEtoW gapscript = CPF_CloseOneGap
Endscript
Script CPF_CloseOneGap
StartGap GapID=CPF_CloseOne
Wait 1 frame
EndGap GapID=CPF_CloseOne text="Nice Move!" score=300 
Endscript

Script CPF_RailEast
StartGap GapID=LA_Over_EtoW flags = [Cancel_Ground]
EndGap GapID=LA_Over_WtoE gapscript = CPF_RailEastWest
Endscript
Script CPF_RailWest
StartGap GapID=LA_Over_WtoE flags=Cancel_Ground
EndGap GapID=LA_Over_EtoW gapscript = CPF_RailEastWest
Endscript
Script CPF_RailEastWest
StartGap GapID=CPF_RailEastWest
Wait 1 frame
EndGap GapID=CPF_RailEastWest text="Rail Skip!" score=200 
Endscript


Script CPF_CarwashNorth
StartGap GapID=LA_Carwash_NtoS flags = [Cancel_Ground Cancel_Manual]
EndGap GapID=LA_Carwash_StoN gapscript = CPF_CarwashGap
Endscript
Script CPF_CarwashSouth
StartGap GapID=LA_Carwash_StoN flags = [Cancel_Ground Cancel_Manual]
EndGap GapID=LA_Carwash_NtoS gapscript = CPF_CarwashGap
Endscript
Script CPF_CarwashGap
StartGap GapID=CF_Carwash
Wait 1 frame
EndGap GapID=CF_Carwash text="Sqeaky Clean!" score=100 
Endscript

Script CPF_LA_ArcoLockin
StartGap GapID=ArcoLock
Wait 1 frame
EndGap GapID=ArcoLock text = "Tower Lockin'" score = 100
Endscript

Script CPF_LA_ArcoCHUD
StartGap GapID=ArcoCHUD
Wait 1 frame
EndGap GapID=ArcoCHUD text = "Venting Frustration" score = 200
Endscript

Script CPF_GapKiosk
StartGap GapID=CF_Kiosk
Wait 1 frame
EndGap GapID=CF_Kiosk text="KIOSK!" score=100 
Endscript
                   
Script CPF_GapPedProps
StartGap GapID=CF_PedProps
Wait 1 frame
EndGap GapID=CF_PedProps text="Ped Props!" score=100 gapscript = CPF_GapSound
Endscript
*/

Script GenericPro
Endscript

Script GenericObject
Endscript

Script CameraScript1
PlaySound GapSound
Endscript

Script CameraScript2
Playsound GoalDone
Endscript

Script Sch_SororityChick
//printf "sorority start"
Obj_PlayAnim Anim=Ped_F_Walk
Obj_MoveToNode name=TRG_SororityChickNav01 speed=10 mph
Obj_WaitMove
Obj_PlayAnim Anim=Ped_F_Wave 
Obj_WaitAnimFinished
Obj_PlayAnim Anim=Ped_F_Wave
Obj_WaitAnimFinished
Obj_LookAtNode name=TRG_SororityChick01
Obj_PlayAnim Anim=Ped_F_Walk
Obj_MoveToNode name=TRG_SororityChick01 speed=10 mph
Obj_WaitMove
//printf "sorority end loop"
Die
Endscript

Script Sch_FratGuy
wait 1 second
Begin
Obj_PlayAnim Anim=Random (@Ped_Frat_DrunkenIdle @Ped_Frat_Drink)
Obj_WaitAnimFinished
Obj_PlayAnim Anim=Random (@Ped_Frat_ThrowShaka @Ped_Frat_WooHooo)
Obj_WaitAnimFinished
if NOT gotparam nosound
    Obj_PlayStream Random (
        @fratboy_sch_random01
        @fratboy_sch_random02
        @fratboy_sch_random03
        @fratboy_sch_random04
        @fratboy_sch_random05
        @fratboy_sch_random06
    ) 
endif
repeat
if Obj_FlagSet ONCE_AROUND
    Obj_ClearFlag ONCE_AROUND
    Begin
        Obj_PlayAnim Anim=Random (@Ped_Frat_ThrowShaka @Ped_Frat_WooHooo)
        Obj_WaitAnimFinished
    repeat 2
Endif
//repeat
Endscript

Script ProCheering
Endscript

 //   mini-game stuff-----------------------------------------

script panel_message_MG_1_Low
    SetProps font=small just=[center center] rgba=[115 26 26 95]
    DoMorph time=.08 scale=0  pos=(30,190)
    DoMorph time=.12 scale=1.3 pos=(100,190)
    DoMorph time=.14 scale=.5
    DoMorph time=.16 scale=1.2
    DoMorph time=.18 scale=.9
    wait 1.8 seconds
    Die
Endscript

script panel_message_Muskabeatz
    SetProps font=dialog just=[center center] rgba=[128 128 128 95] pos=(316, 82)
    DoMorph time=0 alpha=.8 scale=1.2
    DoMorph time=.08 scale=1.4 alpha=1 //pos=(80,190)
    DoMorph time=.07 scale=1.0
    DoMorph time=.06 scale=.95
    DoMorph time=.05 scale=1.05
    wait .5 seconds
    Die
Endscript


script panel_message_MG_NewRecord
    SetProps font=small just=[center center] rgba=[127 102 0 95]
    DoMorph time=.08 scale=0  pos=(30,190)
    DoMorph time=.12 scale=1.5 pos=(100,170)
    DoMorph time=.14 scale=.5
    DoMorph time=.16 scale=1.3
//     DoMorph time=.18 scale=.9
    DoMorph time=.18 scale = 1.0
    wait 1.8 seconds
    Die
Endscript
script panel_message_MG_1_High
    SetProps font=small just=[center center] rgba=[127 102 0 95]
    DoMorph time=.08 scale=0  pos=(30,190)
    DoMorph time=.12 scale=1.5 pos=(100,190)
    DoMorph time=.14 scale=.5
    DoMorph time=.16 scale=1.3
//    DoMorph time=.18 scale=.9
    DoMorph time=.18 scale=1.0
    wait 1.8 seconds
    Die
Endscript
script panel_message_MG_2
    SetProps font=small just=[center center] rgba=[26 51 83 95]
    DoMorph time=.08 scale=0   pos=(30,210)
    DoMorph time=.12 scale=1.2 pos=(100,210)
    DoMorph time=.14 scale=.5
    DoMorph time=.16 scale=1
//    DoMorph time=.18 scale=.8
    DoMorph time=.18 scale=1.0
    wait 1.8 seconds
    Die
Endscript
script panel_message_MG_3
    SetProps font=small just=[center center] rgba=[26 51 83 95]
    DoMorph time=.08 scale=0  pos=(30,230)
    DoMorph time=.12 scale=1.2 pos=(100,230)
    DoMorph time=.14 scale=.5
    DoMorph time=.16 scale=1
//    DoMorph time=.18 scale=.8
      DoMorph time=.18 scale=1.0
    wait 1.8 seconds
    Die
Endscript
script panel_message_MG_4
    SetProps font=small just=[center center] rgba=[26 51 83 95]
    DoMorph time=.08 scale=0  pos=(30,250)
    DoMorph time=.12 scale=1.2 pos=(100,250)
    DoMorph time=.14 scale=.5
    DoMorph time=.16 scale=1
//    DoMorph time=.18 scale=.8
    DoMorph time=.18 scale=1.0
    wait 1.8 seconds
    Die
Endscript

ONCE_AROUND = 20

Script GrindCounter type=default
/*  printf "grind counter started"
    if GoalManager_GoalIsActive name=Sch_minigame_fountain
        printf "checking"
        GoalManager_GetGoalParams name=Sch_minigame_fountain
        GoalManager_GotCounterObject name=<goal_id>
        GoalManager_CheckMinigameRecord name=<goal_id> <number_collected>
        FormatText TextName=minigame_message "%i grinds" i=<number_collected>
        create_panel_message text=<minigame_message>
    else
        GoalManager_ActivateGoal name=Sch_minigame_fountain
        Obj_SetException ex=SkaterLanded scr=minigame_fountain_done params={ goal_id=sch_minigame_fountain }
        Obj_SetException ex=SkaterBailed scr=minigame_fountain_done params={ goal_id=sch_minigame_fountain }
    endif
*/
/*
Obj_VarSet var=0 value=0
begin
wait 10 frames
if Obj_FlagSet ONCE_AROUND
    Obj_ClearFlag ONCE_AROUND
    Obj_VarInc var=0
    Obj_VarGet var=0 name=counter
    FormatText TextName=Foo "%q" q=<counter>
    if Obj_VarLT var=0 value=10
        PlaySound hud_jumpgap Vol=70
        create_panel_message id=MiniGame1 text=<Foo> style=panel_message_MG_1_Low
    Else
        PlaySound cash Vol=130
        create_panel_message id=MiniGame1 text=<Foo> style=panel_message_MG_1_High
    Endif
    create_panel_message id=MiniGame2 text=<type> style=panel_message_MG_2
    if Obj_VarEQ var=0 value=1
        create_panel_message id=MiniGame3 text="Grind" style=panel_message_MG_3
    Else
        create_panel_message id=MiniGame3 text="Grinds" style=panel_message_MG_3
    Endif
    create_panel_message id=MiniGame4 text=" " style=panel_message_MG_4
Endif
repeat
*/
Endscript

Script SororityCounter
Obj_VarSet var=0 value=0
Obj_VarSet var=1 value=10
begin
wait 30 frames
if NOT SkaterCurrentScorePotGreaterThan 0
    Obj_VarSet var=0 value=0
    Obj_VarSet var=1 value=10
Else
    Obj_VarDec var=1
    Obj_VarGet var=1 name=timer
    FormatText TextName=Foo "%q" q=<timer>
    create_panel_message id=MiniGame1 text=<Foo> style=panel_message_MG_1_Low
    create_panel_message id=MiniGame2 text=" " style=panel_message_MG_2
    create_panel_message id=MiniGame3 text=" " style=panel_message_MG_3
    create_panel_message id=MiniGame4 text=" " style=panel_message_MG_4
    if Obj_VarEQ var=1 value=0
        Obj_VarSet var=1 value=10
        Obj_VarInc var=0
        Obj_VarGet var=0 name=counter
        FormatText TextName=Foo "%q" q=<counter>
        SendFlag prefix="TRG_FratGuy" ONCE_AROUND
        Create prefix="TRG_SororityChick"
        if Obj_VarLT var=0 value=10
            PlaySound hud_jumpgap Vol=70
            create_panel_message id=MiniGame1 text=<Foo> style=panel_message_MG_1_Low
        Else
            PlaySound cash Vol=130
            create_panel_message id=MiniGame1 text=<Foo> style=panel_message_MG_1_High
        Endif
        create_panel_message id=MiniGame2 text="Sorority" style=panel_message_MG_2
        if Obj_VarEQ var=0 value=1
            create_panel_message id=MiniGame3 text="Girl" style=panel_message_MG_3
        Else
            create_panel_message id=MiniGame3 text="Girls" style=panel_message_MG_3
        Endif
        create_panel_message id=MiniGame4 text="Impressed" style=panel_message_MG_4
        Wait 1 second
    Endif
Endif
repeat
Endscript


Script JockCounter
    begin
        wait 3 frames
        // TODO: temp hack to make sure garbage day isn't active
        if not GoalManager_GoalIsActive name=sch_goal_minigame_timer
            if SkaterCurrentScorePotLessThan 1
                Obj_VarSet var=0 value=0
            Endif
            
            if not GoalManager_GoalIsActive name=Sch_Goal_CounterCombo
                if Obj_FlagSet ONCE_AROUND
                    Obj_ClearFlag ONCE_AROUND
                    Obj_VarInc var=0
                    Obj_VarGet var=0 name=counter
                    FormatText TextName=Foo "%q" q=<counter>
                    if Obj_VarLT var=0 value=10
                        PlaySound hud_jumpgap Vol=70
                        create_panel_message id=MiniGame1 text=<Foo> style=panel_message_MG_1_Low
                    Else
                        PlaySound cash Vol=130
                        create_panel_message id=MiniGame1 text=<Foo> style=panel_message_MG_1_High
                    Endif
                    if Obj_VarEQ var=0 value=1
                        create_panel_message id=MiniGame2 text="Jock" style=panel_message_MG_2
                    Else
                        create_panel_message id=MiniGame2 text="Jocks" style=panel_message_MG_2
                    Endif
                    create_panel_message id=MiniGame3 text="Combo" style=panel_message_MG_3
                    create_panel_message id=MiniGame4 text="Clocked" style=panel_message_MG_4
                Endif
            Endif
        endif
    repeat
Endscript

Script BobbingObject
Obj_RotY speed=250
Begin
Obj_MoveToRelPos (0,2,0) time=.1
Obj_WaitMove
Obj_MoveToRelPos (0,6,0) time=.1
Obj_WaitMove
Obj_MoveToRelPos (0,2,0) time=.1
Obj_WaitMove
Obj_MoveToRelPos (0,1,0) time=.1
Obj_WaitMove
Obj_MoveToRelPos (0,-2,0) time=.1
Obj_WaitMove
Obj_MoveToRelPos (0,-6,0) time=.1
Obj_WaitMove
Obj_MoveToRelPos (0,-2,0) time=.1
Obj_WaitMove
Obj_MoveToRelPos (0,-1,0) time=.1
Obj_WaitMove
Repeat
endscript

    
Script GenericProGoalDoneWaiting
Begin
if Obj_ObjectInRadius radius = 20 feet type = skater
Random
(
@Obj_PlayAnim Anim=Idle 
Obj_WaitAnimFinished
@Obj_PlayAnim Anim=Idle 
Obj_WaitAnimFinished
@Obj_PlayAnim Anim=Idle 
Obj_WaitAnimFinished
@Obj_PlayAnim Anim=Idle 
Obj_WaitAnimFinished
@Obj_PlayAnim Anim=Idle 
Obj_WaitAnimFinished
)
Else
if Obj_ObjectInRadius radius = 50 feet type = skater
Random
(
@Obj_PlayAnim Anim=Casper_Init 
Obj_WaitAnimFinished
Obj_PlayAnim Anim=Casper_Flip
Obj_WaitAnimFinished
Obj_PlayAnim Anim=Casper_Flip
Obj_WaitAnimFinished
Obj_PlayAnim Anim=Casper_Out
Obj_WaitAnimFinished
@Obj_PlayAnim Anim=Truckstand_Init
Obj_WaitAnimFinished
Obj_PlayAnim Anim=Truckstand_Flip
Obj_WaitAnimFinished
Obj_PlayAnim Anim=Truckstand_Out
Obj_WaitAnimFinished
@Obj_PlayAnim Anim=Idle 
Obj_WaitAnimFinished
@Obj_PlayAnim Anim=NoseManual 
Obj_WaitAnimFinished
Obj_PlayAnim Anim=NoseManual_Range
Obj_WaitAnimFinished
Obj_PlayAnim Anim=GTurn
Obj_WaitAnimFinished
@Obj_PlayAnim Anim=MullenStart
Obj_WaitAnimFinished
@Obj_PlayAnim Anim=Brake
Obj_WaitAnimFinished
)
Else
wait 30 frames
Endif
Endif
repeat
Endscript

Script Sch_RiverCombo
Obj_VarSet var=0 value=0
Obj_VarSet var=1 value=0
Begin
if SkaterCurrentScorePotGreaterThan 0
    Obj_VarInc var=0
    if Obj_VarEQ var=0 value=6
        Obj_VarSet var=0 value=0
        Obj_VarInc var=1
        Obj_VarGet var=1 name=counter
        FormatText TextName=Foo "%q second" q=<counter>
        if Obj_VarLT var=1 value=10
            PlaySound hud_jumpgap Vol=70
            create_panel_message id=MiniGame1 text=<Foo> style=panel_message_MG_1_Low
        Else
            PlaySound cash Vol=130
            create_panel_message id=MiniGame1 text=<Foo> style=panel_message_MG_1_High
        Endif
        create_panel_message id=MiniGame2 text="River" style=panel_message_MG_2
        create_panel_message id=MiniGame3 text="Combo" style=panel_message_MG_3
    Endif
Else    
    Obj_VarSet var=0 value=0
    Obj_VarSet var=1 value=0
Endif
Wait 10 frames
Repeat    
Endscript

Script Goal_Money
Obj_SetException ex = SkaterInRadius scr = Goal_Money_Got
Obj_SetInnerRadius 7
Obj_RotY speed=250
Obj_Hover Amp=10 Freq=1
endscript

Script Goal_Money_Got amount=50
GoalMAnager_AddCash <amount>
Playsound cash
create_panel_message id=goal_money_message text="You got some cash" style=goal_message_got_stat
Die
Endscript

script Float_Generic01 TurnDist = 40
Obj_StickToGround off DistAbove = 1 DistBelow = 1
Obj_SetGroundOffset .1
Obj_SetPathVelocity 4.6 mph
Obj_SetPathTurnDist <TurnDist>
Obj_SetPathAcceleration 30 mphps
Obj_SetPathDeceleration 20 mphps
Obj_SetPathMinStopVel 5
Obj_SetFlag FLAG_CAR_TYPE_BUS
if GotParam NoSound // If passed NoSound, dont play any sounds
    Obj_SetFlag FLAG_CAR_GENERIC_NOSOUND
else
    Obj_PlaySound CarLoop
endif
Obj_FollowPathLinked
Obj_SetException Ex = SCH_FLOAT_START_RUN Scr = Float_Generic_Start Params = <...>
wait 1 frame
Obj_StopAlongPath
Sch_TrafficGone
begin
wait 1000 frame
repeat
endscript
script Float_Generic_Start
Obj_StartAlongPath
wait 60 frames
if GotParam music
//printf "playing music AAAAAAAAAAAAAAHHHHHHHHHHHHHHHH"
Obj_PlayStream parademusic use_pos_info=0 vol = 300
wait 60 seconds
Obj_PlayStream parademusic use_pos_info=0
wait 60 seconds
endif
endscript

Script Sch_WalkUpTheStiars
if Held Up
    MakeSkaterGoto WalkUpStairs z=8 stairs=55 bottomnode=TRG_StairwalkBottom01 topnode=TRG_StairwalkTop01
Endif
Endscript

Script Sch_MG_BBall
//Obj_ClearExceptions
Obj_SetException ex = SkaterInRadius scr = Sch_MG_BBallClose
Obj_SetInnerRadius 5
Obj_SetOuterRadius 0
Endscript

Script Sch_MG_BBallClose
//Obj_ClearExceptions
Obj_SetException ex = SkaterOutOfRadius scr = Sch_MG_BBall
Obj_SetOuterRadius 5
Obj_SetInnerRadius 0
Begin
if SkaterSpeedLessThan 1
    Obj_ClearExceptions
    SpawnSkaterScript Sch_MG_BBallPlay
    wait 20 frames // seconds
//    MakeSkaterGoto Sch_MG_BBallPlay
    MakeSkaterGoto Basketball
    Break
    //Die
endif
Wait 9 frame
Repeat
Endscript

Script Sch_MG_BBallPlay
Obj_MoveToNode Name = TRG_MG_BBallNav orient
//wait 1 frame
//PauseSkaters
Endscript

Script Sch_MG_BBall01
Obj_SetException ex = SkaterInRadius scr = Sch_MG_BBall01Close
Obj_SetInnerRadius 5
Obj_SetOuterRadius 0
Endscript
Script Sch_MG_BBall01Close
//Obj_ClearExceptions
Obj_SetException ex = SkaterOutOfRadius scr = Sch_MG_BBall01
Obj_SetOuterRadius 5
Obj_SetInnerRadius 0
Begin
if SkaterSpeedLessThan 1
    Obj_ClearExceptions
    SpawnSkaterScript Sch_MG_BBall01Play
    wait 20 frames // seconds
    MakeSkaterGoto Basketball2
    Break
    //Die
endif
Wait 9 frame
Repeat
Goto Sch_MG_BBall01
Endscript

Script Sch_MG_BBall01Play
Obj_MoveToNode Name = TRG_MG_BBallNav01 orient
Endscript

Script Sch_MG_BBallPlayBall
DisablePlayerInput AllowCameraControl
PauseSkaters
Obj_MoveToNode Name = TRG_MG_BBall orient
Begin
if Held Up
    printf "Up Pressed"
Endif
if Held Down
    printf "Down Pressed"
Endif
if Held Left
    printf "Left Pressed"
Endif
if Held Right
    printf "Right Pressed"
    Obj_Rotate relative=(10,10,10) time=10
    wait 10 frame
Endif
    Obj_Rotate relative=(10,10,10) time=.01
wait 10 frame
Repeat
Endscript
   

Script Sch_PissedGuyWaiting
begin
Obj_PlayAnim Anim=Random (@Ped_M_ShakeFist @Ped_M_Disgust)
Obj_WaitAnimFinished
repeat
Endscript

Script Sch_PissedGuyTalking
Obj_PlayAnim Anim=Ped_M_Talk1 
Obj_WaitAnimFinished
Obj_PlayAnim Anim=Ped_M_Talk2 
Obj_WaitAnimFinished
begin
Obj_PlayAnim Anim=Random (@Ped_M_ShakeFist @Ped_M_Disgust)
Obj_WaitAnimFinished
repeat
Endscript

Script Sch_TrashedWaiting
begin
Obj_PlayAnim Anim=random (@Ped_Bin_InBin @Ped_Bin_InBin2)
Obj_WaitAnimFinished
repeat
Endscript
Script Sch_TrashedTalking
printf "talking to skater ================================================"
Obj_PlayAnim Anim=Ped_Bin_GetUp
Endscript

script Car_Viper01 TurnDist = 20
Obj_StickToGround distAbove = 3 distBelow = 6
Obj_SetGroundOffset .1
Obj_SetPathTurnDist <TurnDist>
Obj_FollowPathLinked
Obj_SetPathAcceleration 60 mphps
Obj_SetPathDeceleration 40 mphps
Obj_SetPathMinStopVel 5
Obj_SpawnScript Car_CheckForOtherCar01 params = { PathNum = <PathNum> }
Obj_SetPathVelocity 75 mph
Obj_PlaySound CarLoop
if GotParam NoSkater // If passed NoSkater, dont check for skater
else
    Obj_SpawnScript Car_CheckForSkater01
endif
endscript

Script Sch_MG_PongVO
stopstream
Playstream tennis_minigame
endscript
Script Sch_MG_Pong
    setup_ped_speech {
        ped_id=TRG_MG_Pong
        display_name="Bjorn"
        speed=200
        inner_radius=20
        text=[
            "Bjorn:\n"
            "Hey! Skater-Person!\n"
            "You wish to play me in Tennis, no?\n"
            "Press \b3 to Accept\nPress \m1 to Decline"
            ]
        activation_script=Sch_MG_PongVO 
        pad_choose_script=Sch_MG_PongClose
        pad_back_script=Sch_MG_PongDecline
    }
//Obj_SetException ex = SkaterInRadius scr = Sch_MG_PongClose
//Obj_SetInnerRadius 10
//Obj_SetOuterRadius 0
Endscript

Script Sch_MG_PongDecline
speech_box_exit
UnPauseSkaters
MakeSkaterGoto SkaterInit
Endscript

Script Sch_Punk_WaitingForSkater
Endscript


Script Sch_GarbageDayTrigger    
    // don't do this minigame if there are active goals
    printf "garbage day trigger"
    if IsCareerMode
        if not GoalManager_HasActiveGoals
            if TriggerType [ TRIGGER_SKATE_ONTO TRIGGER_LAND_ON]
                // kill all goals/minigames
                GoalManager_DeactivateAllGoals
            
                wait 1 frame
                    
                // start the goal
                GoalManager_ActivateGoal name=sch_goal_minigame_timer
                
                create_speech_box text="Garbage Day!!!" style=speech_box_style
                //kill prefix="MLS_Garbage_Truck"
                Sch_TrafficGone
                kill prefix="MLS_Garbage_Truck_ContainerTrigg"
                kill prefix="TRG_Veh_GarbageTruck"
                kill prefix="TRG_GarbageDayMoney"
                kill prefix="TRG_Car_Random"
    //            wait 1 frame
                create prefix="MLS_Garbage_Truck_Container0"
                create name=TRG_Veh_GarbageTruck01
                create name=TRG_Veh_GarbageTruck02
                create name=TRG_Veh_GarbageTruck03
                create name=TRG_Veh_GarbageTruck04
                create prefix="TRG_GarbageDayMoney"
                printf "creating GO"
                wait 1 frame
/*          if ObjectExists id=TRG_MG_Sch_GarbageDay
                printf "killing"
                kill name=TRG_MG_Sch_GarbageDay
            Endif
            create name=TRG_MG_Sch_GarbageDay
*/
            endif
        endif
    endif
Endscript

script Sch_GarbageDay_Activate
    TRG_MG_Sch_GarbageDay:Obj_SetException ex=SkaterLanded scr=Sch_GarbageDay_CheckScores params={ goal_id=<goal_id> }
endscript

script Sch_GarbageDay_CheckScores
    GoalManager_GetGoalParams name=<goal_id>
    if SkaterLastScoreLandedGreaterThan <score>
        GoalManager_AddMinigameTime name=<goal_id> <score_time>
    endif
endscript

Script Sch_GarbageDay_end
    TRG_MG_Sch_GarbageDay:Obj_ClearException SkaterLanded
    GetSkaterState
    if (<state>=skater_OnRail)
        MakeskaterGoto SkaterInit
    Endif
    if Skater: OnLip
        MakeskaterGoto SkaterInit
    Endif
    if not GoalManager_GoalIsActive name=sch_goal_comp
        if NOT GoalManager_GoalIsActive name=Sch_Goal_Counter
//      create_speech_box text="Garbage Collected" style=speech_box_style pause_input pause_input_time=3000 z_priority=10
        kill name=TRG_Veh_GarbageTruck01
        kill name=TRG_Veh_GarbageTruck02
        kill name=TRG_Veh_GarbageTruck03
        kill name=TRG_Veh_GarbageTruck04
        kill prefix="TRG_GarbageDayMoney"
        kill prefix="MLS_Garbage_Truck_Container0"
        Sch_TrafficStart
        create prefix="MLS_Garbage_Truck_ContainerTrigg"
        Endif
    Endif
Endscript

Script Sch_GarbageDay_Truck
Obj_StickToGround off DistAbove = 1 DistBelow = 1
Obj_SetGroundOffset .1
Obj_SetPathVelocity 15 mph
Obj_SetPathTurnDist <TurnDist>
// Obj_FollowPathLinked
Obj_SetPathAcceleration 1 mphps
Obj_SetPathDeceleration 2 mphps
Obj_SetPathMinStopVel 5
Obj_SetFlag FLAG_CAR_TYPE_BUS
wait 5 seconds
begin
Obj_MoveToRelPos (-2000,0,0) acceleration = .1 time = 20
Obj_WaitMove
wait 5 seconds
Obj_MoveToRelPos (2000,0,0) acceleration = .1 time = 20
Obj_WaitMove
wait 5 seconds
Repeat
Endscript

Script Sch_GarbageDay_TruckAlt
Obj_StickToGround off DistAbove = 1 DistBelow = 1
Obj_SetGroundOffset .1
Obj_SetPathVelocity 15 mph
Obj_SetPathTurnDist <TurnDist>
// Obj_FollowPathLinked
Obj_SetPathAcceleration 1 mphps
Obj_SetPathDeceleration 2 mphps
Obj_SetPathMinStopVel 5
Obj_SetFlag FLAG_CAR_TYPE_BUS
wait 5 seconds
begin
Obj_MoveToRelPos (2000,0,0) acceleration = .1 time = 20
Obj_WaitMove
wait 5 seconds
Obj_MoveToRelPos (-2000,0,0) acceleration = .1 time = 20
Obj_WaitMove
wait 5 seconds
Repeat
Endscript

Script Sch_Obj_Tree
Endscript

OBJFLAG_FRATBOY_LOSTBEER=0

Script AddGoalArrow
GetNodeName 
    SetScreenElementLock id=root_window off
    CreateScreenElement {
        parent=root_window
        type=Element3D
        model="GoalArrow"
        HoverParams={ Amp=10 Freq=2 }
        AngVelY=0.16
        ParentParams={ name=<nodename> (0, 100, 0) IgnoreParentsYRotation }
    }
Endscript
Script AddGoalArrowAlc id=Alc_Keg
GetNodeName
    SetScreenElementLock id=root_window off
    CreateScreenElement {
        parent=root_window
        type=Element3D
        model="GoalArrow"
        id=<nodename>
        HoverParams={ Amp=10 Freq=2 }
        AngVelY=0.16
        ParentParams={ name=<nodename> (0, 100, 0) IgnoreParentsYRotation }
    }
Endscript

Script KillTheArrow 
    if ObjectExists id=<id>
        DestroyScreenElement id=<id>
    endif
Endscript

Script CPF_SetUpStandardPed
Obj_StickToGround distAbove = 3 distBelow = 6
Obj_SetPathTurnDist 2.5 feet
Obj_StickToGround off
Obj_SetConstantHeight
Obj_PathHeading On
Obj_SetPathVelocity 20 fps
Obj_SetPathAcceleration 35 fpsps
Obj_SetPathDeceleration 35 fpsps
Endscript
Script Sch_testCamanimplay1
//printf "doing some script stuff 1 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
//printf "playing next camera1 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
//printf "playing next camera1 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
//PlaySkaterCamAnim skater=0 stop
//PlaySkaterCamAnim skater=0 name=G_COMBO_CameraStart01
Endscript
Script Sch_testCamanimplay2
//printf "doing some script stuff 2 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
//printf "playing next camera2 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
//PlaySkaterCamAnim skater=0 name=G_COMBO_CameraStart02
Endscript

Script Skateshop_PedPro
Begin
Obj_PlayAnim Anim=Random (@Ped_M_Idle1 @Ped_M_PlayerWave @Ped_M_LookAtWatch @Ped_M_Cheer1 @Ped_M_Cheer2)
Obj_WaitAnimFinished

//Obj_LookAtObject    type = skater time = .3
Obj_PlayAnim Anim=Random (@Ped_M_Lookright @Ped_M_Cheer3 @Ped_M_LookAtWatch @Ped_M_PlayerWave)
Obj_WaitAnimFinished
//Obj_LookAtObject    type = skater time = .3
repeat
Endscript

Script GenCollectObject goal_id=foo flag=got_1
Obj_SetException ex = SkaterInRadius scr = GenCollectObject_Got params = {<...>}
Obj_SetInnerRadius 7
Obj_RotY speed=250
Obj_Hover Amp=10 Freq=1
Endscript

Script GenCollectObject_Got
Obj_ClearExceptions
PlaySound GapSound vol=100
GoalManager_SetGoalFlag name=<goal_id> <flag> 1
GoalManager_GetGoalParams name=<goal_id>
if not GoalManager_AllFlagsSet name=<goal_id>
//     FormatText TextName=collect_text "%c of %n %t" c=<num_flags_set> t=<collect_type> n=<num_flags>
       FormatText TextName=collect_text "%c of %n %t" c=<num_flags_set> t=<collect_type> n=<num_flags>
    create_panel_message text=<collect_text> style=goal_collect_text
endif
Die
Endscript

Script GenBouncyObject menu_name=" "
Obj_SetException ex = SkaterInRadius scr = GenBouncyObject_Near params = {<...>}
Obj_SetInnerRadius 15
Obj_RotY speed=250
Obj_Hover Amp=10 Freq=1
//create_panel_message id=MiniGame1 text=" " // style=panel_message_MG_1_Low
Endscript

Script GenBouncyObject_Near
Obj_ClearExceptions
create_panel_message id=MiniGame1 text=<menu_name> // style=panel_message_MG_1_Low
Obj_SetException ex = SkaterOutofRadius scr = GenBouncyObject_Far params = {<...>}
Obj_SetOuterRadius 15
Endscript

Script GenBouncyObject_Far
Obj_ClearExceptions
//create_panel_message id=MiniGame1 text=" " // style=panel_message_MG_1_Low
Obj_SetException ex = SkaterInRadius scr = GenBouncyObject_Near params = {<...>}
Obj_SetInnerRadius 15
Endscript

Script Sch_HitOnTrigger
    // don't do this minigame if there are active goals
    if not GoalManager_HasActiveGoals
        if TriggerType [ TRIGGER_SKATE_ONTO TRIGGER_LAND_ON]
            GoalManager_ActivateGoal name=sch_goal_minigame_timer
        endif
    endif
Endscript

script Sch_HitOnTriggerAddTime
    GoalManager_GetGoalParams name=<goal_id>
    if SkaterLastScoreLandedGreaterThan <score>
        GoalManager_AddMinigameTime name=<goal_id> <score_time>
    endif
endscript

Script Sch_HitOnTrigger_end
    TRG_MG_Sch_GarbageDay:Obj_ClearException SkaterLanded
    if not GoalManager_GoalIsActive name=sch_goal_comp
        create_speech_box text="Not A Chance" style=speech_box_style
    Endif
Endscript

Script GarbageTruckTransfer01
//printf "GarbageTruckTransfer01"
    EndGap GapID=GarbageTruckTransfer01 text="Garbage Truck Transfer!!!" score=1000
    StartGap GapID=GarbageTruckTransfer02 flags = [pure_air]
Endscript
Script GarbageTruckTransfer02
//printf "GarbageTruckTransfer02"
    EndGap GapID=GarbageTruckTransfer02 text="Garbage Truck Transfer!!!" score=1000
    StartGap GapID=GarbageTruckTransfer01 flags = [pure_air]
Endscript
Script AddSecretTape
//kill prefix="SecretTape"
//create prefix="SecretTape"
Endscript
Script Secret_Tape
Obj_SetException ex = SkaterInRadius scr = Secret_Tape_Got
Obj_SetInnerRadius 10
Obj_RotY speed=250
Obj_Hover Amp=10 Freq=1
Endscript
Script Secret_Tape_Got
Obj_ClearExceptions
create_panel_block id=goal_complete text="Secret Tape!" style=panel_message_goalcomplete
//WaitForEvent type=panel_message_goalcomplete_done  
create_panel_sprite id=goal_complete_sprite texture=GO_done style=panel_sprite_goalcomplete
;WaitForEvent type=panel_sprite_goalcomplete_done
create_panel_message id=goal_complete_line2 text="Complete!" style=panel_message_goalcompleteline2
GoalManager_AddCash 1000
Playsound cash
Die
Endscript

Script Test_Cam_Script
printf "Gary is a putz"
Endscript

Script Test_Cam_Script2
printf "Gary is still a putz"
Endscript

Script Gen_WaitForCameraAnimToFinish
Begin 
    If SkaterCamAnimFinished Skater = 0
        Break
    Endif
    Wait 1 Frame
Repeat
Endscript

Script Test_Shatter_For_Dave
PlaySound GoalDone
printf "about to shatter"
//wait 1 second
Shatter name = Hyatt_Main_24_Glass01 area = 1000 variance = 4.6 vel_x = Random (@0.0 @30 @-30) vel_y = Random (@10 @30 @50)  vel_z = Random (@0 @30 @-30) spread = 1.0
//ShatterAndDie
Endscript

// start autoduck documentation
// @DOC ShatterAndDie


// @script | ShatterAndDie | use to shatter an geometry into pieces and kill the geometry as well
// @parmopt name | name |  | name of the geometry to shatter and kill
// @parmopt int | area | 1000 | How the object is to be divided up - uses the object face area divided by this number to get the # of pieces
// @parmopt float | variance | 4 | hmmm...
// @parmopt float | vel_x | 30 | Initial X direction velocity
// @parmopt float | vel_y | 30 | Initial Y direction velocity
// @parmopt float | vel_z | 30 | Initial Z direction velocity
// @parmopt float | spread | 1 | uh... 

Script ShatterAndDie area = 1000 variance = 4.6 vel_x = Random (@0.0 @30 @-30) vel_y = Random (@10 @30 @50)  vel_z = Random (@0 @30 @-30) spread = 1.0
kill name=<name>
Shatter name=<name> area=<area> variance=<variance> vel_x=<vel_x> vel_y=<vel_y> vel_z=<vel_z> spread=<spread>
Endscript

Script Generic_LeavingGameAreaMessage
if Not InSplitScreenGame    
    create_panel_message id=leaving_message text="Leaving Game Area"
endif
Endscript

Script CarPlantController
begin
Wait 1 frame
if Obj_FlagSet ONCE_AROUND
    MakeSkaterGoto CarPlant
//  PlaySound CarAlarm_11
    Printf "Carplant!"
    Wait 10 frames
    Obj_ClearFlag ONCE_AROUND
endif
repeat
endscript

Script Kon_AddGoal_Gaps5
  AddGoal_Gaps5 {
    CAREER_ONLY
//      unlocked_by_another
        record_type = none
        unlocked_by_another
        pro_specific_challenge
        pro_challenge_title="Trick Inventions"
        pro_challenge_text="Chances are, any trick you can do - Rodney invented. For nearly two decades, Rodney has been devising groundbreaking tricks like the impossible, casper, and darkslide. From freestyle to street skating - Rodney's skills seem nearly infinite." 
        pro_challenge_tag_line="Ready for a history lesson?"
        pro_challenge_pro_name="Rodney"
        goal_text="Do the tricks in one combo!"
        view_goals_text="Rodney's Pro Specific Challenge"
        Time = 240
        pro="tony"
        full_name="Tony Hawk"
        key_combos=[ Air_SquareU Air_SquareL ]
        Goal_Start_Script = Kon_Goal_Gaps5_Start
        Goal_Deactivate_Script = Kon_Goal_Gaps5_Deactivate
//      Goal_Success_Script = jnk_Goal_Gap6_Success
        required_tricks = [
            Trick_Kickflip
            Trick_Heelflip
            Trick_Impossible
            Trick_SemiFlip
            Trick_Airwalk
            Trick_VarialKickflip
            //Trick_Casper
            //Trick_AntiCasper
            //Trick_Handstand
            Trick_RustySlide
            ]
      Goal_Flags =  [
                  Got_Part_1
                  Got_Part_2
                  Got_Part_3
//                  Got_Part_4
//                  Got_Part_5
                  ]
//    Use_Hud_Counter
//    Hud_Counter_Caption = "Combos Landed"
    Goal_Description = Kon_Gaps5_Desc
    Record_Type = None 
    }
EndScript

OBJFLAG_RM_PC_TRICK_01 = 0
OBJFLAG_RM_PC_TRICK_02 = 1
OBJFLAG_RM_PC_TRICK_03 = 2
OBJFLAG_RM_PC_TRICK_04 = 3
OBJFLAG_RM_PC_TRICK_05 = 4
OBJFLAG_RM_PC_TRICK_06 = 5
OBJFLAG_RM_PC_TRICK_07 = 6
OBJFLAG_RM_PC_TRICK_08 = 7
OBJFLAG_RM_PC_TRICK_09 = 8
OBJFLAG_RM_PC_TRICK_10 = 9
OBJFLAG_RM_PC_COMBOCOMPLETE = 10

Script Kon_Goal_Gaps5_Start
create prefix = "TRG_G_GAP5_Trick"
//GoalManager_ReplaceTrickText name=kon_goal_gaps5 text="Kickflip\nHeelflip\nImpossible\n360 Flip"
//create_panel_block id=current_goal text=<tricktext> style=panel_message_goal
//GoalManager_ReplaceTrickText name=kon_goal_gaps5 text= "\n\t1\n\k1"
//SpawnScript goal_wait_and_show_key_combo_text params={ text=<tricktext> }
EndScript
Script Kon_Goal_Gaps5_Deactivate
kill prefix = "TRG_G_GAP5_Trick"
EndScript

Script KON_RM_TrickChecker
KON_RM_TrickFlagClear
wait 70 frames
create_panel_block id=current_goal text=" " style=panel_message_goal
wait 10 frames
//GoalManager_ReplaceTrickText name=kon_goal_gaps5 text="Kickflip\nHeelflip\nImpossible\nSemi Flip"
//create_panel_block id=current_goal text=<tricktext> style=panel_message_goal
GetKeyComboArrayFromTrickArray tricks=[Trick_Kickflip Trick_Heelflip Trick_Impossible Trick_SemiFlip]
<combo_1> = ( (goal_tetris_trick_text.( <keycombos>[0] ) ))
<combo_2> = ( (goal_tetris_trick_text.( <keycombos>[1] ) ))
<combo_3> = ( (goal_tetris_trick_text.( <keycombos>[2] ) ))
<combo_4> = ( (goal_tetris_trick_text.( <keycombos>[3] ) ))
FormatText TextName=Tricks "Kickflip\n%a\nHeelflip\n%b\nImpossible\n%c\nSemi Flip\n%d" a=<combo_1> b=<combo_2> c=<combo_3> d=<combo_4>
create_panel_block id=current_goal text=<Tricks> style=panel_message_goal
KON_RM_TricksRound Trick1="kickflip" Trick2="heelflip" Trick3="impossible" Trick4="semi flip" Roundcheck=KON_RM_Round1Check NextRound=KON_RM_TricksRound2
EndScript
Script KON_RM_TricksRound2
printf "onto round 2"
//GoalManager_ReplaceTrickText name=name=kon_goal_gaps5 text=<Tricks>
//create_panel_block id=current_goal text=<tricktext> style=panel_message_goal
GetKeyComboArrayFromTrickArray tricks=[Trick_Kickflip Trick_Heelflip Trick_Impossible Trick_Airwalk Trick_VarialKickflip]
<combo_1> = ( (goal_tetris_trick_text.( <keycombos>[0] ) ))
<combo_2> = ( (goal_tetris_trick_text.( <keycombos>[1] ) ))
<combo_3> = ( (goal_tetris_trick_text.( <keycombos>[2] ) ))
<combo_4> = ( (goal_tetris_trick_text.( <keycombos>[3] ) ))
<combo_5> = ( (goal_tetris_trick_text.( <keycombos>[4] ) ))
FormatText TextName=Tricks "Double Kickflip\n%a + \b1\nDouble Heelflip\n%b + \b1\nFingerflip\n\b7 + %c\nAirwalk\n%d\n360 Flip\n%e + \b1" a=<combo_1> b=<combo_2> c=<combo_3> d=<combo_4> e=<combo_5>
create_panel_block id=current_goal text=<tricks> style=panel_message_goal
KON_RM_TricksRound Trick1="Double Kickflip" Trick2="Double Heelflip" Trick3="Fingerflip" Trick4="Airwalk" Trick5 = "360 Flip" Roundcheck=KON_RM_Round2Check NextRound=KON_RM_TricksRound3
EndScript
Script KON_RM_TricksRound3
printf "onto round 3"
//GoalManager_ReplaceTrickText name=kon_goal_gaps5 text="Casper\nAnti Casper\nHandstand\nRusty Slide Manual"
//create_panel_block id=current_goal text=<tricktext> style=panel_message_goal
GetKeyComboArrayFromTrickArray tricks=[Trick_RustySlide]
<combo_1> = ( (goal_tetris_trick_text.( <keycombos>[0] ) ))
FormatText TextName=Tricks "Casper\n\b1 + \b0\nCasper Flip\n\b1 + \b1\nAnti Casper\n\b1 + \b2\nHandstand\n\b2 + \b2\nHandflip\n\b1 + \b1\nRusty Slide Manual\n%a" a=<combo_1>
create_panel_block id=current_goal text=<Tricks> style=panel_message_goal
KON_RM_TricksRound Trick1="Casper" Trick2="Casper Flip" Trick3="Anti Casper" Trick4="Handstand" Trick5="Handflip" Trick6="Rusty Slide Manual" Roundcheck=KON_RM_Round3Check NextRound=KON_RM_TricksRound2
EndScript

Script KON_RM_TricksRound Trick1="a" Trick2="b" Trick3="c" Trick5="d" Trick6="c" Trick4="d" Roundcheck=KON_RM_Round1Check NextRound=KON_RM_TricksRound2
begin
//  printstruct <...>

    begin   // starting to check for combo1 tricks
        if SkaterCurrentScorePotGreaterThan 1
            break
        endif
        wait 1 frame
    repeat
    begin   // starting to check for combo1 tricks
        KON_RM_TrickFlagClear   // clear the trick flags
        GetNumberOfTrickOccurrences TrickText = <Trick1>
        If ( <Number_Of_Occurrences> > 0 )
            printf "trick 1"
            KON_RM_TrickSetFlag_01
            GetNumberOfTrickOccurrences TrickText = <Trick2>
            If ( <Number_Of_Occurrences> > 0 )
                printf "trick 2"
                KON_RM_TrickSetFlag_02
                GetNumberOfTrickOccurrences TrickText = <Trick3>
                If ( <Number_Of_Occurrences> > 0 )
                    printf "trick 3"
                    KON_RM_TrickSetFlag_03
                    GetNumberOfTrickOccurrences TrickText = <Trick4>
                    If ( <Number_Of_Occurrences> > 0 )
                        printf "trick 4"
                        KON_RM_TrickSetFlag_04
                        GetNumberOfTrickOccurrences TrickText = <Trick5>
                        If ( <Number_Of_Occurrences> > 0 )
                            printf "trick 5"
                            KON_RM_TrickSetFlag_05
                            GetNumberOfTrickOccurrences TrickText = <Trick6>
                            If ( <Number_Of_Occurrences> > 0 )
                                printf "trick 6"
                                KON_RM_TrickSetFlag_06
                            endif
                        endif
                    endif
                endif
            endif
        endif
        wait 1 frame
        if NOT SkaterCurrentScorePotGreaterThan 1
            break
        endif
    repeat
    if Skater: IsInBail
        KON_RM_TrickFlagClear
    endif
    <RoundCheck>
    if Obj_FlagSet OBJFLAG_RM_PC_COMBOCOMPLETE
        KON_RM_TrickFlagClear
        break
    endif
repeat
<NextRound>
Endscript

Script KON_RM_Round1Check
if Obj_FlagSet OBJFLAG_RM_PC_TRICK_01
if Obj_FlagSet OBJFLAG_RM_PC_TRICK_02
if Obj_FlagSet OBJFLAG_RM_PC_TRICK_03
if Obj_FlagSet OBJFLAG_RM_PC_TRICK_04
Obj_SetFlag OBJFLAG_RM_PC_COMBOCOMPLETE
GoalManager_SetGoalFlag name=kon_goal_gaps5 Got_Part_1 1
endif
endif
endif
endif
Endscript
Script KON_RM_Round2Check
if Obj_FlagSet OBJFLAG_RM_PC_TRICK_01
if Obj_FlagSet OBJFLAG_RM_PC_TRICK_02
if Obj_FlagSet OBJFLAG_RM_PC_TRICK_03
if Obj_FlagSet OBJFLAG_RM_PC_TRICK_04
if Obj_FlagSet OBJFLAG_RM_PC_TRICK_05
Obj_SetFlag OBJFLAG_RM_PC_COMBOCOMPLETE
GoalManager_SetGoalFlag name=kon_goal_gaps5 Got_Part_2 1
endif
endif
endif
endif
endif
Endscript
Script KON_RM_Round3Check
if Obj_FlagSet OBJFLAG_RM_PC_TRICK_01
if Obj_FlagSet OBJFLAG_RM_PC_TRICK_02
if Obj_FlagSet OBJFLAG_RM_PC_TRICK_03
if Obj_FlagSet OBJFLAG_RM_PC_TRICK_04
if Obj_FlagSet OBJFLAG_RM_PC_TRICK_05
if Obj_FlagSet OBJFLAG_RM_PC_TRICK_06
Obj_SetFlag OBJFLAG_RM_PC_COMBOCOMPLETE
GoalManager_SetGoalFlag name=kon_goal_gaps5 Got_Part_3 1
endif
endif
endif
endif
endif
endif
Endscript

Script KON_RM_TrickFlagClear
Obj_ClearFlag OBJFLAG_RM_PC_TRICK_01
Obj_ClearFlag OBJFLAG_RM_PC_TRICK_02
Obj_ClearFlag OBJFLAG_RM_PC_TRICK_03
Obj_ClearFlag OBJFLAG_RM_PC_TRICK_04
Obj_ClearFlag OBJFLAG_RM_PC_TRICK_05
Obj_ClearFlag OBJFLAG_RM_PC_TRICK_06
Obj_ClearFlag OBJFLAG_RM_PC_TRICK_07
Obj_ClearFlag OBJFLAG_RM_PC_TRICK_08
Obj_ClearFlag OBJFLAG_RM_PC_TRICK_09
Obj_ClearFlag OBJFLAG_RM_PC_TRICK_10
Obj_ClearFlag OBJFLAG_RM_PC_COMBOCOMPLETE
Endscript
Script KON_RM_EndGaps
Skater: EndGap GapID=RM_PC_Trick01 text = "trick 1" 
Skater: EndGap GapID=RM_PC_Trick02 text = "trick 2"
Skater: EndGap GapID=RM_PC_Trick03 text = "trick 3"
Skater: EndGap GapID=RM_PC_Trick04 text = "trick 4"
Skater: EndGap GapID=RM_PC_Trick05 text = "trick 5"
Skater: EndGap GapID=RM_PC_Trick06 text = "trick 6"
Skater: EndGap GapID=RM_PC_Trick07 text = "trick 7"
Skater: EndGap GapID=RM_PC_Trick08
Skater: EndGap GapID=RM_PC_Trick09
Skater: EndGap GapID=RM_PC_Trick10
Endscript

Script KON_RM_TrickSetFlag_01
printf "setting flag 01"
TRG_G_GAP5_TrickChecker: Obj_SetFlag OBJFLAG_RM_PC_TRICK_01
Endscript
Script KON_RM_TrickSetFlag_02
TRG_G_GAP5_TrickChecker: Obj_SetFlag OBJFLAG_RM_PC_TRICK_02
Endscript
Script KON_RM_TrickSetFlag_03
TRG_G_GAP5_TrickChecker: Obj_SetFlag OBJFLAG_RM_PC_TRICK_03
Endscript
Script KON_RM_TrickSetFlag_04
TRG_G_GAP5_TrickChecker: Obj_SetFlag OBJFLAG_RM_PC_TRICK_04
Endscript
Script KON_RM_TrickSetFlag_05
TRG_G_GAP5_TrickChecker: Obj_SetFlag OBJFLAG_RM_PC_TRICK_05
Endscript
Script KON_RM_TrickSetFlag_06
TRG_G_GAP5_TrickChecker: Obj_SetFlag OBJFLAG_RM_PC_TRICK_06
Endscript
Script KON_RM_TrickSetFlag_07
TRG_G_GAP5_TrickChecker: Obj_SetFlag OBJFLAG_RM_PC_TRICK_07
Endscript
Script KON_RM_TrickSetFlag_08
TRG_G_GAP5_TrickChecker: Obj_SetFlag OBJFLAG_RM_PC_TRICK_08
Endscript
Script KON_RM_TrickSetFlag_09
TRG_G_GAP5_TrickChecker: Obj_SetFlag OBJFLAG_RM_PC_TRICK_09
Endscript
Script KON_RM_TrickSetFlag_10
TRG_G_GAP5_TrickChecker: Obj_SetFlag OBJFLAG_RM_PC_TRICK_10
Endscript

Push Mode#

It appears that the 2 player Push gamemode (which featured in multiple other Activision O2 titles) was considered for the Japanese release before being scrapped.

pushmode.BAK

// @DOC goal_pushmode
//  added by takashi mori for Japanese version (7/16)
// push_mode in kelly slater&mat hoffman is extremely fun
// originally just copied from scorechallenge.q
goal_pushmode_genericParams = {
    goal_text = "You must score the most points to win!"
    unlimited_time
    score = 1000000
    net
    init = goal_pushmode_init
    activate = goal_pushmode_activate
    active = goal_pushmode_active
    deactivate = goal_pushmode_deactivate
}

script goal_pushmode_init
endscript

script goal_pushmode_activate
    
    if InSplitScreenGame
        MakeSkaterGosub add_skater_to_world skater=0
        MakeSkaterGosub add_skater_to_world skater=1
        ScriptGetScreenMode
        switch <screen_mode>
            case split_vertical
                msg_pos=(350,42)
            case split_horizontal
                msg_pos=(620,27)
        endswitch
    else
        msg_pos=(620,27)
    endif

    
    
    printf "************** ACTIVATING pushmode **********************"
    ;RunScriptOnScreenElement id=the_time clock_morph
    ResetScore
    //goal_start goal_id=<goal_id>
endscript

script goal_pushmode_active
    if AnySkaterTotalScoreAtLeast <score>
        if OnServer
            if CalculateFinalScores
                GoalManager_DeactivateGoal name=<goal_id>
                goal_pushmode_finished
            endif
        else
            GoalManager_DeactivateGoal name=<goal_id>
            goal_pushmode_finished
        endif
    endif
endscript

script goal_pushmode_deactivate
    destroy_goal_panel_messages
    if ObjectExists id=sc_goal_text
        DestroyScreenElement id=sc_goal_text
    endif
endscript

script goal_pushmode_finished
    destroy_goal_panel_messages
    if ObjectExists id=sc_goal_text
        DestroyScreenElement id=sc_goal_text
    endif
    printf "goal_pushmode_deactivate"
    ResetScorePot
    create_rankings
endscript

script pushmode_done
    dialog_box_exit
    do_backend_retry
    ;MakeSkaterGoto SkaterInit
endscript
                              
script AddGoal_PushMode
    GoalManager_AddGoal name=pushmode {
        params={ goal_pushmode_genericParams
               }
    }
endscript

script StartGoal_pushmode
    if InSplitScreenGame
        SetScreenModeFromGameMode
    endif
    GoalManager_EditGoal name=pushmode params = <...>
    GoalManager_ActivateGoal name=pushmode
endscript

References#


  1. GDR プレイステーション2 ソフト一覧 2004年 - PlayStation2 Software List 2004↩︎