Alright script wizards...

Post your scripting questions / solutions here

Moderator: Moderators

Post Reply
User avatar
Gen Cobra
Major General
Posts: 739
Joined: Tue Jan 28, 2003 4:26 pm

Alright script wizards...

Post by Gen Cobra »

Here is one I could really use some guidance on. I want to execute my own mission complete at the end of my singleplayer campaign. Like the stats at the end when you complete a mission. I realize that it's

Code: Select all

$player endlevel
for the script to call it the end of the level and trigger the complete screen...

But how can I get my own image to appear on the mission complete screen with the music mus_berlin in the music folder to play?

Anyone?
Image
User avatar
tltrude
Chuck Norris
Posts: 4774
Joined: Sun Jul 07, 2002 4:03 am
Location: Oklahoma, USA
Contact:

Post by tltrude »

You can probably change the picture, just like for the loading screen.

statsscreen_success.urc
statsscreen_failed.urc

For the music, I don't think you can with these screens. If you are determined, you could make your own "credits_data" script like the one used in the game. That script has a tutorial built into it and is where the background image is called. The code below is form the last mission script (m6l3e.scr) in the game. That script is in pak5.pk3.

Code: Select all

//*********************************************
// Roll Credits
//*********************************************
roll_credits:

//*** set the level variable to stop the explosions
level.end_level = 1

//*** fade the screen out
fadeout 3 0 0 0 1

thread end_medals

wait 4

//*** stop the existing music
$train_engine_clip stoploopsound
$player stufftext "tmstop"
forcemusic aux2 aux2

//*** show 'THE END'
showmenu credits1
hidemouse

wait 3.5

//*** hide 'THE END'
hidemenu credits1
	
//*** when the player wins the game, play the the deisred credits music
//$player playsound credits2
	
//***********************************************************
//***********************************************************
//*** - These are variables used to set defaults for the credits script
//*** - These are all commented out, to change one, un-comment it and
//***    change it's value
//***********************************************************
//***********************************************************

//*** position variables on where to position the text on the screen
//level.section_xpos = 150    //*** section x position, where to place labels such as 'CAST'
//level.header_xpos = 150     //*** entry header x position, where to place labels such as 'Art Director'
//level.body_xpos = 340       //*** entry body x position, where to place the entry for lables such as 'Tadd Whomever'

//*** set the default colors for section text.  Defaults to white
//level.credits_section_red = 0
//level.credits_section_green = 0
//level.credits_section_blue = 0

//*** set the default colors for sub_section text.  Defaults to white
//level.credits_sub_section_red = 0
//level.credits_sub_section_green = 0
//level.credits_sub_section_blue = 0

//*** set the default colors for entry header text.  Default is grey
//level.credits_entry_header_red = 0
//level.credits_entry_header_green = 0
//level.credits_entry_header_blue = 0

//*** set the default colors for entry body text.  Default is grey
//level.credits_entry_body_red = .2
//level.credits_entry_body_green = .2
//level.credits_entry_body_blue = .2

//*** set the default font for section text.  Default is handle-23
//level.credits_section_font = "handle-23"

//*** set the default font for sub_section text.  Default is handle-22
//level.credits_sub_section_font = "handle-22"

//*** set the default font for entry header text.  Default is handle-18
//level.credits_entry_header_font = "handle-18"

//*** set the default font for entry body text.  Default is handle-18
//level.credits_entry_body_font = "handle-18"

//*** sets the time it takes for an entry to scroll up the screen in seconds
//*** this is based on going up 480 units, so this includes the time it takes to clear the borders.
//*** Default is 15 seconds
//level.credits_scrolltime = 17

//***********************************************************
//***********************************************************


//*** launch the credits setup thread first
waitthread global/credits.scr::credits_setup

//*** this script file contains all the data to display on the screen
waitthread global/credits_data.scr::credits_start

$player waittill sounddone

wait 2
$player playsound credits1 wait
$player waittill sounddone

$player playsound credits1 wait
$player waittill sounddone

$player playsound credits1 wait
$player waittill sounddone

$player playsound credits1 wait
$player waittill sounddone

$player playsound credits1 wait
$player waittill sounddone

end

Tom Trude,

Image
User avatar
Gen Cobra
Major General
Posts: 739
Joined: Tue Jan 28, 2003 4:26 pm

Post by Gen Cobra »

That's funny because that script was the first place I looked when trying this. I dont want to alter the original mission success urc because that would mean you would see my picture on all success you may have in the game.

I'm no scripting wizard for sure. I'm alright at it but that roll credits tutorial is not for me for sure. Anyone willing to help write this thing please help because it would be a welcome ending to such a long campaign.
Image
User avatar
bdbodger
Moderator
Posts: 2596
Joined: Tue Feb 25, 2003 7:34 am
Location: canada
Contact:

Post by bdbodger »

You can make your own urc for the end of your level do a show menu then do a bsptransition to the next map bypassing the level end screen like they do from one part of a mission to the next within the same mission . The SDK says
bsptransition( String next_map )


Transitions to the next BSP. Keeps player data, and game data.
and
leveltransition( String next_map )


Transitions to the next Level. Statistics to Map Loading, does not keep player data or game data.
nuggets
General
Posts: 1006
Joined: Fri Feb 28, 2003 2:57 am
Location: U-england-K (england in the UK) :P
Contact:

Post by nuggets »

do as Tom said and add
if (level.script == "your_map_name.scr")
{//do what tom said
}
hope this helps, prob not cos it's all foreign 2 me :-/
Post Reply