This is a sub-page of LEGO City Undercover (Windows, PlayStation 4, Xbox One, Nintendo Switch).
Chase McCain originally had a lot more tasks and missions to do in the city. They were probably removed/cut because of time, budget, or to focus on the main 7 jobs in the game (Astronaut, Police, Fire, Farmer, Robber, Miner, and Construction).
Side Mission Icons#
Icons for the unused side missions.











(Source: RandomWizKid)
Unused Super Build Icons#
Super Build textures that could be related to the cut side missions.





(Source: RandomWizKid)
Map Icons#
Unused side mission map icons.
How these map icons were intended to appear can be seen on this mock up in the files:
MAPSCREEN_DX11.TEX

It also seems to have an early race icon (in-between the stud bar and red brick) and an early ambulance icon. (under west)
(Source: RandomWizKid)
Taxi Mission UI#
User Interface textures for the Frantic Fares side mission.
FRANTICFARESTITLE_DX11.TEX

FF_FARETOTALMETER_DX11.TEX








(Source: RandomWizKid)
Unused Dialogue#
Frantic Fares#
All the unused customer lines intended for Frantic Fares.
TAXICUSTOMER1ENROUTE_PC.PAK
Filename |
Audio |
Transcript |
|---|---|---|
Taxi_Feedback_01_TaxiCustomer1.wav |
Hey - careful there. |
|
Taxi_Feedback_02_TaxiCustomer1.wav |
Woah! You've got a person back here, remember? |
|
Taxi_Feedback_03_TaxiCustomer1.wav |
You've got accident insurance, right? |
|
Taxi_Feedback_04_TaxiCustomer1.wav |
I don't like this! |
|
Taxi_Feedback_05_TaxiCustomer1.wav |
Keep on the road! |
|
Taxi_Feedback_06_TaxiCustomer1.wav |
Have you even passed your driver's test?! |
|
Taxi_Feedback_07_TaxiCustomer1.wav |
Are your eyes closed?! |
|
Taxi_Feedback_08_TaxiCustomer1.wav |
What are you doing?! |
|
Taxi_Feedback_09_TaxiCustomer1.wav |
I wanna' get there alive, y'know! |
|
Taxi_Feedback_10_TaxiCustomer1.wav |
Are you crazy?! |
|
Taxi_Feedback_11_TaxiCustomer1.wav |
Hey! |
|
Taxi_Feedback_12_TaxiCustomer1.wav |
Woah! |
|
Taxi_Feedback_13_TaxiCustomer1.wav |
Wuh-oh! |
|
Taxi_Feedback_14_TaxiCustomer1.wav |
Argh! |
|
Taxi_Feedback_15_TaxiCustomer1.wav |
Wargh! |
|
Taxi_Feedback_16_TaxiCustomer1.wav |
I want my mommy! |
TAXICUSTOMER1INTIMEROUGH_PC.PAK
{| class="wikitable" style="text-align: left;" !Filename !Audio !Transcript |- |Taxi_EndInTimeRough_01_TaxiCustomer1.wav | |I don't feel well... |- |Taxi_EndInTimeRough_02_TaxiCustomer1.wav | |Eurgh... That was horrible. |- |Taxi_EndInTimeRough_03_TaxiCustomer1.wav | |I've still got all my limbs, right? Ok. Well, thanks for journey of a lifetime, driver... |} TAXICUSTOMER1INTIMESMOOTH_PC.PAK
{| class="wikitable" style="text-align: left;" !Filename !Audio !Transcript |- |Taxi_EndInTimeSmooth_01_TaxiCustomer1.wav | |That was great driving, uh, driver! |- |Taxi_EndInTimeSmooth_02_TaxiCustomer1.wav | |Thanks, man! |} TAXICUSTOMER1LATEROUGH_PC.PAK
{| class="wikitable" style="text-align: left;" !Filename !Audio !Transcript |- |Taxi_EndLateSmooth_01_TaxiCustomer1.wav | |Oh great! Now I'm gonna' be in trouble. Thanks a bunch! |- |Taxi_EndLateSmooth_02_TaxiCustomer1.wav | |Sheesh! All you had to do was get me here on time! |} TAXICUSTOMER1LATESMOOTH_PC.PAK
{| class="wikitable" style="text-align: left;" !Filename !Audio !Transcript |- |Taxi_EndLateRough_01_TaxiCustomer1.wav | |Well, at least your crazy driving got me here on time! Oh, wait, no it didn't! |- |Taxi_EndLateRough_02_TaxiCustomer1.wav | |You are a bad, bad driver. Bad driver! |} TAXICUSTOMER1START_PC.PAK
{| class="wikitable" style="text-align: left;" !Filename !Audio !Transcript |- |Taxi_Destination_01_TaxiCustomer1.wav | |Uptown, and step on it! |- |Taxi_Destination_02_TaxiCustomer1.wav | |I need to be in Fresco yesterday! |- |Taxi_Destination_03_TaxiCustomer1.wav | |Auburn Docks please, and put your foot down! |- |Taxi_Destination_04_TaxiCustomer1.wav | |Bluebell Woods, pronto! |- |Taxi_Destination_05_TaxiCustomer1.wav | |Kings Court, and drive like crazy! |- |Taxi_Destination_06_TaxiCustomer1.wav | |I need to be in Paradise Sands as soon as possible, Mr! |- |Taxi_Destination_07_TaxiCustomer1.wav | |Crescent Park, please. And put your foot down! |} TAXICUSTOMER1TOOLONG_PC.PAK
{| class="wikitable" style="text-align: left;" !Filename !Audio !Transcript |- |Taxi_TakeTooLong_01_TaxiCustomer1.wav | |C'mon! Tick-tock, driver. |- |Taxi_TakeTooLong_02_TaxiCustomer1.wav | |We're gonna' be late! |- |Taxi_TakeTooLong_03_TaxiCustomer1.wav | |Drive faster! |}
TAXICUSTOMER2ENROUTE_PC.PAK
{| class="wikitable" style="text-align: left;" !Filename !Audio !Transcript |- |Taxi_Feedback_01_TaxiCustomer2.wav | |Hey - careful there. |- |Taxi_Feedback_02_TaxiCustomer2.wav | |Woah! You've got a person back here, remember? |- |Taxi_Feedback_03_TaxiCustomer2.wav | |You've got accident insurance, right? |- |Taxi_Feedback_04_TaxiCustomer2.wav | |I don't like this! |- |Taxi_Feedback_05_TaxiCustomer2.wav | |Keep on the road! |- |Taxi_Feedback_06_TaxiCustomer2.wav | |Have you even passed your driver's test?! |- |Taxi_Feedback_07_TaxiCustomer2.wav | |Are your eyes closed?! |- |Taxi_Feedback_08_TaxiCustomer2.wav | |What are you doing?! |- |Taxi_Feedback_09_TaxiCustomer2.wav | |I wanna' get there alive, y'know! |- |Taxi_Feedback_10_TaxiCustomer2.wav | |Are you crazy?! |- |Taxi_Feedback_11_TaxiCustomer2.wav | |Hey! |- |Taxi_Feedback_12_TaxiCustomer2.wav | |Woah! |- |Taxi_Feedback_13_TaxiCustomer2.wav | |Wuh-oh! |- |Taxi_Feedback_14_TaxiCustomer2.wav | |Argh! |- |Taxi_Feedback_15_TaxiCustomer2.wav | |Wargh! |- |Taxi_Feedback_16_TaxiCustomer2.wav | |I want my mommy! |} TAXICUSTOMER2INTIMEROUGH_PC.PAK
{| class="wikitable" style="text-align: left;" !Filename !Audio !Transcript |- |Taxi_EndInTimeRough_04_TaxiCustomer2.wav | |I'm just glad it's over... |- |Taxi_EndInTimeRough_05_TaxiCustomer2.wav | |I will never get in a taxi again. |- |Taxi_EndInTimeRough_06_TaxiCustomer2.wav | |I am this close to kissing the ground. But, I guess you did get me here pretty fast. So, thanks? |} TAXICUSTOMER2INTIMESMOOTH_PC.PAK
{| class="wikitable" style="text-align: left;" !Filename !Audio !Transcript |- |Taxi_EndInTimeSmooth_03_TaxiCustomer2.wav | |Nice driving! |- |Taxi_EndInTimeSmooth_04_TaxiCustomer2.wav | |That was amazing! |} TAXICUSTOMER2LATEROUGH
{| class="wikitable" style="text-align: left;" !Filename !Audio !Transcript |- |Taxi_EndLateSmooth_03_TaxiCustomer2.wav | |I'm late! That's just perfect! |- |Taxi_EndLateSmooth_04_TaxiCustomer2.wav | |You are a lousy taxi driver! |} TAXICUSTOMER2LATESMOOTH
{| class="wikitable" style="text-align: left;" !Filename !Audio !Transcript |- |Taxi_EndLateRough_03_TaxiCustomer2.wav | |So now I'm late and I have a bruised bottom. Perfect! |- |Taxi_EndLateRough_04_TaxiCustomer2.wav | |Well you ain't getting a tip! |} TAXICUSTOMER2START_PC.PAK
{| class="wikitable" style="text-align: left;" !Filename !Audio !Transcript |- |Taxi_Destination_08_TaxiCustomer2.wav | |Paradise Sands, and step on it! |- |Taxi_Destination_09_TaxiCustomer2.wav | |I gotta' be in Kings Court as soon as possible, driver! |- |Taxi_Destination_10_TaxiCustomer2.wav | |Fresco. And step on it. |- |Taxi_Destination_11_TaxiCustomer2.wav | |I gotta' get to Bluebell Woods now, Mr! |- |Taxi_Destination_12_TaxiCustomer2.wav | |I gotta' get to Crescent Park, and hurry! |- |Taxi_Destination_13_TaxiCustomer2.wav | |I need to be in Auburn Docks yesterday! |- |Taxi_Destination_14_TaxiCustomer2.wav | |I need to get to Uptown fast! |} TAXICUSTOMER2TOOLONG_PC.PAK
{| class="wikitable" style="text-align: left;" !Filename !Audio !Transcript |- |Taxi_TakeTooLong_04_TaxiCustomer2.wav | |I know I'm gonna' regret this, but could you drive faster? |- |Taxi_TakeTooLong_05_TaxiCustomer2.wav | |Hurry up! |- |Taxi_TakeTooLong_06_TaxiCustomer2.wav | |You're runnin' out of time! |}
TAXICUSTOMER3ENROUTE_PC.PAK
{| class="wikitable" style="text-align: left;" !Filename !Audio !Transcript |- |Taxi_Feedback_01_TaxiCustomer3.wav | |Hey - careful there. |- |Taxi_Feedback_02_TaxiCustomer3.wav | |Woah! You've got a person back here, remember? |- |Taxi_Feedback_03_TaxiCustomer3.wav | |You've got accident insurance, right? |- |Taxi_Feedback_04_TaxiCustomer3.wav | |I don't like this! |- |Taxi_Feedback_05_TaxiCustomer3.wav | |Keep on the road! |- |Taxi_Feedback_06_TaxiCustomer3.wav | |Have you even passed your driver's test?! |- |Taxi_Feedback_07_TaxiCustomer3.wav | |Are your eyes closed?! |- |Taxi_Feedback_08_TaxiCustomer3.wav | |What are you doing?! |- |Taxi_Feedback_09_TaxiCustomer3.wav | |I wanna' get there alive, y'know! |- |Taxi_Feedback_10_TaxiCustomer3.wav | |Are you crazy?! |- |Taxi_Feedback_11_TaxiCustomer3.wav | |Hey! |- |Taxi_Feedback_12_TaxiCustomer3.wav | |Woah! |- |Taxi_Feedback_13_TaxiCustomer3.wav | |Wuh-oh! |- |Taxi_Feedback_14_TaxiCustomer3.wav | |Argh! |- |Taxi_Feedback_15_TaxiCustomer3.wav | |Wargh! |- |Taxi_Feedback_16_TaxiCustomer3.wav | |I want my mommy! |} TAXICUSTOMER3INTIMEROUGH_PC.PAK
{| class="wikitable" style="text-align: left;" !Filename !Audio !Transcript |- |Taxi_EndInTimeRough_07_TaxiCustomer3.wav | |Thanks... I think. |- |Taxi_EndInTimeRough_08_TaxiCustomer3.wav | |Did I pass out during that journey? |- |Taxi_EndInTimeRough_09_TaxiCustomer3.wav | |I'm alive! I'm actually alive! And I'm early! Thanks, driver! |} TAXICUSTOMER3INTIMESMOOTH_PC.PAK
{| class="wikitable" style="text-align: left;" !Filename !Audio !Transcript |- |Taxi_EndInTimeSmooth_05_TaxiCustomer3.wav | |Thanks, Mr! |- |Taxi_EndInTimeSmooth_06_TaxiCustomer3.wav | |Great driving, Mr! |} TAXICUSTOMER3LATEROUGH_PC.PAK
{| class="wikitable" style="text-align: left;" !Filename !Audio !Transcript |- |Taxi_EndLateSmooth_05_TaxiCustomer3.wav | |And you really make a living from being that incompetant? Unbelievable! |- |Taxi_EndLateSmooth_06_TaxiCustomer3.wav | |Well now I've missed it! Are you happy? Yeesh! |} TAXICUSTOMER3LATESMOOTH_PC.PAK
{| class="wikitable" style="text-align: left;" !Filename !Audio !Transcript |- |Taxi_EndLateRough_05_TaxiCustomer3.wav | |I am gonna' report you to someone! |- |Taxi_EndLateRough_06_TaxiCustomer3.wav | |Was what just happened a crime? |} TAXICUSTOMER3START_PC.PAK
{| class="wikitable" style="text-align: left;" !Filename !Audio !Transcript |- |Taxi_Destination_15_TaxiCustomer3.wav | |Can you get me to Downtown, fast? |- |Taxi_Destination_16_TaxiCustomer3.wav | |Festival Square, on the double! |- |Taxi_Destination_17_TaxiCustomer3.wav | |Can you get me to Fort Meadows? |- |Taxi_Destination_18_TaxiCustomer3.wav | |Cherry Tree Hills, and don't spare the horses! |- |Taxi_Destination_19_TaxiCustomer3.wav | |I gotta' be in Bright Lights Plaza like yesterday, OK? |- |Taxi_Destination_20_TaxiCustomer3.wav | |Get me to Pagoda, fast! |- |Taxi_Destination_21_TaxiCustomer3.wav | |I need to be at the airport, now! |} TAXICUSTOMER3TOOLONG_PC.PAK
{| class="wikitable" style="text-align: left;" !Filename !Audio !Transcript |- |Taxi_TakeTooLong_07_TaxiCustomer3.wav | |We aren't gonna' get there in time! |- |Taxi_TakeTooLong_08_TaxiCustomer3.wav | |I'm not gonna' make it! |- |Taxi_TakeTooLong_09_TaxiCustomer3.wav | |Go faster! |}
TAXICUSTOMER4ENROUTE_PC.PAK
{| class="wikitable" style="text-align: left;" !Filename !Audio !Transcript |- |Taxi_Feedback_01_TaxiCustomer4.wav | |Hey - careful there. |- |Taxi_Feedback_02_TaxiCustomer4.wav | |Woah! You've got a person back here, remember? |- |Taxi_Feedback_03_TaxiCustomer4.wav | |You've got accident insurance, right? |- |Taxi_Feedback_04_TaxiCustomer4.wav | |I don't like this! |- |Taxi_Feedback_05_TaxiCustomer4.wav | |Keep on the road! |- |Taxi_Feedback_06_TaxiCustomer4.wav | |Have you even passed your driver's test?! |- |Taxi_Feedback_07_TaxiCustomer4.wav | |Are your eyes closed?! |- |Taxi_Feedback_08_TaxiCustomer4.wav | |What are you doing?! |- |Taxi_Feedback_09_TaxiCustomer4.wav | |I wanna' get there alive, y'know! |- |Taxi_Feedback_10_TaxiCustomer4.wav | |Are you crazy?! |- |Taxi_Feedback_11_TaxiCustomer4.wav | |Hey! |- |Taxi_Feedback_12_TaxiCustomer4.wav | |Woah! |- |Taxi_Feedback_13_TaxiCustomer4.wav | |Wuh-oh! |- |Taxi_Feedback_14_TaxiCustomer4.wav | |Argh! |- |Taxi_Feedback_15_TaxiCustomer4.wav | |Wargh! |- |Taxi_Feedback_16_TaxiCustomer4.wav | |I want my mommy! |} TAXICUSTOMER4INTIMEROUGH_PC.PAK
{| class="wikitable" style="text-align: left;" !Filename !Audio !Transcript |- |Taxi_EndInTimeRough_10_TaxiCustomer4.wav | |I'm glad we got here early. It'll give me some time to recover... |- |Taxi_EndInTimeRough_11_TaxiCustomer4.wav | |Thank you. Please never drive me again. |- |Taxi_EndInTimeRough_12_TaxiCustomer4.wav | |Thanks... I'm gonna' head over there and have a sit down for a while... |} TAXICUSTOMER4INTIMESMOOTH_PC.PAK
{| class="wikitable" style="text-align: left;" !Filename !Audio !Transcript |- |Taxi_EndInTimeSmooth_07_TaxiCustomer4.wav | |Thank you, driver. |- |Taxi_EndInTimeSmooth_08_TaxiCustomer4.wav | |You're the best! |} TAXICUSTOMER4LATEROUGH_PC.PAK
{| class="wikitable" style="text-align: left;" !Filename !Audio !Transcript |- |Taxi_EndLateSmooth_07_TaxiCustomer4.wav | |I coulda' walked here faster! |- |Taxi_EndLateSmooth_08_TaxiCustomer4.wav | |What's your name? I'm going to have you fired! |} TAXICUSTOMER4LATESMOOTH_PC.PAK
{| class="wikitable" style="text-align: left;" !Filename !Audio !Transcript |- |Taxi_EndLateRough_07_TaxiCustomer4.wav | |You are the worst taxi driver I've ever had. And I'm including the one who drove me off a cliff. |- |Taxi_EndLateRough_08_TaxiCustomer4.wav | |Well this is just typical of my luck! |} TAXICUSTOMER4START_PC.PAK
{| class="wikitable" style="text-align: left;" !Filename !Audio !Transcript |- |Taxi_Destination_22_TaxiCustomer4.wav | |Get me to the airport, please! |- |Taxi_Destination_23_TaxiCustomer4.wav | |Get me to Downtown, and make it fast! |- |Taxi_Destination_24_TaxiCustomer4.wav | |Get me to Festival Square, driver! |- |Taxi_Destination_25_TaxiCustomer4.wav | |I gotta' be in Fort Meadows like now! |- |Taxi_Destination_26_TaxiCustomer4.wav | |Bright Lights Plaza, and put your foot down! |- |Taxi_Destination_27_TaxiCustomer4.wav | |Get me to Cherry Tree Hills pronto, please! |- |Taxi_Destination_28_TaxiCustomer4.wav | |Can you get me to Pagoda, like now? |} TAXICUSTOMER4TOOLONG_PC.PAK
{| class="wikitable" style="text-align: left;" !Filename !Audio !Transcript |- |Taxi_TakeTooLong_10_TaxiCustomer4.wav | |You're going to make me late! |- |Taxi_TakeTooLong_11_TaxiCustomer4.wav | |We'll never make it in time! |- |Taxi_TakeTooLong_12_TaxiCustomer4.wav | |Hurry up! |}
(Source: RandomWizKid)
Alien Abduction#
SIDEMISSION_UFO_PC.PAK
{| class="wikitable" style="text-align: left;" !Conversation Name !Audio !Transcript |- |SideMission_UFO_Intro001 | |Well, this ain't the most conventional way of herdin' up animals, but it's worth a try. |- |SideMission_UFO_Intro002 | |I hope you've had flyin' saucer drivin' lessons... |- |SideMission_UFO_Intro003 | |Be careful with my animals! |- |SideMission_UFO_Bad001 | |That's not where they go! |- |SideMission_UFO_Bad002 | |Stop putting them in the wrong place! |- |SideMission_UFO_Bad003 | |Don't mix 'em up! They'll get all confusicated! |- |SideMission_UFO_Bad004 | |Can't you aim straight? |- |SideMission_UFO_Bad005 | |Put some effort in! |- |SideMission_UFO_Bad006 | |Now you're gettin' it wrong on purpose! |- |SideMission_UFO_Bad007 | |Don't put them together! They don't get on! |- |SideMission_UFO_Bad008 | |You're meant to be helpin' me out, remember? |- |SideMission_UFO_Good001 | |Yeah! That's it! |- |SideMission_UFO_Good002 | |Woo-hoo! |- |SideMission_UFO_Good003 | |Nice shot! |- |SideMission_UFO_Good004 | |Alright! |- |SideMission_UFO_Good005 | |Great stuff! |- |SideMission_UFO_Good006 | |That's just lovely! |- |SideMission_UFO_Good007 | |Bang on target! |- |SideMission_UFO_Good008 | |And she's in the pen! |- |SideMission_UFO_Good009 | |Spot on! |- |SideMission_UFO_Good010 | |Well done! |- |SideMission_UFO_Good011 | |Keep it up! |- |SideMission_UFO_Time001 | |Hurry up! You're almost out of time! |- |SideMission_UFO_Time002 | |You're not gonna' make it! |- |SideMission_UFO_Result001 | |I think it's safe to say that you made a right mess of that. |- |SideMission_UFO_Result002 | |I'll probably stick to traditional methods of herdin' in future if that's the best you can do. |- |SideMission_UFO_Result003 | |That didn't go too badly, I suppose. Certainly wasn't good, though. |- |SideMission_UFO_Result004 | |That's not bad herdin'. Considering you were flyin' a space ship at the same time. |- |SideMission_UFO_Result005 | |Well, you didn't quite get it right, but you should be proud of yourself. |- |SideMission_UFO_Result006 | |You should take this up as a job. A very weird job, granted, but one you've got a real future in. |- |SideMission_UFO_Result007 | |You sorted them perfectly! I couldn't have done it better myself. |}
(Source: RandomWizKid)
Hectic Harvest#
SIDEMISSION_HARVEST_PC.PAK
{| class="wikitable" style="text-align: left;" !Conversation Name !Audio !Transcript |- |SideMission_Harvest_Intro001 | |Ah! Your gonna' harvest my crop for me, are ya'? |- |SideMission_Harvest_Intro002 | |Let's see if you've got what it takes to be a farmer! |- |SideMission_Harvest_Intro003 | |Heh! It is about time this field was harvested. |- |SideMission_Harvest_Intro004 | |I bet you can't beat my record, though! |- |SideMission_Harvest_Intro005 | |The sooner the harvesting is done, the sooner I can bake the world's biggest loaf of bread and charge city folks to see it |- |SideMission_Harvest_Time001 | |You're runnin' out of time! |- |SideMission_Harvest_Time002 | |Ten seconds to go! |- |SideMission_Harvest_Result001 | |You do know you were meant to aim the harvester at the crop, right? |- |SideMission_Harvest_Result002 | |I suppose I should be impressed that even with a combine harvester as wide as a house, you managed to miss almost all of the crop. |- |SideMission_Harvest_Result003 | |I reckon you've managed to harvest enough to make a single bread roll. And not a big one, at that. |- |SideMission_Harvest_Result004 | |Were you just tryin' to write your name in it? It's bad enough when flyin' saucers do that. |- |SideMission_Harvest_Result005 | |Don't worry, I'll just do the rest of myself later. Huh! Useless! |- |SideMission_Harvest_Result006 | |Well, you're not a natural farmer, but I've seen worse efforts. Although only when Philbert's been driving. |- |SideMission_Harvest_Result007 | |Not bad at all! You can come and do some part-time work for me if you like? |- |SideMission_Harvest_Result008 | |Pretty good. I reckon you got at least half of it! |- |SideMission_Harvest_Result009 | |Nice work! You sure you haven't got any farmers in your family? |- |SideMission_Harvest_Result010 | |Would you like some? I've a daughter I'm trying to marry off. |- |SideMission_Harvest_Result011 | |I think you've found your true calling here! You can pack in all that crime solvin' nonsense. |- |SideMission_Harvest_Result012 | |You know what, I think you got almost every single stalk! You're a natural! |- |SideMission_Harvest_Result013 | |You did it! You harvested the complete field! I wish I'd brought my camera. And I knew how it worked. |}
(Source: RandomWizKid)
Side Mission Text#
Every text string relating to the many cut side missions.
Name |
Description |
|---|---|
MISSION_TITLE_COMBINE_HARVEST |
HECTIC HARVEST |
MISSION_INSTRUCTIONS_COMBINE_HARVEST |
Drive through the field of corn with the combine and harvest the entire crop! |
MISSION_TITLE_FIRE |
FIRE FIGHTERS |
MISSION_INSTRUCTIONS_FIRE |
Put out all the Fires along the route |
MISSION_TITLE_PARAMEDIC |
PARAMEDIC PANIC |
MISSION_INSTRUCTIONS_PARAMEDIC |
Drive to each patient's location and provide first aid assistance! |
MISSION_TITLE_REPAIR |
RAMPANT REPAIR |
MISSION_INSTRUCTIONS_REPAIR |
Search for the broken street lights and repair them quickly! |
MISSION_TITLE_TAXI |
FRANTIC FARES |
MISSION_INSTRUCTIONS_TAXI |
Pickup 5 passengers and deliver them to their destinations |
MISSION_TITLE_TOWTRUCK |
BREAKDOWN BONANZA |
MISSION_INSTRUCTIONS_TOWTRUCK |
Drive the Tow Truck to customer locations and fix or tow their vehicles back to the garage. |
MISSION_TITLE_UFO |
ALIEN ABDUCTION |
MISSION_INSTRUCTIONS_UFO |
Use the UFO to abduct and corral the livestock! Press A to start |
SC_RC_CAR_CHALLENGE |
RC CAR CHALLENGE |
SC_RC_CAR_CHALLENGE_DESC |
Complete 15 RC Challenges |
MAP_ICON_AIRSTUNT_TITLE |
Aerial Stunt Exit Point |
MAP_ICON_AIRSTUNT_DESC |
Jump out of any flying vehicle here to do a sky dive. |
LEGO_BONUS_MISSION_INFO |
You may need to progress through story to access these special missions. |
LEGO_BONUS_MISSION_UNLOCKED |
Bonus Missions! |
UNLOCK_SPECIALMISSIONS |
You've unlocked the special missions. You must complete Chapter 4 to be able to play these. |
MISSION_COMBINE_HARVESTER_BAR_NAME |
Corn Remaining |
MISSION_COMBINE_HARVESTER_START |
Start Harvesting! |
MISSION_FIRE01_CONVO_01 |
Hop on in, it's FireFighting time! |
MISSION_FIRE01_CONVO_02 |
We have a Fire at the Burger Place! |
MISSION_FIRE01_CONVO_03 |
The Courthouse is on Fire! |
MISSION_FIRE01_CONVO_04 |
Headquarters say that this is the last one. |
MISSION_FIRE01_CONVO_05 |
I'm going to take the truck back to the station. Good work! |
MISSION_FIRE01_PROMPT |
You must be a Fireman to accept this mission |
MISSION_PARAMEDIC_ABANDONED |
The ambulance has been abandoned. |
MISSION_PARAMEDIC_ABANDONED_PATIENT |
The patient has been abandoned. |
MISSION_PARAMEDIC_CHARACTER_PROMPT |
The Paramedic character is required to start this mission. |
MISSION_REPAIR_RETURN_TO_VEHICLE |
Return to the repair truck. |
MISSION_REPAIR_STAGEINSTR |
RADIO: Follow the SatNav to the next broken streetlight and fix it |
MISSION_TAXI_ABANDONED |
The Taxi Cab has been abandoned. |
MISSION_TAXI_CHARACTER_PROMPT |
The Taxi Driver character is required to start this mission. |
MISSION_TAXI_PROMPT |
Studs awarded based on time |
MISSION_TAXI_RETURN_TO_CAB |
Return to the Taxi Cab. |
MISSION_TAXI_STUDRING_PROMPT |
Studs awarded by passing through stud gates within time |
MISSION_TAXI_STUDTRAIL_PROMPT |
Studs awarded for collecting trail of studs within time |
MISSION_PARAMEDIC_PATIENT_01 |
RADIO: Patient injured at the end of Lombard Street |
MISSION_PARAMEDIC_PATIENT_02 |
RADIO: Help needed at the Gleeson Mansion, top of Lombard Street |
MISSION_PARAMEDIC_PATIENT_03 |
RADIO: Emergency call from the corner of Racine Road and Russian Hill |
MISSION_PARAMEDIC_PATIENT_04 |
RADIO: Patient waiting opposite the police station. |
MISSION_PARAMEDIC_PATIENT_05 |
RADIO: Emergency call from in front of Yellowbrick Railroad Station |
MISSION_TAXI_DIRECTIONS_PICKUP_01 |
RADIO: Customer waiting on Racine Road. |
MISSION_TAXI_DIRECTIONS_PICKUP_02 |
RADIO: Customer waiting in the Town Hall carpark. |
MISSION_TAXI_DIRECTIONS_PICKUP_03 |
RADIO: Customer waiting outside their house behind the Town Hall. |
MISSION_TAXI_DIRECTIONS_PICKUP_04 |
RADIO: Customer waiting NEED NAME |
MISSION_TAXI_DIRECTIONS_PICKUP_05 |
RADIO: Customer waiting NEED NAME |
MISSION_TOWRUCK_DIRECTIONS_DROPOFF_02 |
PHONE: Great, you found it. Tow the car to the Police Station where it'll be impounded. |
MISSION_TOWTRUCK_DIRECTIONS_PICKUP_01 |
PHONE: Drive to the Butternut Mansion on Lombard Street and fix their car. |
MISSION_TOWTRUCK_DIRECTIONS_PICKUP_02 |
PHONE: Follow your SatNav and tow the vehicle waiting for you. |
(Source: RandomWizKid)
Side Mission Code#
Under the STUFF/MISSIONS/LIVE/SIDE_MISSIONS folder, there are scripts for the unused side missions.
COMBINE_HARVESTER_MISSION.SF
WorldLevel wlCity("Lego_City");
WorldLevel wlFarmLands("WI_Farmlands_0507");
Timer timeMission(0);
HotSpot hMissionStart("BM_Harvest_FL_01_Start", wlCity);
Character cPlayer1("player1");
Character cPlayer2("player2");
Character cMissionPlayer;
Vehicle cHarvester;
Locator lVehicleSpawn("BM_Harvest_FL_01_SpawnHarvester", wlCity);
Locator lResetPlayer("BM_Harvest_FL_01_ResetPlayer", wlCity);
Text tVehicleType("CombineHarvester");
Number nCityHeroTarget(42000); // Total required for Lego city hero
Number nMaxTime(200); // Maximum time the player has
Number nTotal(0); // Total number of corn blowups triggered
Number nMaxCorn(0); // Total number of corn availble (set via AI messages / the complex gizmos themselves
Function LevelEnter (WorldLevel level)
{
if (!cPlayer1)
{
cPlayer1 = "player1";
};
if (!cPlayer2)
{
cPlayer2 = "player2";
};
};
////////////////////////////////////////////////////////////////////////////////////
// Setup
////////////////////////////////////////////////////////////////////////////////////
State Setup()
{
Conditions
{
if ( wlCity.IsLoaded() )
{
goto EnableHotspot();
};
};
Actions
{
};
};
State EnableHotspot()
{
Conditions
{
};
Actions
{
// setup stuff...
// [NOTE: stuff done here must be un-done in Cleanup()]
hMissionStart.SetHaloVisible(false);
hMissionStart.SetIcon("Bonus");
hMissionStart.SetActive(true);
hMissionStart.NoCondition();
goto WaitForReturnToTile();
};
};
State WaitForReturnToTile()
{
Conditions
{
if( wlFarmLands.IsLoaded() )
{
if ( cHarvester )
{
cHarvester.Destroy();
cHarvester = "";
};
goto WaitForPlayerInVehicle();
};
};
Actions
{
};
};
// Activate, then await the player to enter the combine harvester.
State WaitForPlayerInVehicle()
{
Conditions
{
// Check to see if the player enters the mission's vehicle
if ( cHarvester )
{
if( cPlayer1.GetVehicle() == cHarvester )
{
if (MissionFocus(cPlayer1))
{
cMissionPlayer = cPlayer1;
goto GiveMissionPrompts();
};
};
if( cPlayer2.GetVehicle() == cHarvester )
{
if (MissionFocus(cPlayer2))
{
cMissionPlayer = cPlayer2;
goto GiveMissionPrompts();
};
};
};
if( !wlFarmLands.IsLoaded() AND cHarvester ) { goto WaitForReturnToTile(); };
};
Actions
{
if ( !cHarvester )
{
Number nDirection(0);
nDirection = lVehicleSpawn.GetDirection();
cHarvester = CreateAIVehicle( tVehicleType, "Farm", lVehicleSpawn, nDirection );
wait(0);
cHarvester.SetParked(true);
};
};
};
// Checks to see if the player starts the mission or not - handles accepting the mission
State GiveMissionPrompts()
{
// Number n(0);
Conditions
{
// Gets out of the vehicle before pressing LB to initiate mission...
if( cMissionPlayer.GetVehicle() != cHarvester )
{
cHarvester.SetParked(false);
UI_HideMissionPrompt();
MissionUnfocus();
goto WaitForPlayerInVehicle();
};
if( PlayerPressedButton(cMissionPlayer, "A") )
{
MissionActivate();
};
};
Actions
{
UI_ShowMissionPrompt("Hud_Mission_Bonus_Combine", "MISSION_INSTRUCTIONS_COMBINE_HARVEST", "MISSION_PROMPT", "MISSION_TITLE_COMBINE_HARVEST");
};
};
////////////////////////////////////////////////////////////////////////////
// CLEANUP
////////////////////////////////////////////////////////////////////////////
State Cleanup()
{
Number n(0);
Actions
{
// cleanup stuff...
if ( MissionWasCompleted() )
{
goto AwaitEndScreen();
};
if ( MissionWasAborted() )
{
FadeScreen(true);
Wait(1);
Message mHideCorn("msg_Level.wifl_cornhide", wlFarmLands);
Message mShowCorn("msg_Level.wifl_cornshow", wlFarmLands);
Message_Set(mShowCorn, 0);
Message_Set(mHideCorn, 1);
if (cMissionPlayer.GetVehicle())
{
cMissionPlayer.ClearVehicle();
};
};
if ( hMissionStart )
{
hMissionStart.SetActive(false);
};
if ( cHarvester )
{
cHarvester.Destroy();
cHarvester = "";
};
StreamedCharacterReleaseAll();
if ( MissionWasAborted() )
{
Wait(1);
FadeScreen(false);
n = lResetPlayer.GetDirection();
cMissionPlayer.Teleport( lResetPlayer, n );
};
// All tidy, let the game know...
MissionCleanupEnd();
};
};
State AwaitEndScreen( )
{
Conditions
{
if ( UI_IsEndMissionComplete())
{
goto HandleCompleted();
};
};
Actions
{
cHarvester.SetParked(true);
};
};
State HandleCompleted( )
{
Number n(0);
Actions
{
Wait(0.5);
FadeScreen(true);
Wait(1);
Message mHideCorn("msg_Level.wifl_cornhide", wlFarmLands);
Message mShowCorn("msg_Level.wifl_cornshow", wlFarmLands);
Message_Set(mShowCorn, 0);
Message_Set(mHideCorn, 1);
if ( !cMissionPlayer )
{
cMissionPlayer = MissionGetPlayer();
};
if ( cMissionPlayer.GetVehicle() )
{
cMissionPlayer.ClearVehicle();
};
if ( cHarvester )
{
cHarvester.Destroy();
cHarvester = "";
};
StreamedCharacterReleaseAll();
Wait(0.5);
n = lResetPlayer.GetDirection();
cMissionPlayer.Teleport( lResetPlayer, n );
FadeScreen(false);
Wait();
MissionCleanupEnd();
};
};
////////////////////////////////////////////////////////////////////////////
// MISSION
////////////////////////////////////////////////////////////////////////////
State Begin()
{
Message mTotal("msg_Level.wifl_corntotal", wlFarmLands);
Actions
{
UI_StartMission();
Wait (0.5);
FadeScreen(true);
Wait(1);
hMissionStart.Trigger();
Message mHideCorn("msg_Level.wifl_cornhide", wlFarmLands);
Message mShowCorn("msg_Level.wifl_cornshow", wlFarmLands);
Message_Set(mHideCorn, 0);
Message_Set(mShowCorn, 1);
SnapCameraToDir(1, "Rear");
Wait();
FadeScreen(false);
Wait(0.25);
// Count down on screen
Wait(1);
UI_SetMissionMessage("MISSION_GENERIC_COUNTDOWN_3", 2 );
Wait(2);
UI_SetMissionMessage("MISSION_GENERIC_COUNTDOWN_2", 2 );
Wait(2);
UI_SetMissionMessage("MISSION_GENERIC_COUNTDOWN_1", 2 );
Wait(2);
UI_RemoveMissionMessage();
cHarvester.SetParked(false);
timeMission = 0;
UI_SetMissionMessage ( "MISSION_COMBINE_HARVESTER_START", 3 );
UI_SetHUDTimer( nMaxTime, 1, timeMission );
UI_ShowHUDTimer(true);
UI_SetHeroBarMax( nCityHeroTarget );
// Each CompelxGizmo (due to its builder scene flow) increments the message mTotal references by 1 on startup, giving the total number of complex gizmos
nMaxCorn = mTotal;
UI_SetMissionDamageBarText("MISSION_COMBINE_HARVESTER_BAR_NAME");
UI_SetMissionDamageBar ( nMaxCorn, nMaxCorn );
UI_ShowMissionDamageBar(true);
goto CheckCorn();
};
};
// this state watches how much corn has been harvested and checks the player is still in the vehicle
State CheckCorn()
{
// Check to see if the message is greater than 0 - each complex gizmo (due to its builder scene flow) increments the message by 1 when it blows up
Message mBlowup("msg_Level.wifl_cornblowup", wlFarmLands);
Conditions
{
if ( !wlFarmLands.IsLoaded() ) { goto AbandonMission(); };
if( mBlowup > 0 ) { goto CornProcess(); };
// if all the corn has been destroyed / harvested, go to the end of the mission (yay)
if( nTotal >= nMaxCorn ) { goto Reset(); };
// if the player runs away
if( cMissionPlayer.GetVehicle() != cHarvester) { goto AbandonMission(); };
if( timeMission >= nMaxTime) { goto OutOfTime(); };
};
Actions
{
};
};
// Give coins and increment total based on how many blowups have been destroyed / are remaining (need to include time as a bonus still)
State CornProcess()
{
Message mBlowup("msg_Level.wifl_cornblowup", wlFarmLands);
Number nTimeMultiplier(1);
Number n(0);
Conditions
{
if ( !wlFarmLands.IsLoaded() ) { goto AbandonMission(); };
if( timeMission >= nMaxTime) { goto OutOfTime(); };
};
Actions
{
while ( mBlowup > 0 ) // Do the below until the AI message is 0 and therefor all corn complex gizmos blowing up have been registered by the script
{
nTotal = nTotal + 1; // Increment the total number of corn destroyed
Message_Set( mBlowup, (mBlowup - 1) ); // decrement the AI message
// Work out time multiplier
// Normalise the value
nTimeMultiplier = (( nMaxTime - timeMission ) / nMaxTime);
// Add 1, so that applying the multiplier gives a percentage of the value, plus the value itself
nTimeMultiplier = nTimeMultiplier + 1;
// Safety check that nMultiplier is above 1
if ( nTimeMultiplier < 1 ) { nTimeMultiplier = 1; };
// Check to see how many corn remain and reward more studs if most of the corn has been harvested
if( nTotal < (nMaxCorn / 2) ) { n = (100 * nTimeMultiplier); }
elseif( nTotal < ( nMaxCorn * (3/4) ) ) { n = (200 * nTimeMultiplier); }
else { n = (300 * nTimeMultiplier); };
//Award the player studs
PlayerGiveStuds( n );
};
// Update the bar displaying the mission's progress
UI_SetMissionDamageBar ( (nMaxCorn - nTotal), nMaxCorn );
goto CheckCorn();
};
};
State OutOfTime( )
{
Conditions
{
};
Actions
{
UI_EndMission("MISSION_FAIL_TIMEOUT", false);
goto HandleFailScreen();
};
};
State HandleFailScreen( )
{
Timer time(0);
Bool b(false);
Conditions
{
if ( time > 0.1 AND PlayerPressedButton(cMissionPlayer, "A") )
{
UI_ResetMission();
goto Restart();
}
elseif ( PlayerPressedButton(cMissionPlayer, "B") AND !b )
{
UI_ResetMission();
goto Reset();
}
else
{
if ( (b AND !cMissionPlayer.GetVehicle()) OR PlayerPressedButton(cMissionPlayer, "A") OR PlayerPressedButton(cMissionPlayer, "Y") )
{
UI_ResetMission();
goto Reset();
};
};
};
Actions
{
if ( cMissionPlayer.GetVehicle() )
{
b = true;
};
if ( cHarvester )
{
cHarvester.SetParked(true);
};
};
};
State AbandonMission( )
{
Conditions
{
};
Actions
{
Wait(1.5);
UI_EndMission("MISSION_GENERIC_ABANDONED", false);
goto HandleFailScreen();
};
};
State Restart( )
{
Message mTotal("msg_Level.wifl_corntotal", wlFarmLands);
Number nDirection(0);
Actions
{
//FadeScreen(true);
Wait(1);
Message mHideCorn("msg_Level.wifl_cornhide", wlFarmLands);
Message mShowCorn("msg_Level.wifl_cornshow", wlFarmLands);
if ( wlFarmLands.IsLoaded() )
{
Message_Set(mShowCorn, 0);
Message_Set(mHideCorn, 1);
}
UI_StopHUDTimer();
UI_ShowHUDTimer(false);
UI_ShowMissionDamageBar(false);
nTotal = 0;
nDirection = lVehicleSpawn.GetDirection();
cHarvester.Teleport( lVehicleSpawn, nDirection );
Wait(2);
Message_Set(mHideCorn, 0);
Message_Set(mShowCorn, 1);
Wait();
SnapCameraToDir(1, "Rear");
FadeScreen(false);
Wait(0.25);
// Count down on screen
Wait(1);
UI_SetMissionMessage("MISSION_GENERIC_COUNTDOWN_3", 2 );
Wait(2);
UI_SetMissionMessage("MISSION_GENERIC_COUNTDOWN_2", 2 );
Wait(2);
UI_SetMissionMessage("MISSION_GENERIC_COUNTDOWN_1", 2 );
Wait(2);
UI_RemoveMissionMessage();
cHarvester.SetParked(false);
timeMission = 0;
UI_SetMissionMessage ( "MISSION_COMBINE_HARVESTER_START", 3 );
UI_SetHUDTimer( nMaxTime, 1, timeMission );
UI_ShowHUDTimer(true);
UI_SetHeroBarMax( nCityHeroTarget );
// Each CompelxGizmo (due to its builder scene flow) increments the message mTotal references by 1 on startup, giving the total number of complex gizmos
nMaxCorn = mTotal;
UI_SetMissionDamageBarText("MISSION_COMBINE_HARVESTER_BAR_NAME");
UI_SetMissionDamageBar ( nMaxCorn, nMaxCorn );
UI_ShowMissionDamageBar(true);
goto CheckCorn();
};
};
State Reset( )
{
Conditions
{
};
Actions
{
UI_StopHUDTimer();
UI_ShowHUDTimer(false);
UI_ShowMissionDamageBar(false);
if ( nTotal >= nMaxCorn )
{
MissionComplete();
}
else
{
MissionAbort();
};
};
};
FIRETRUCK_SFRESIDENTIAL_01.SF
//Definitions
Timer StageTimer(0);
Character cPlayer1("Player1");
Character cPlayer2("Player2");
Character cPlayerX("");
Character cDriver("");
Character cFireTruck("");
Character cFireTruckSeat("");
Locator lFireTruckSpawn("");
Locator lDestination01("");
Locator lDestination02("");
Locator lDestination03("");
Text tVehicleType("Fire_Engine_2");
Text tDriverType("Fireman");
Text tTest("FIRETRUCK TEST");
Text tWin("Win!");
Text tFire("iFireTruck_SFR_01_Fire");
Text tConvo_01 ("MISSION_FIRE01_CONVO_01");
Text tConvo_02 ("MISSION_FIRE01_CONVO_02");
Text tConvo_03 ("MISSION_FIRE01_CONVO_03");
Text tConvo_04 ("MISSION_FIRE01_CONVO_04");
Text tConvo_05 ("MISSION_FIRE01_CONVO_05");
Text tPrompt ("MISSION_FIRE01_PROMPT");
Text tClassP1("");
Text tClassP2("");
Number nConvo(0);
Number nJustTalked(0);
Number nHeroMax(14000);
Number nRandomFireAward(2000);
Number nMainFireAward(10000);
Number nStage(1);
Number nOptFire01(0);
Number nOptFire02(0);
Number nOptFire03(0);
Number nOptFire04(0);
Area aConvo01("");
Area aConvo02("");
Text tScript("driveToSubstitute");
Area aMissionStart("");
Hotspot hMissionStart("");
//Gizmo gfire("fire01");
WorldLevel wlCity ("Lego_City");
WorldLevel wlMissionStart("SF_Residential_0921");
Global Locator gLocDriveTo("");
Global Number gNumDriveSpeed(5);
Gizmo gFire01("");
Gizmo gFire02("");
Gizmo gFire03("");
Gizmo gFire04("");
Gizmo gFire05("");
Gizmo gFire06("");
Gizmo gFire07("");
Gizmo gFire08("");
Gizmo gFire09("");
Number nFires(9); // Number of fires that need mass adjusting
Gizmo g("");
/////////////////////////////////////////////////////////////////////////////////
//// SETUP STAGE
/////////////////////////////////////////////////////////////////////////////////
State Setup()
{
Conditions
{
if ( wlCity.IsLoaded() )
{
goto DefineDefinitions();
};
};
Actions
{
};
};
State DefineDefinitions()
{
lFireTruckSpawn = "BM_Fire_SFR_01_SpawnFireTruck";
lDestination01 = "BM_Fire_SFR_01_CP01";
lDestination02 = "BM_Fire_SFR_01_CP02";
lDestination03 = "BM_Fire_SFR_01_CP03";
aMissionStart = "BM_Fire_SFR_01_Start";
aConvo01 = "BM_Fire_SFR_01_Convo01";
aConvo02 = "BM_Fire_SFR_01_Convo02";
hMissionStart = "BM_Fire_SFR_01_HotSpot";
gFire01 = "iFireTruck_SFR_01_Fire01";
gFire02 = "iFireTruck_SFR_01_Fire02";
gFire03 = "iFireTruck_SFR_01_Fire03";
gFire04 = "iFireTruck_SFR_01_Fire04";
gFire05 = "iFireTruck_SFR_01_Fire05";
gFire06 = "iFireTruck_SFR_01_Fire06";
gFire07 = "iFireTruck_SFR_01_Fire07";
gFire08 = "iFireTruck_SFR_01_Fire08";
gFire09 = "iFireTruck_SFR_01_Fire09";
Number n(1);
Conditions
{
if (n > nFires)
{
goto Base();
};
};
Actions
{
// Turn off fire ... will go in Cleanup
While (n <= nFires)
{
g = (tFire + n.ToText("int 2"));
g.SetVisible(false);
g.SetActive(false);
n = n + 1;
};
hMissionStart.SetHaloVisible(false);
hMissionStart.SetIcon("Bonus");
hMissionStart.SetActive(true);
hMissionStart.NoCondition();
};
};
State WaitForReturnToTile()
{
Conditions
{
if( wlMissionStart.IsLoaded() )
{
goto Base();
};
};
Actions
{
if ( cFireTruck )
{
// if ( cPlayer1.InVehicle() !=cFireTruck )
// {
// cFireTruck.Deactivate();
// cFireTruck = "";
// };
};
};
};
State Base()
{
Timer OfferTimer(0);
Conditions
{
if ( wlCity.IsLoaded())
{
if ( aMissionStart.Inside("Player1") AND !cPlayer1.InVehicle())
{
if (MissionFocus(cPlayer1))
{
goto PrepOfferMissionP1();
};
};
if ( aMissionStart.Inside("Player2") AND !cPlayer2.InVehicle())
{
if (MissionFocus(cPlayer2))
{
goto PrepOfferMissionP2();
};
};
};
if( !wlMissionStart.IsLoaded() )
{
goto WaitForReturnToTile();
};
};
Actions
{
Number nDirection(0);
if ( !cFireTruck )
{
nDirection = lFireTruckSpawn.GetDirection();
cFireTruck = CreateCharacter( tVehicleType, lFireTruckSpawn, "default", nDirection );
cFireTruckSeat = CreateCharacter( tSeatType, lFireTruckSpawn, "default", nDirection );
Wait(1);
cFireTruck.CoupleVehicle(cFireTruckSeat, 1);
cFireTruckSeat = cFireTruck.GetCoupled();
cFireTruck.SetParked(true);
};
};
};
State PrepOfferMissionP1()
{
Timer OfferTimer(0);
Conditions
{
tClassP1 = cPlayer1.GetClass();
If (tClassP1 == "Fireman")
{
UI_RemoveMissionHelpText();
cPlayerX = cPlayer1;
Goto OfferMission();
};
If (tClassP1 != "Fireman" AND OfferTimer > 1.5)
{
OfferTimer = 0;
UI_SetMissionHelpText(tPrompt, 2);
};
if (!aMissionStart.Inside("Player1") OR cPlayer1.InVehicle())
{
MissionUnFocus();
goto Base();
};
};
Actions
{
};
};
State PrepOfferMissionP2()
{
Timer OfferTimer(0);
Conditions
{
tClassP2 = cPlayer2.GetClass();
If (tClassP2 == "Fireman")
{
UI_RemoveMissionHelpText();
cPlayerX = cPlayer2;
Goto OfferMission();
};
If (tClassP2 != "Fireman" AND OfferTimer > 1.5)
{
OfferTimer = 0;
UI_SetMissionHelpText(tPrompt, 2);
};
if (!aMissionStart.Inside("Player2") OR cPlayer2.InVehicle())
{
MissionUnFocus();
goto Base();
};
};
Actions
{
};
};
State OfferMission()
{
Conditions
{
if( PlayerPressedButton(cPlayerX, "Y") )
{
UI_HideMissionPrompt();
MissionUnfocus();
goto WaitForBase();
};
if( PlayerPressedButton(cPlayerX, "A") )
{
MissionActivate();
};
if (!aMissionStart.Inside(cPlayerX))
{
UI_HideMissionPrompt();
MissionUnfocus();
goto WaitForBase();
};
tClassP1 = cPlayer1.GetClass();
if (tClassP1 != "Fireman" AND cPlayerX == "Player1")
{
UI_HideMissionPrompt();
MissionUnfocus();
cPlayerX = "";
goto Base();
};
tClassP2 = cPlayer2.GetClass();
if (tClassP2 != "Fireman" AND cPlayerX == "Player2")
{
UI_HideMissionPrompt();
MissionUnfocus();
cPlayerX = "";
goto Base();
};
};
Actions
{
MissionFocus(cPlayerX);
UI_ShowMissionPrompt("Hud_Mission_Bonus_Fire", "MISSION_INSTRUCTIONS_FIRE", "MISSION_PROMPT", "MISSION_TITLE_FIRE");
};
};
State WaitForBase()
{
Conditions
{
};
Actions
{
wait(5);
Goto Base();
};
};
/////////////////////////////////////////////////////////////////////////////////
//// CLEANUP STAGE
/////////////////////////////////////////////////////////////////////////////////
State Cleanup()
{
Actions
{
// Turns off remaining fires, wont be needed when cleanup script is present
Number n(6);
StageTimer = 0;
Number z(0);
if (wlCity.IsLoaded())
{
While (n <= nFires)
{
g = (tFire + n.ToText("int 2"));
g.SetVisible(false);
g.SetActive(false);
n = n + 1;
};
if ( hMissionStart )
{
hMissionStart.SetActive(false);
};
if ( MissionWasCompleted() )
{
UI_SetMissionHelpText(tConvo_05, 3);
wait(3);
if (cDriver)
{
if ( cDriver == cFireTruck.InVehicle() )
{
// cFireTruck.SetScript("traffic");
}
else
{
cDriver.Deactivate();
// cFireTruck.SetScript("KillOffScreen");
};
};
};
};
MissionCleanupEnd();
};
};
/////////////////////////////////////////////////////////////////////////////////
//// MISSION STAGE
/////////////////////////////////////////////////////////////////////////////////
State Begin()
{
Number n(1);
Timer BeginTimer(0);
Conditions
{
if ( cDriver.InVehicle() != cFireTruck AND ( cPlayer1.InVehicle() != cFireTruck OR cPlayer2.InVehicle() != cFireTruck ) AND BeginTimer > 3)
{
cDriver.TakeOver(cFireTruck);
cDriver.SetScript(tScript);
};
};
Actions
{
gLocDriveTo = "BM_Fire_SFR_01_CP03";
UI_StartMission();
UI_SetHeroBarMax(nHeroMax);
hMissionStart.Trigger();
Number nDirection(0);
nDirection = lFireTruckSpawn.GetDirection();
cDriver = CreateCharacter( tDriverType, lFireTruckSpawn, "default", nDirection );
wait(0.1);
cDriver.TakeOver(cFireTruck);
UI_SetMissionHelpText(tConvo_01, 3);
wait(3);
While (n <= nFires)
{
g = (tFire + n.ToText("int 2"));
g.SetVisible(true);
g.SetActive(true);
n = n + 1;
};
wait(2);
cFireTruck.SetParked(false);
goto Drive();
};
};
State Drive()
{
Timer convoTimer(5);
Conditions
{
if (cFireTruck.DistanceToXZ(gLocDriveTo) < 3.5 AND StageTimer > 18)
{
goto DestinationReached();
};
if (gFire06.HasFinished() AND nOptFire01 == 0)
{
nOptFire01 = 1;
Playergivestuds(nRandomFireAward);
};
if (gFire07.HasFinished() AND nOptFire02 == 0)
{
nOptFire02 = 1;
Playergivestuds(nRandomFireAward);
};
if (gFire08.HasFinished() AND nOptFire03 == 0)
{
nOptFire03 = 1;
Playergivestuds(nRandomFireAward);
};
if (gFire09.HasFinished() AND nOptFire04 == 0)
{
nOptFire04 = 1;
Playergivestuds(nRandomFireAward);
};
if (cDriver.InArea(aConvo01) AND nConvo == 0)
{
nConvo = 1;
nJustTalked = 1;
UI_SetMissionHelpText(tConvo_02, 3);
convoTimer = 0;
};
if (cDriver.InArea(aConvo02) AND nConvo == 1)
{
nConvo = 2;
nJustTalked = 1;
UI_SetMissionHelpText(tConvo_03, 3);
convoTimer = 0;
};
if (cDriver.InArea(aConvo02) AND nConvo == 2 AND nJustTalked == 0)
{
nConvo = 3;
nJustTalked = 1;
UI_SetMissionHelpText(tConvo_04, 3);
convoTimer = 0;
};
if ((!cDriver.InArea(aConvo01) OR !cDriver.InArea(aConvo02)) AND nJustTalked == 1 AND convoTimer > 8)
{
nJustTalked = 0;
};
if (cDriver.InVehicle() != cFireTruck) AND (cPlayer1.InVehicle() != cFireTruck OR cPlayer2.InVehicle() !=cFireTruck) )
{
cDriver.TakeOver(cFireTruck);
cDriver.SetScript(tScript);
};
if (gfire01.HasFinished() AND gfire02.HasFinished() AND gfire03.HasFinished() AND gfire04.HasFinished() AND gfire05.HasFinished())
{
Playergivestuds(nMainFireAward);
gLocDriveTo = lFireTruckSpawn;
cFireTruck.SetParked(false);
cDriver.SetScript(tScript);
UI_SetStatsStuds();
MissionComplete();
};
};
Actions
{
StageTimer = 0;
cDriver.SetScript(tScript);
};
};
State DestinationReached()
{
Timer StopTimer(0);
Conditions
{
if (gfire01.HasFinished() AND gfire02.HasFinished() AND gfire03.HasFinished() AND gfire04.HasFinished() AND gfire05.HasFinished())
{
Playergivestuds(nMainFireAward);
gLocDriveTo = lFireTruckSpawn;
cFireTruck.SetParked(false);
cDriver.SetScript(tScript);
UI_SetStatsStuds();
MissionComplete();
};
if (gFire06.HasFinished() AND nOptFire01 == 0)
{
nOptFire01 = 1;
Playergivestuds(nRandomFireAward);
};
if (gFire07.HasFinished() AND nOptFire02 == 0)
{
nOptFire02 = 1;
Playergivestuds(nRandomFireAward);
};
if (gFire08.HasFinished() AND nOptFire03 == 0)
{
nOptFire03 = 1;
Playergivestuds(nRandomFireAward);
};
if (gFire09.HasFinished() AND nOptFire04 == 0)
{
nOptFire04 = 1;
Playergivestuds(nRandomFireAward);
};
if (nStage == 1 AND StopTimer > 9)
{
if (cDriver.InVehicle() != cFireTruck AND (cPlayer1.InVehicle() != cFireTruck) OR cPlayer2.InVehicle() != cFireTruck) )
{
cDriver.TakeOver(cFireTruck);
cDriver.SetScript(tScript);
};
nStage = 2;
gLocDriveTo = lDestination02;
cFireTruck.SetParked(false);
goto Drive();
};
if (nStage == 2 AND StopTimer > 5)
{
if (cDriver.InVehicle() != cFireTruck) AND (cPlayer1.InVehicle() != cFireTruck) OR cPlayer2.InVehicle() != cFireTruck) )
{
cDriver.TakeOver(cFireTruck);
cDriver.SetScript(tScript);
};
nStage = 3;
gLocDriveTo = lDestination01;
cFireTruck.SetParked(false);
goto Drive();
};
if (nStage == 3 AND cDriver.InVehicle() != cFireTruck AND (cPlayer1.InVehicle() != cFireTruck OR cPlayer2.InVehicle() !=cFireTruck ) )
{
cDriver.TakeOver(cFireTruck);
};
};
Actions
{
cFireTruck.SetParked(True);
// cDriver.Stop();
};
};
Function LevelEnter (WorldLevel level)
{
};
Function LevelExit (WorldLevel level)
{
};
PARAMEDIC_MISSION.SF
// PARAMEDIC PANIC!
// This script runs in the background and waits for the player to enter the special Ambulance.
// Once they're in it, it activates the first build-it, and sticks on the destination glow thing, sets the sat-nav up and gets boogeying.
// Once the player arrives in the destination area it turns off the indicator and satnav and just waits for the build-it to be finished (via an AI message).
// It will reenable the indicator and satnav for the current destination if the player strays out of a much larger area.
// If the player stops before the parking area, then we should also switch off the parking indicator if they approach the buildit, otherwise it looks odd.
// The mission will ONLY be abandoned if the player enters a non-ambulance. There's no time-out other than the one which the game itself handles. We'll need to get feedback from that, mind, so we can reset stuff.
HotSpot hMissionStart("");
Timer scripttimer(0);
Timer missionTimer(0);
Character cPlayer1("player1");
Character cPlayer2("player2");
Character cMissionPlayer;
Vehicle cAmbulance;
Character cPatient;
Locator lVehicleSpawn(""); // Mission vehicle spawn locator
Text tVehicleType("Ambulance"); // Mission vehicle type
// Decleration strings
Text tSatNavLocator("BM_Medic_SFR_01_Patient"); // Locator for satnav prefix
Text tHotSpot("BM_Medic_SFR_01_HS"); // Hotspot prefix
Text tGizmoBuildit("iMinifig_BusinessMan"); // Buildit name prefix
Text tScript("KillOffScreen"); // Script assigned to pedestrian
Text tType("NPC_BusinessMan"); // Type of character spawned
// Debug message strings
Text tReleaseScript("KillOffScreen");
Text tReturnState(""); // State the mission returns to
WorldLevel wlCity ("Lego_City");
WorldLevel wlMissionStart ("SF_Residential_0922");
WorldLevel wlPatient01 ("SF_Residential_0921");
WorldLevel wlPatient02 ("SF_Residential_0919");
WorldLevel wlPatient03 ("SF_Residential_1021");
WorldLevel wlPatient04 ("SF_Residential_0921");
WorldLevel wlPatient05 ("SF_Residential_0922");
WorldLevel wlCurrentTile("Lego_City");
Number nStage(1);
Number nMaxStage(2); // Number of patients to see
Number nMaxDistance(8); // Max distance allowed from patient is 8 units
Number nAbandonTime(20); // Abandon time of 15 seconds
Number nMaxTime(600); // Set time given for mission to be 10 minutes
Number nHeroMax(5000);
Number nBuilditAward(2500);
Number nAbortDistance(8); // Distance from vehicle the mission will be aborted.
Number nReturnToPatientDistance(4); // Distance from patient when prompt is given.
// Number nMaxTime(6); // Set time given for mission to be 10 minutes
Global Locator gLocKillMoveTo("");
// Objective OBJ_Abort("Abort_Check");
// Setup the hotspot based on the nStage
Function ActivateHotspot( Number n )
{
HotSpot h(tHotSpot + n.ToText("int 2"));
h.SetActive(true);
h.ScriptResponse("ForceBreak");
};
// Function to force the Ambulance to break whenever they enter a hotspot
Function ForceBreak( )
{
cAmbulance.SetParked(true);
};
// Function to remove hotspot in case it wasn't triggered
Function RemoveHotspot( Number n )
{
HotSpot h(tHotSpot + n.ToText("int 2"));
h.SetActive(false);
};
// Function to govern tile loading
Function SetTile()
{
if (nStage == 1)
{
wlCurrentTile = wlPatient01;
}
elseif (nStage == 2)
{
wlCurrentTile = wlPatient02;
}
elseif (nStage == 3)
{
wlCurrentTile = wlPatient03;
}
elseif (nStage == 4)
{
wlCurrentTile = wlPatient04;
}
elseif (nStage == 5)
{
wlCurrentTile = wlPatient05;
};
};
/////////////////////////////////////////////////////////////////
// Level Load
/////////////////////////////////////////////////////////////////
Function LevelEnter (WorldLevel level)
{
if (!cPlayer1)
{
cPlayer1 = "player1";
};
if (!cPlayer2)
{
cPlayer1 = "player2";
};
};
/////////////////////////////////////////////////////////////////////////////////
//// SETUP STAGE
/////////////////////////////////////////////////////////////////////////////////
State Setup( )
{
Conditions
{
if ( wlCity.IsLoaded() )
{
goto EnableHotspot();
};
};
Actions
{
};
};
State EnableHotspot()
{
Conditions
{
};
Actions
{
hMissionStart = "BM_Medic_SFR_01_Start";
lVehicleSpawn = "BM_Medic_SFR_01_SpawnAmbulance"; // Mission vehicle spawn locator
// [NOTE: stuff done here must be un-done in Cleanup()]
hMissionStart.SetHaloVisible(false);
hMissionStart.SetIcon("Bonus");
hMissionStart.SetActive(true);
hMissionStart.NoCondition();
goto WaitForReturnToTile();
};
};
// Wait for the player to be in the tile
State WaitForReturnToTile()
{
Conditions
{
if( wlMissionStart.IsLoaded() )
{
if ( cAmbulance )
{
if ( cPlayer1.GetVehicle() != cAmbulance )
{
cAmbulance.Destroy();
cAmbulance = "";
};
};
goto WaitForPlayerInVehicle();
};
};
Actions
{
// OBJ_Abort.Release();
};
};
// Activate, then await the player to enter the taxi.
State WaitForPlayerInVehicle()
{
Text tPrompt("MISSION_PARAMEDIC_CHARACTER_PROMPT");
Bool bPrompt(false); // Number used for latching character prompt
Bool bPromptSecondPlayer(false);
Bool bNoTargetSet(false);
Gizmo gCharacterPickup("c_ParamedicCharkit");
Number nDistance(1.5);
Conditions
{
// Check to see if the player enters the mission's vehicle
if ( wlCity.IsLoaded() )
{
if ( cAmbulance )
{
if( cPlayer1.GetVehicle( ) == cAmbulance )
{
if (MissionFocus(cPlayer1))
{
cMissionPlayer = cPlayer1;
goto GiveMissionPrompts();
};
};
if( cPlayer2.GetVehicle( ) == cAmbulance )
{
if (MissionFocus(cPlayer2))
{
cMissionPlayer = cPlayer2;
goto GiveMissionPrompts();
};
};
};
if( !wlMissionStart.IsLoaded() ) { goto WaitForReturnToTile(); };
if ( gCharacterPickup.GetOutput(0) AND !Mission_IsFlagSet(#characterUnlocked) )
{
Mission_SetFlag( #characterUnlocked, true );
if ( cAmbulance )
{
if (cPlayer1.DistanceToXZ(cAmbulance) < nDistance)
{
UI_RemoveMissionHelpText(cPlayer1);
};
if (cPlayer2.DistanceToXZ(cAmbulance) < nDistance)
{
UI_RemoveMissionHelpText(cPlayer2);
};
};
cAmbulance.SetLocked(false); // RE-ENABLE ONCE SETTAGGABLE WORKS
bNoTargetSet = false;
};
if ( cAmbulance AND !Mission_IsFlagSet(#characterUnlocked) ) // checks to see if the taxi exists and the mission value has yet to be flagged as true.
{
if ( cPlayer1.DistanceToXZ(cAmbulance) < nDistance AND !bPrompt )
{
UI_SetMissionHelpText(tPrompt, 6, cPlayer1 );
bPrompt = true;
}
elseif ( cPlayer1.DistanceToXZ(cAmbulance) > nDistance AND bPrompt )
{
UI_RemoveMissionHelpText(cPlayer1);
bPrompt = false;
};
if ( cPlayer2.DistanceToXZ(cAmbulance) < nDistance AND !bPromptSecondPlayer )
{
bPromptSecondPlayer = true;
UI_SetMissionHelpText(tPrompt, 6, cPlayer2 );
}
elseif ( cPlayer2.DistanceToXZ(cAmbulance) > nDistance AND bPromptSecondPlayer )
{
bPromptSecondPlayer = false;
UI_RemoveMissionHelpText(cPlayer2);
};
};
};
};
Actions
{
// OBJ_Abort.Prepare();
UI_LoadMissionPrompt("Hud_Mission_Bonus_Ambulance");
if ( !cAmbulance )
{
Number nDirection(0);
nDirection = lVehicleSpawn.GetDirection();
cAmbulance = CreateAIVehicle( tVehicleType, "Emergency", lVehicleSpawn, nDirection );
wait(0);
cAmbulance.SetParked(true);
Wait();
if ( !Mission_IsFlagSet(#characterUnlocked) )
{
cAmbulance.SetLocked(true); // RE-ENABLE ONCE SETTAGGABLE WORKS
};
};
};
};
// Checks to see if the player starts the mission or not - handles accepting the mission
State GiveMissionPrompts()
{
Conditions
{
// Gets out of the vehicle before pressing LB to initiate mission...
if( cMissionPlayer.GetVehicle( ) != cAmbulance )
{
cAmbulance.SetParked(false);
UI_HideMissionPrompt();
MissionUnfocus();
StreamedCharacterRelease("Mission_Paramedic");
goto WaitForPlayerInVehicle();
};
if( PlayerPressedButton(cMissionPlayer, "A") )
{
if ( cPlayer1 == cMissionPlayer )
{
PlayerSetCharacter( 1, "Mission_Paramedic");
}
else
{
PlayerSetCharacter( 2, "Mission_Paramedic");
};
MissionActivate(); // START THE MISSION!
};
};
Actions
{
UI_ShowMissionPrompt("Hud_Mission_Bonus_Ambulance", "MISSION_INSTRUCTIONS_PARAMEDIC", "MISSION_PROMPT", "MISSION_TITLE_PARAMEDIC");
nStage = 1;
StreamedCharacterPreLoad("Mission_Paramedic");
};
};
/////////////////////////////////////////////////////////////////////////////////
////// CLEANUP
/////////////////////////////////////////////////////////////////////////////////
state Cleanup()
{
Actions
{
if ( cAmbulance )
{
cAmbulance.Destroy();
cAmbulance = "";
};
if ( wlCity.IsLoaded() )
{
Number n(1);
Gizmo gBuildit(tGizmoBuildit + n.ToText("int 2") );
// cleanup stuff...
while ( nMaxStage >= n )
{
gBuildit = (tGizmoBuildit + n.ToText("int 2"));
gBuildit.SetVisible(false);
gBuildit.SetActive(false);
n = n + 1;
};
};
if ( hMissionStart )
{
hMissionStart.SetActive(false);
};
// All tidy, let the game know...
MissionCleanupEnd();
};
};
/////////////////////////////////////////////////////////////////////////////////
//// Mission Loop
/////////////////////////////////////////////////////////////////////////////////
state Begin()
{
Actions
{
// Remove the icon above the vehicle
hMissionStart.Trigger();
// Start the timer and setup the other hud elements
UI_StartMission();
missionTimer = 0;
UI_SetHUDTimer( nMaxTime, 1, missionTimer );
UI_ShowHUDTimer(true);
UI_SetHeroBarMax(nHeroMax);
// Stream in patients for spawning immediately
StreamedCharacterPreLoad( tType );
// Set tile for the first stage
SetTile();
// OBJ_Abort.ScriptGoto("Begin");
goto SetStage();
};
};
State SetStage( )
{
Locator lSatNav(tSatNavLocator + nStage.ToText("int 2"));
Gizmo gBuildit(tGizmoBuildit + nStage.ToText("int 2") );
Conditions
{
if ( cMissionPlayer.GetVehicle( ) != cAmbulance )
{
UI_RemoveMissionHelpText();
UI_RadioCall(false);
goto ReturnToVehicle();
};
};
Actions
{
tReturnState = "SetStage";
// Ensure the player can drive to the next stage
cAmbulance.SetParked(false);
gBuildit.SetVisible(true);
gBuildit.SetActive(true);
ActivateHotspot( nStage );
SetSatNavDestination( lSatNav );
Text t("MISSION_PARAMEDIC_PATIENT_");
t = t + nStage.ToText("int 2");
UI_RadioCall( true );
Wait(0.25);
UI_SetMissionHelpText( t, 5 );
tReturnState = "SpawnBuildit";
Wait( 5.5 );
UI_RadioCall( false );
goto SpawnBuildit();
};
};
State SpawnBuildit( )
{
Gizmo gBuildit(tGizmoBuildit + nStage.ToText("int 2") );
Bool bSpawnBuildit(true);
Bool bPark(true);
Bool bReachedPatient(false);
Conditions
{
if ( cMissionPlayer.GetVehicle( ) != cAmbulance AND !bReachedPatient )
{
if ( cMissionPlayer.DistanceToXZ( gBuildit ) > nReturnToPatientDistance )
{
goto ReturnToVehicle();
}
else { bReachedPatient = true; };
};
if ( bReachedPatient )
{
if ( cMissionPlayer.DistanceToXZ( gBuildit ) > nReturnToPatientDistance ) { goto ReturnToPatient(); }
};
// Check to see if the pedestrian buildit has been completed and then go to the next stage to swap him out for an actual AI pedestrian
if ( gBuildit.HasFinished() )
{
gBuildit.SetVisible(false);
gBuildit.SetActive(false);
goto SpawnPedestrian();
};
// If the player runs out of time, go to the out of time stage
if ( missionTimer > nMaxTime ) { goto OutOfTime(); };
// Check to see if the buildit needs spawning
if ( bSpawnBuildit )
{
// If it does need spawning, check to see if the tile is loaded
if ( wlCurrentTile.IsLoaded() )
{
bSpawnBuildit = false;
gBuildit.SetActive(false);
gBuildit.SetActive(true);
};
}
else
{
// if it doesn't need spawning, check that the tile isn't loaded, and then if it isn't, make sure we know it needs building again.
if ( !wlCurrentTile.IsLoaded() ) { bSpawnBuildit = true; };
};
};
};
// Spawn the pedestrian character
State SpawnPedestrian( )
{
Gizmo gBuildit(tGizmoBuildit + nStage.ToText("int 2") );
Number n(1);
Actions
{
//gLocKillMoveTo = "TaxiMissionCustomerEnd01_TEST";
n = gBuildit.GetDirection();
cPatient = CreateAICharacter(tType, "Pedestrian", gBuildit, n);
cPatient.Release();
Playergivestuds(nBuilditAward);
Text t("MISSION_GRATITUDE_");
n = RandomInt(1, 4);
t = t + n.ToText("int 2");
UI_SetMissionHelpText( t, 4 );
// calls the remove hotspot function - do so before nStage is incremented to ensure the stage which has just been completed is removed and not the next one!
RemoveHotspot( nStage );
nStage = nStage + 1;
tReturnState = "SetStage";
// Check to see if you've completed the mission, otherwise carry on to the next state in the loop.
if ( nStage > nMaxStage )
{
goto MissionEnd();
}
else
{
goto ReturnToVehicle();
};
};
};
////////////////////////////////////////////////////////////////
// Abandon Mission
////////////////////////////////////////////////////////////////
State ReturnToPatient( )
{
Number nPatientAbort(8);
Gizmo gBuildit(tGizmoBuildit + nStage.ToText("int 2") );
Text tAwayFromPatientPrompt("MISSION_PARAMEDIC_RETURN_TO_PAT");
Text tAbandonedPatientPrompt("MISSION_PARAMEDIC_ABANDONED_PATIENT");
Conditions
{
if ( cMissionPlayer.GetVehicle() == cAmbulance OR cMissionPlayer.DistanceToXZ( gBuildit ) < nReturnToPatientDistance )
{
UI_RemoveMissionMessage();
goto SpawnBuildit();
};
if ( cMissionPlayer.DistanceToXZ( cAmbulance ) > nAbortDistance AND cMissionPlayer.DistanceToXZ( gBuildit ) > nPatientAbort )
{
UI_SetMissionMessage( tAbandonedPatientPrompt, 5 );
MissionAbort();
};
};
Actions
{
UI_SetMissionMessage( tAwayFromPatientPrompt );
};
};
State ReturnToVehicle( )
{
Text tOutOfVehiclePrompt("MISSION_PARAMEDIC_RETURN_TO_AMB");
Text tAbandonedVehiclePrompt("MISSION_PARAMEDIC_ABANDONED");
Conditions
{
if ( cMissionPlayer.GetVehicle() == cAmbulance )
{
UI_RemoveMissionMessage();
if ( tReturnState == "SetStage" )
{
goto SetStage();
}
else {goto SpawnBuildit(); };
};
if ( cMissionPlayer.DistanceToXZ( cAmbulance ) > nAbortDistance )
{
UI_SetMissionMessage( tAbandonedVehiclePrompt, 5 );
MissionAbort();
};
};
Actions
{
UI_SetMissionMessage( tOutOfVehiclePrompt );
};
};
// Mission ended due to player running out of time - Give out of time message and reset mission
State OutOfTime( )
{
Conditions
{
};
Actions
{
UI_EndMission("MISSION_FAIL_TIMEOUT", false);
goto HandleFailScreen();
};
};
State HandleFailScreen( )
{
Timer time(0);
Bool b(false);
Conditions
{
if ( time > 0.1 AND ( PlayerPressedButton(cMissionPlayer, "A") OR PlayerPressedButton("Y") ) AND !b )
{
UI_ResetMission();
goto Reset();
}
else
{
if ( (b AND !cMissionPlayer.GetVehicle()) OR PlayerPressedButton(cMissionPlayer, "A") OR PlayerPressedButton("Y") )
{
UI_ResetMission();
goto Reset();
};
};
};
Actions
{
if ( cMissionPlayer.GetVehicle() )
{
b = true;
};
};
};
// Player completed the mission
State MissionEnd( )
{
Conditions
{
// if ( UI_IsEndMissionComplete() )
//{
// goto Reset();
//};
};
Actions
{
cAmbulance.SetParked(true);
// UI_EndMission("MISSION_COMPLETE", true);
goto Reset();
};
};
// Reset all mission assets
State Reset( )
{
Number n(1);
Text t("");
Gizmo gBuildit(tGizmoBuildit + n.ToText("int 2") );
Conditions
{
};
Actions
{
// REPLACE WITH BELOW WHILE LOOP WHEN gizmo.Reset() WORKS
while ( nMaxStage >= n )
{
gBuildit = (tGizmoBuildit + n.ToText("int 2"));
gBuildit.SetVisible(false);
gBuildit.SetActive(false);
n = n + 1;
};
UI_SetStatsStuds();
UI_StopHUDTimer();
UI_ShowHUDTimer(false);
SetHotSpot();
StreamedCharacterReleaseAll();
cAmbulance.SetParked(false);
cAmbulance.SetScript( tScript );
cAmbulance = "";
if ( nStage > nMaxStage )
{
nStage = 1;
MissionComplete(); // NEEDS TO CHECK AGAINST MISSION COMPLETE STATUS AND FAIL / END MISSION IF MISSION FAILED / ABANDONED ONCE THAT STATE IS AVAILABLE
}
else
{
nStage = 1;
MissionAbort();
};
};
};
RACE_MISSION.SF
State Setup()
{
Conditions
{
};
Actions
{
// setup stuff...
// [NOTE: stuff done here must be un-done in Cleanup()]
};
};
State Cleanup()
{
Actions
{
// cleanup stuff...
// All tidy, let the game know...
MissionCleanupEnd();
};
};
State Begin()
{
Actions
{
};
};
Function LevelEnter (WorldLevel level)
{
};
Function LevelExit (WorldLevel level)
{
};
REPAIR_TRUCK_MISSION.SF
WorldLevel wlCity ("Lego_City");
WorldLevel wlMissionStart ("SF_Residential_1022");
HotSpot hMissionStart("");
Timer scripttimer(0);
Timer missionTimer(0);
Character cPlayer1("player1");
Character cPlayer2("player2");
Character cMissionPlayer("");
Vehicle cRepairTruck("");
Locator lVehicleSpawn(""); // Mission vehicle spawn locator
Text tVehicleType("HazardTruck"); // Mission vehicle type
// Decleration strings
Text tSatNavLocator("BM_Repair_SFR_01_SAT"); // Locator for satnav prefix
Text tHotSpot("BM_Repair_SFR_01_CP"); // Hotspot area prefix
Text tHotSpotLarge("BM_Repair_SFR_01_A"); // Hotspot large area prefix
Text tPlayerTeleport("BM_Repair_SFR_01_PP"); // Player teleport area prefix
Text tLampostFixed("RepairMissLampostFixed"); // Gizmo prefix for fixed lamposts
Text tLampostBroken("RepairMissLampostBroken"); // Gizmo prefix for broken lamposts
Gizmo gLampFixed("");
Gizmo gLampBroken("");
// Debug message strings
Text tReleaseScript("KillOffScreen");
Number nStage(1);
Number nMaxStage(2); // Number of repairs
Number nMaxDistance(15); // Max distance allowed from patient is 8 units
Number nAbandonTime(20); // Abandon time of 15 seconds
Number nMaxTime(600); // Set time given for mission to be 10 minutes
Number nHeroMax(4500);
Number nRepairStuds(1500);
Bool bArrived(false); // checks if player has arrived or not
/////////////////////////////////////////////////////////////////
// Level Load
/////////////////////////////////////////////////////////////////
Function LevelEnter (WorldLevel level)
{
if ( level == wlCity )
{
hMissionStart = "BM_Repair_SFR_01_Start";
lVehicleSpawn = "BM_Repair_SFR_01_RepairTruckSpawn";
};
cPlayer1 = "player1";
cPlayer2 = "player2";
};
/////////////////////////////////////////////////////////////////////////////////
//// SETUP STAGE
/////////////////////////////////////////////////////////////////////////////////
State Setup( )
{
Conditions
{
if ( wlCity.IsLoaded() )
{
goto EnableHotspot();
};
};
Actions
{
};
};
state EnableHotspot()
{
Conditions
{
};
Actions
{
hMissionStart = "BM_Repair_SFR_01_Start";
lVehicleSpawn = "BM_Repair_SFR_01_RepairTruckSpawn"; // Mission vehicle spawn locator
hMissionStart.SetHaloVisible(false);
hMissionStart.SetIcon("Bonus");
hMissionStart.SetActive(true);
hMissionStart.NoCondition();
goto WaitForReturnToTile();
};
};
// Wait for the player to be in the tile
State WaitForReturnToTile()
{
Conditions
{
if( wlMissionStart.IsLoaded() )
{
if ( cRepairTruck )
{
if ( cPlayer1.GetVehicle() != cRepairTruck )
{
cRepairTruck.Destroy();
};
cRepairTruck = "";
};
goto WaitForPlayerInVehicle();
};
};
Actions
{
};
};
// Activate, then await the player to enter the taxi.
State WaitForPlayerInVehicle()
{
Conditions
{
// Check to see if the player enters the mission's vehicle
if ( wlCity.IsLoaded() && cRepairTruck )
{
if ( cRepairTruck.GetDriver() )
{
cMissionPlayer = cRepairTruck.GetDriver();
if( MissionFocus( cMissionPlayer ) )
{
goto GiveMissionPrompts();
}
}
}
}
Actions
{
if ( !cRepairTruck )
{
Number nDirection(0);
nDirection = lVehicleSpawn.GetDirection();
cRepairTruck = CreateAIVehicle( tVehicleType, "Civic", lVehicleSpawn, nDirection );
cRepairTruck.SetInvulnerable(true);
wait(0);
cRepairTruck.SetParked(true);
};
};
};
// Checks to see if the player starts the mission or not - handles accepting the mission
State GiveMissionPrompts()
{
Number n(0);
Conditions
{
// Gets out of the vehicle before pressing LB to initiate mission...
if( cMissionPlayer.GetVehicle( ) != cRepairTruck )
{
cRepairTruck.SetParked(false);
UI_HideMissionPrompt();
MissionUnfocus();
goto WaitForPlayerInVehicle();
};
if( PlayerPressedButton(cMissionPlayer, "A") )
{
MissionActivate(); // START THE MISSION!
};
};
Actions
{
UI_ShowMissionPrompt("Hud_Mission_Bonus_Repair", "MISSION_INSTRUCTIONS_REPAIR", "MISSION_PROMPT", "MISSION_TITLE_REPAIR");
nStage = 1;
};
};
/////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////
state Cleanup()
{
Actions
{
// cleanup stuff...
if ( cRepairTruck )
{
cRepairTruck.Destroy();
cRepairTruck = "";
};
if ( hMissionStart )
{
hMissionStart.SetActive(false);
};
if ( MissionWasCompleted() )
{
SetSatNavDestination();
};
// All tidy, let the game know...
MissionCleanupEnd();
};
};
/////////////////////////////////////////////////////////////////////////////////
//// Mission Loop
/////////////////////////////////////////////////////////////////////////////////
state Begin()
{
Actions
{
UI_StartMission();
hMissionStart.Trigger();
cRepairTruck.SetParked(false);
cRepairTruck.SetLocked(false);
missionTimer = 0;
UI_SetHUDTimer( nMaxTime, 1 );
UI_ShowHUDTimer(true);
goto SpawnLampost();
};
};
State SpawnLampost( )
{
Text t("MISSION_REPAIR_STAGEINSTR");
Hotspot hSpot(tHotSpot + nStage.ToText("int 2") );
Area aHotSpotLarge(tHotSpotLarge + nStage.ToText("int 2"));
Locator lSatNav(tSatNavLocator + nStage.ToText("int 2"));
Conditions
{
if ( cRepairTruck.InArea( aHotSpotLarge ) )
{
hSpot.SetActive(false);
cRepairTruck.SetParked(true);
goto RepairTruckSetup();
};
if ( cMissionPlayer.GetVehicle( ) != cRepairTruck )
{
goto AbandonedCheck();
};
};
Actions
{
if ( nStage != 1 )
{
UI_SetMissionCounter( (nStage - 1), nMaxStage, false ) ;
UI_ShowMissionCounter( true );
Wait(1.5);
UI_ShowMissionCounter( false );
};
gLampFixed = tLampostFixed + nStage.ToText("int 2");
gLampBroken = tLampostBroken + nStage.ToText("int 2");
gLampFixed.SetVisible(false);
gLampFixed.SetActive(false);
gLampBroken.SetVisible(true);
gLampBroken.SetActive(true);
hSpot.SetActive(true);
hSpot.NoCondition();
hSpot.SetIcon("Bonus");
SetSatNavDestination( lSatNav );
UI_SetHeroBarMax(nHeroMax);
UI_RadioCall( true );
Wait(0.25);
UI_SetMissionHelpText( t, 5 );
Wait( 5.5 );
UI_RadioCall( false );
};
};
State RepairTruckSetup()
{
Area aHotSpotLarge(tHotSpotLarge + nStage.ToText("int 2"));
Locator lVehicle(tSatNavLocator + nStage.ToText("int 2"));
Locator lPlayer(tPlayerTeleport + nStage.ToText("int 2"));
Number n(0);
Conditions
{
if ( cMissionPlayer.GetVehicle( ) != cRepairTruck AND cMissionPlayer.DistanceToXZ( lVehicle ) > nMaxDistance )
{
goto AbandonedCheck();
};
if ( cMissionPlayer.GetVehicle() == cRepairTruck )
{
cRepairTruck.SetParked(true);
};
if ( gLampBroken.HasFinished() )
{
gLampBroken.SetVisible(false);
gLampBroken.SetActive(false);
gLampFixed.Reset();
gLampFixed.SetVisible(true);
nStage = nStage + 1;
bArrived = false;
Playergivestuds(nRepairStuds);
if ( nStage > nMaxStage )
{
goto MissionEnd();
}
else
{
goto ReturnToVehicle();
};
};
if ( missionTimer > nMaxTime ) { goto OutOfTime(); };
};
Actions
{
if ( !bArrived )
{
FadeScreen(true);
Wait(1);
cMissionPlayer.ClearVehicle();
n = lVehicle.GetDirection();
Wait(0.5);
cRepairTruck.Teleport(lVehicle, n);
n = lPlayer.GetDirection();
cMissionPlayer.Teleport(lPlayer, n);
if ( cMissionPlayer == cPlayer1 )
{
PlayerSetCharacter(1, "ConstructionWorker");
}
else
{
PlayerSetCharacter(2, "ConstructionWorker");
};
bArrived = true;
Wait(1);
FadeScreen(false);
};
};
};
// Prompt the player to return to their vehicle after they complete each fix
State ReturnToVehicle( )
{
Timer abandonTimer(0);
Conditions
{
if ( cMissionPlayer.GetVehicle( ) == cRepairTruck )
{
cRepairTruck.SetParked(false);
UI_RemoveMissionMessage();
goto SpawnLampost();
};
if ( abandonTimer > nAbandonTime )
{
UI_RemoveMissionMessage();
goto AbandonMission();
};
};
Actions
{
UI_SetMissionMessage("MISSION_REPAIR_RETURN_TO_VEHICLE");
};
};
////////////////////////////////////////
///////////////////////////////////////
// If the player remains out of the vehicle and moves far enough away from the spellit, or enters another vehicle, abandon the mission
State AbandonedCheck( )
{
Locator lVehicle(tSatNavLocator + nStage.ToText("int 2"));
Timer abandonTimer(0);
Conditions
{
if ( ( cMissionPlayer.GetVehicle() AND cMissionPlayer.GetVehicle( ) != cRepairTruck ) OR abandonTimer > nAbandonTime )
{
UI_RemoveMissionMessage();
goto AbandonMission();
};
if ( cMissionPlayer.DistanceToXZ( lVehicle ) <= nMaxDistance OR cMissionPlayer.GetVehicle( ) == cRepairTruck )
{
UI_RemoveMissionMessage();
goto SpawnLampost();
};
};
Actions
{
UI_SetMissionMessage("MISSION_GENERIC_RETURN_TO_MISSION");
};
};
// Tell the player they've abandoned the mission
State AbandonMission( )
{
Conditions
{
};
Actions
{
UI_EndMission("MISSION_GENERIC_ABANDONED", false);
goto HandleFailScreen();
};
};
// Mission ended due to player running out of time - Give out of time message and reset mission
State OutOfTime( )
{
Conditions
{
};
Actions
{
UI_EndMission("MISSION_FAIL_TIMEOUT", false);
goto HandleFailScreen();
};
};
State HandleFailScreen( )
{
Timer time(0);
Bool b(false);
Conditions
{
if ( time > 0.1 AND ( PlayerPressedButton(cMissionPlayer, "A") OR PlayerPressedButton("Y") ) AND !b )
{
UI_ResetMission();
goto Reset();
}
else
{
if ( (b AND !cMissionPlayer.GetVehicle()) OR PlayerPressedButton(cMissionPlayer, "A") OR PlayerPressedButton("Y") )
{
UI_ResetMission();
goto Reset();
};
};
};
Actions
{
if ( cMissionPlayer.GetVehicle() )
{
b = true;
};
};
};
// Player completed the mission
State MissionEnd( )
{
Conditions
{
//if ( UI_IsEndMissionComplete() )
//{
// goto Reset();
//};
};
Actions
{
// UI_EndMission("MISSION_COMPLETE", true);
goto Reset();
};
};
// Reset all mission assets
State Reset( )
{
Number n(1);
Text t("");
Conditions
{
};
Actions
{
// REPLACE WITH BELOW WHILE LOOP WHEN gizmo.Reset() WORKS
UI_SetStatsStuds();
while ( nMaxStage >= n )
{
gLampFixed = tLampostFixed + n.ToText("int 2");
gLampBroken = tLampostBroken + n.ToText("int 2");
gLampFixed.Reset();
gLampFixed.SetVisible(true);
gLampFixed.SetActive(true);
gLampBroken.SetVisible(false);
gLampBroken.SetActive(false);
n = n + 1;
};
SetHotSpot();
cRepairTruck.SetScript( tReleaseScript );
cRepairTruck = "";
if ( nStage > nMaxStage )
{
MissionComplete(); // NEEDS TO CHECK AGAINST MISSION COMPLETE STATUS AND FAIL / END MISSION IF MISSION FAILED / ABANDONED ONCE THAT STATE IS AVAILABLE
}
else
{
MissionAbort();
};
};
};
ROBBER_CHASE_MISSION.SF
WorldLevel wlCity("Lego_City");
WorldLevel wlTile("SF_Residential_1121");
HotSpot hMissionStart("");
Character cPlayer1("player1");
Character cRobber("");
Locator lRobberSpawn("");
Text tChatType("Robber");
/////////////////////////////////////////////////////////////////
// Level Load
/////////////////////////////////////////////////////////////////
Function LevelEnter (WorldLevel level)
{
if ( level == wlCity )
{
if (!cPlayer1)
{
cPlayer1 = "player1";
};
};
};
Function LevelExit (WorldLevel level)
{
};
/////////////////////////////////////////////////////////////////
// Setup
/////////////////////////////////////////////////////////////////
State Setup()
{
Conditions
{
if ( wlCity.IsLoaded() )
{
goto EnableHotspot();
};
};
Actions
{
};
};
State EnableHotspot()
{
Conditions
{
};
Actions
{
lRobberSpawn = "SF_RD_ATMSpawn";
hMissionStart = "HotSpot_SideMission_RobberChase";
MissionHotSpotEnable( hMissionStart );
hMissionStart.SetIcon("Bonus");
goto AwaitTileLoad();
};
};
State AwaitTileLoad( )
{
Conditions
{
if ( wlTile.IsLoaded() )
{
goto CreateRobber();
};
};
Actions
{
if ( cRobber )
{
cRobber.Kill();
cRobber = "";
};
};
};
State CreateRobber( )
{
Conditions
{
if ( !wlTile.IsLoaded() AND cRobber )
{
goto AwaitTileLoad();
};
};
Actions
{
if ( !cRobber )
{
Number n(0);
n = lRobberSpawn.GetDirection();
cRobber = CreateAICharacter( "Robber", "Criminal", lRobberSpawn, n);
};
};
};
/////////////////////////////////////////////////////////////////
// Cleanup
/////////////////////////////////////////////////////////////////
State Cleanup( )
{
Actions
{
// cleanup stuff...
if ( hMissionStart )
{
hMissionStart.SetActive( false );
};
if ( cRobber )
{
cRobber.Kill();
cRobber = "";
};
// All tidy, let the game know...
MissionCleanupEnd();
};
};
//////////////////////////////////////////////////////////////
// Mission
//////////////////////////////////////////////////////////////
State Begin( )
{
Actions
{
cRobber.SetScript("SideMission_Robber_atm_a");
goto AwaitOutcome();
};
};
State AwaitOutcome( )
{
Conditions
{
if ( cRobber )
{
if ( cRobber.InContext("handcuffed") )
{
goto RobberCaught();
}
elseif ( cPlayer1.DistanceToXZ( cRobber ) > 100 )
{
goto RobberEscaped();
};
}
else
{
goto RobberEscaped();
};
};
Actions
{
};
};
State RobberCaught( )
{
Conditions
{
};
Actions
{
Wait(1);
MissionComplete();
};
};
State RobberEscaped( )
{
Conditions
{
};
Actions
{
MissionAbort();
};
};
TAXI_MISSION.SF
// This script is the Taxi Mission Handler - when you jump into a Taxi (at the moment a
// specific one, later on it should be any of them) it will spawn the first customer. That
// customer will then further the mission by getting picked up and dropped off.
// If the player gets out of the taxi they have 5 seconds to get back in it before the
// script will abort, and any customer who is in the taxi will get out.
// We execute this ONCE only. Couples the Taxi up and then heads to WaitForTaxiMission
HotSpot hMissionStart("");
// Mission vehicle spawn locations
Locator lTaxiSpawn("");
// Characters used in the mission
Character cPlayer1("player1");
Character cPlayer2("player2");
Character cMissionPlayer("");
Vehicle cTaxi("");
Character cPassengerCurrent("");
Locator gLocMoveTo("");
// Vehicle setup strings
Text tVehicleType("Taxicab");
Text tCharType("");
// Declaration strings - used to declare area and locator vars in the mission loop as the mission stage progresses / iterates
Text tSpawnLocator("BM_Taxi_SFR_01_Customer");
//Text tPickupArea("TaxiMissionCustomerPickupArea"); // CANNOT SEE AREAS RELATING TO THESE IN THE LED. REMOVE IS UNNECESSARY
Text tPickupLocator("BM_Taxi_SFR_01_PU");
//Text tDropOffArea("TaxiMissionCustomerDropOffArea"); // CANNOT SEE AREAS RELATING TO THESE IN THE LED. REMOVE IS UNNECESSARY
Text tDropOffLocator("BM_Taxi_SFR_01_DO");
Text tPickupHotspot("HotSpot_SideMission_Taxi_Pickup_SFResidential_");
Text tDropOffHotspot("HotSpot_SideMission_Taxi_DropOff_SFResidential_");
// Response text based on player performance
Text tGood_01("MISSION_TAXI_CUSTOMER_RESPONSE_GOOD_01");
Text tNeutral_01("MISSION_TAXI_CUSTOMER_RESPONSE_FAIR_01");
Text tPoor_01("MISSION_TAXI_CUSTOMER_RESPONSE_POOR_01");
// Temporary text to differentiate between different taxi varients
Text tPrompt("MISSION_TAXI_PROMPT");
Number nStage(1);
Number nMaxStage(2); // Number of passengers / loops of pickups
Number nTimeLimit(600); // Seconds allowed for the mission to be completed within
// Definitions needed for new timer system and two tier stud awards
Number nStage01Timer(50);
Number nStage02Timer(70);
Number nStage03Timer(70);
Number nStage04Timer(70);
Number nStage05Timer(70);
Number nBonusThreshold(0);
Number nTimeMultiplier(500);
Number nTimeBonusMultiplier(1000);
Number nStudAward(0);
Number nHeroTarget(14000);
Number nPassengerSet(0);
Number nAbortDistance(1);
Timer scripttimer(0);
Timer missionTimer(0);
WorldLevel wlCity ("Lego_City");
WorldLevel wlMissionStart("SF_Residential_1122");
WorldLevel wlPassenger1("SF_Residential_0921");
WorldLevel wlPassenger2("SF_Residential_0919");
WorldLevel wlPassenger3("SF_Residential_0919");
WorldLevel wlPassenger4("SF_Residential_0919");
WorldLevel wlPassenger5("SF_Residential_0919");
WorldLevel wlCurrentPassenger("SF_Residential_0921");
/////////////////////////////////////////////////////////////////
// Level Load
/////////////////////////////////////////////////////////////////
Function LevelEnter (WorldLevel level)
{
if ( level == wlCity )
{
if (!cPlayer1)
{
cPlayer1 = "player1";
};
};
};
/////////////////////////////////////////////////////////////////////////////////
//// SETUP STAGE
/////////////////////////////////////////////////////////////////////////////////
State Setup()
{
Conditions
{
if ( wlCity.IsLoaded() )
{
goto EnableHotspot();
};
};
Actions
{
};
};
State EnableHotspot()
{
Conditions
{
};
Actions
{
hMissionStart = "BM_Taxi_SFR_01_TimeTrialStart";
lTaxiSpawn = "BM_Taxi_SFR_01_TimeTrialSpawn";
// setup stuff...
// [NOTE: stuff done here must be un-done in Cleanup()]
hMissionStart.SetHaloVisible(false);
hMissionStart.SetIcon("Bonus");
hMissionStart.SetActive(true);
hMissionStart.NoCondition();
goto WaitForReturnToTile();
};
};
// Wait for the player to be in the tile
State WaitForReturnToTile()
{
Conditions
{
if( wlMissionStart.IsLoaded() )
{
goto WaitForPlayerInTaxi();
};
};
Actions
{
if ( cTaxi )
{
if ( cPlayer1.GetVehicle() != cTaxi AND cPlayer2.GetVehicle() != cTaxi )
{
cTaxi.Deactivate();
cTaxi = "";
};
};
};
};
// Activate, then await the player to enter the taxi.
State WaitForPlayerInTaxi()
{
Number n(0);
Conditions
{
// Check to see if the player enters the mission's vehicle
if ( wlCity.IsLoaded() )
{
if ( cTaxi )
{
if( cPlayer1.GetVehicle( ) == cTaxi )
{
if (MissionFocus(cPlayer1))
{
UI_RemoveMissionHelpText();
cMissionPlayer = cPlayer1;
goto GiveMissionPrompts();
};
};
if( cPlayer2.GetVehicle( ) == cTaxi )
{
if (MissionFocus(cPlayer2))
{
UI_RemoveMissionHelpText();
cMissionPlayer = cPlayer2;
goto GiveMissionPrompts();
};
};
};
if( !wlMissionStart.IsLoaded() )
{
goto WaitForReturnToTile();
};
if ( cTaxi )
{
if (cPlayer1.DistanceToXZ(cTaxi) < 1 AND n == 0)
{
n = 1;
UI_SetMissionHelpText(tPrompt);
};
if (cPlayer1.DistanceToXZ(cTaxi) > 1 AND n == 1)
{
n = 0;
UI_RemoveMissionHelpText();
};
};
};
};
Actions
{
Number nDirection(0);
Number nDirectionSeat(0);
if ( !cTaxi )
{
nDirection = lTaxiSpawn.GetDirection();
cTaxi = CreateAIVehicle( tVehicleType, "Taxi", lTaxiSpawn, nDirection );
cTaxi.SetParked(true);
};
};
};
// Checks to see if the player starts the mission or not - handles accepting the mission
State GiveMissionPrompts()
{
// Number n(0);
Conditions
{
// Gets out of the vehicle before pressing LB to initiate mission...
if( cMissionPlayer.GetVehicle( ) != cTaxi )
{
cTaxi.SetParked(false);
UI_HideMissionPrompt();
MissionUnfocus();
goto WaitForPlayerInTaxi();
};
if( PlayerPressedButton(cMissionPlayer, "A") )
{
MissionActivate();
};
};
Actions
{
UI_ShowMissionPrompt("Hud_Mission_Bonus_Taxi", "MISSION_INSTRUCTIONS_TAXI", "MISSION_PROMPT", "MISSION_TITLE_TAXI");
};
};
/////////////////////////////////////////////////////////////////////////////////
///// Cleanup
/////////////////////////////////////////////////////////////////////////////////
State Cleanup()
{
Actions
{
// cleanup stuff...
if (wlCity.IsLoaded())
{
if ( cTaxi )
{
cTaxi.Deactivate();
cTaxi = "";
};
if ( cPassengerCurrent )
{
cPassengerCurrent.SetScript("KillOffScreen");
cPassengerCurrent = "";
};
if ( hMissionStart )
{
hMissionStart.SetActive(false);
};
};
// All tidy, let the game know...
MissionCleanupEnd();
};
};
/////////////////////////////////////////////////////////////////////////////////
//// Mission Loop
/////////////////////////////////////////////////////////////////////////////////
Function ParkTaxi()
{
cTaxi.SetParked(true);
};
Function ParkTaxiDropOff()
{
cTaxi.SetParked(true);
goto DropOffCustomer();
};
State Begin()
{
Actions
{
UI_StartMission();
hMissionStart.Trigger();
cTaxi.SetParked(false);
UI_SetHeroBarMax(nHeroTarget);
goto StageSetup();
};
};
// States below here comprise the mission loop
State StageSetup()
{
HotSpot hPickup( tPickupHotspot + nStage.ToText("int 2") );
Locator lPickUp( "" + tPickupLocator + nStage.ToText("int 2") );
Conditions
{
};
Actions
{
if (nStage == 1)
{
nTimeLimit = nStage01Timer;
wlCurrentPassenger = wlPassenger1;
}
elseif (nStage == 2)
{
nTimeLimit = nStage02Timer;
wlCurrentPassenger = wlPassenger2;
}
elseif (nStage == 3)
{
nTimeLimit = nStage03Timer;
wlCurrentPassenger = wlPassenger3;
}
elseif (nStage == 4)
{
nTimeLimit = nStage04Timer;
wlCurrentPassenger = wlPassenger4;
}
elseif (nStage == 5)
{
nTimeLimit = nStage05Timer;
wlCurrentPassenger = wlPassenger5;
};
hPickup.SetActive(true);
hPickup.ScriptResponse("ParkTaxi");
hPickup.SetIcon("Bonus");
SetSatNavDestination( lPickUp );
if ( nStage != 1 )
{
UI_SetMissionCounter( (nStage - 1), nMaxStage, false ) ;
UI_ShowMissionCounter( true );
Wait(1.5);
UI_ShowMissionCounter( false );
};
missionTimer = 0;
UI_StopHUDTimer();
UI_ShowHUDTimer(false);
UI_SetHUDTimer( nTimeLimit, 1, missionTimer );
UI_ShowHUDTimer(true);
Text t("MISSION_TAXI_DIRECTIONS_PICKUP_");
t = t + nStage.ToText("int 2");
UI_RadioCall( true, 6 );
Wait(0.25);
UI_SetMissionHelpText( t, 5 );
goto HeadToCustomer();
};
};
State HeadToCustomer( )
{
Conditions
{
if ( wlCurrentPassenger.IsLoaded() )
{
goto SpawnCustomer();
};
if ( cTaxi.DistanceToXZ( cMissionPlayer ) > nAbortDistance )
{
goto HandleFailScreen();
};
};
Actions
{
};
};
// Spawn the customer
State SpawnCustomer( )
{
Locator lSpawn( "" + tSpawnLocator + nStage.ToText("int 2") );
Number n(0);
Text tType01("BusinessManA");
Text tType02("ConstructionWorker");
Text tType03("MaleA");
Text tType04("Nurse");
Conditions
{
};
Actions
{
if (nPassengerSet == 0)
{
n = RandomInt( 1, 4 );
if ( n == 1 ) { tCharType = tType01; }
elseif ( n == 2 ) { tCharType = tType02; }
elseif ( n == 3 ) { tCharType = tType03; }
elseif ( n == 4 ) { tCharType = tType04; }
else { tCharType = tType01; };
Position pCabPos( cTaxi );
//gLocMoveTo = pCabPos;
tCharType = tType01; // REMOVE WHEN ISSUE OF CHARACTERS GETTING INTO VEHICLES IS SORTED
nPassengerSet = 1;
};
n = lSpawn.GetDirection();
cPassengerCurrent = CreateAICharacter( tCharType, "Pedestrian", lSpawn, n);
cPassengerCurrent.SetZoneAbility( #RAISE, #A, #B );
goto CustomerFollowTaxi();
};
};
State CustomerFollowTaxi( )
{
Locator lSpawn( "" + tSpawnLocator + nStage.ToText("int 2") );
Locator lMoveTo( "" );
Number n(1);
Number z(0);
Conditions
{
if ( cPassengerCurrent.GetVehicle() != cTaxi AND cMissionPlayer.DistanceToXZ( lSpawn ) > 10 AND n == 0 )
{
cPassengerCurrent.MoveTo( lSpawn, 1 );
n = 1;
};
if (n == 1 AND cPassengerCurrent.GetVehicle( ) != cTaxi AND cPassengerCurrent.DistanceToXZ( cMissionPlayer ) < 10)
{
// cPassengerCurrent.FollowCharacter( cTaxiSeat ); // THIS HAS YET TO BE IMPLEMENTED BY CODE -- chrysp: this should be : cPassengerCurrent.EnterVehicle( cTaxi, "seatXYZ");
n = 0;
};
if ( cPassengerCurrent.DistanceToXZ( cMissionPlayer ) < 3.5 )
{
z = cTaxi.GetSpeed();
if( z <= 1)
{
//cPassengerCurrent.TakeOver( cTaxiSeat ); chrysp: this should be : cPassengerCurrent.EnterVehicle( cTaxi, "seatXYZ");
goto HeadToDropOff();
};
};
if ( !wlCurrentPassenger.IsLoaded() )
{
cPassengerCurrent.Kill();
goto HeadToCustomer();
};
if ( cTaxi.DistanceToXZ( cMissionPlayer ) > nAbortDistance )
{
goto HandleFailScreen();
};
};
Actions
{
//cPassengerCurrent.FollowCharacter( cTaxiSeat ); // THIS HAS YET TO BE IMPLEMENTED BY CODE
};
};
State HeadToDropOff( )
{
Locator lDropOff( "" + tDropOffLocator + nStage.ToText("int 2") );
HotSpot hDropOff( tDropOffHotspot + nStage.ToText("int 2") );
HotSpot hPickup( tPickupHotspot + nStage.ToText("int 2") );
Conditions
{
` if ( cTaxi.DistanceToXZ( cMissionPlayer ) > nAbortDistance )
{
goto HandleFailScreen();
};
};
Actions
{
hPickup.SetActive(false);
cTaxi.SetParked(false);
Text t("MISSION_TAXI_DIRECTIONS_DROPOFF_");
t = t + nStage.ToText("int 2");
UI_SetMissionHelpText( t, 5 );
hDropOff.SetActive(true);
hDropOff.ScriptResponse("ParkTaxiDropOff");
hDropOff.SetIcon("Bonus");
SetSatNavDestination( lDropOff );
// REMOVE THIS ONCE WE CAN RELEASE CHARACTERS TO THE CITY AS AMBIENT CHARACTERS
};
};
State DropOffCustomer( )
{
Locator lDropOff( "" + tDropOffLocator + nStage.ToText("int 2") );
Number n(0);
HotSpot hDropOff( tDropOffHotspot + nStage.ToText("int 2") );
Conditions
{
n = cTaxi.GetSpeed();
If( n <= 1)
{
cPassengerCurrent.ExitVehicle(); //cPassengerCurrent.ReleaseTakeOver(0.5, 1); //chrysp: this should be cPassengerCurrent.ExitVehicle();
hDropOff.SetActive(false);
goto Reward();
};
if ( cPassengerCurrent.GetVehicle() == cTaxi AND cMissionPlayer.DistanceToXZ( lDropOff ) > 20 )
{
goto HeadToDropOff();
};
if ( cTaxi.DistanceToXZ( cMissionPlayer ) > nAbortDistance )
{
goto HandleFailScreen();
};
};
Actions
{
};
};
State Reward( )
{
Conditions
{
};
Actions
{
// Award the player based on the time taken
Number nTotal(0);
nPassengerSet = 0;
nBonusThreshold = nTimeLimit / 4;
nStudAward = nTimeLimit - missionTimer;
if (missionTimer < nTimeLimit)
{
if (nStudAward > nBonusThreshold)
{
nTotal = (nBonusThreshold * nTimeMultiplier);
ntotal = ntotal + ((nStudAward - nBonusThreshold) * nTimeBonusMultiplier);
Playergivestuds(nTotal);
}
else
{
nTotal = nStudAward * nTimeMultiplier;
Playergivestuds(nTotal);
};
};
goto PassengerResponse();
};
};
State PassengerResponse( )
{
Text t("");
Conditions
{
};
Actions
{
if ( MissionTimer >= nTimelimit )
{
t = tPoor_01;
}
else
{
if (nStudAward > nBonusThreshold)
{
t = tGood_01;
}
else
{
t = tNeutral_01;
};
};
// Give customer dialogue feedback (temporary version)
UI_SetMissionHelpText( t, 4 );
cTaxi.SetParked(false);
UI_StopHudTimer();
wait(1);
goto NextStage();
};
};
State NextStage( )
{
Conditions
{
};
Actions
{
// Set up ready for next stage or complete the mission
nStage = nStage + 1;
cPassengerCurrent.SetScript( "KillOffScreen" ); // REMOVE THIS ONCE WE CAN RELEASE CHARACTERS TO THE CITY AS AMBIENT CHARACTERS
if ( nStage > nMaxStage )
{
goto MissionEnd();
}
else
{
goto StageSetup();
};
};
};
State OutOfTime( )
{
Conditions
{
};
Actions
{
UI_EndMission("MISSION_FAIL_TIMEOUT", false);
goto HandleFailScreen();
};
};
State HandleFailScreen( )
{
Timer time(0);
Bool b(false);
Conditions
{
if ( time > 0.1 AND ( PlayerPressedButton(cMissionPlayer, "A") OR PlayerPressedButton("Y") ) AND !b )
{
UI_ResetMission();
goto Reset();
}
else
{
if ( (b AND !cMissionPlayer.GetVehicle()) OR PlayerPressedButton(cMissionPlayer, "A") OR PlayerPressedButton("Y") )
{
UI_ResetMission();
goto Reset();
};
};
};
Actions
{
if ( cMissionPlayer.GetVehicle() )
{
b = true;
};
};
};
State MissionEnd( )
{
Conditions
{
};
Actions
{
// UI_EndMission("MISSION_COMPLETE", true);
goto Reset();
};
};
State Reset( )
{
Conditions
{
};
Actions
{
UI_SetStatsStuds();
SetSatNavDestination();
SetHotSpot();
UI_StopHUDTimer();
UI_ShowHUDTimer(false);
cTaxi = "";
if ( nStage > nMaxStage )
{
MissionComplete(); // NEEDS TO CHECK AGAINST MISSION COMPLETE STATUS AND FAIL / END MISSION IF MISSION FAILED / ABANDONED ONCE THAT STATE IS AVAILABLE
}
else
{
MissionAbort();
};
};
};
TAXI_MISSION_STUDRING.SF
// This script is the Taxi Mission Handler - when you jump into a Taxi (at the moment a
// specific one, later on it should be any of them) it will spawn the first customer. That
// customer will then further the mission by getting picked up and dropped off.
// If the player gets out of the taxi they have 5 seconds to get back in it before the
// script will abort, and any customer who is in the taxi will get out.
// We execute this ONCE only. Couples the Taxi up and then heads to WaitForTaxiMission
HotSpot hMissionStart("");
// Mission vehicle spawn locations
Locator lTaxiSpawn("");
// Characters used in the mission
Character cPlayer1("player1");
Character cPlayer2("player2");
Character cMissionPlayer("");
Vehicle cTaxi("");
Character cPassengerCurrent("");
Global Locator gLocMoveTo("");
// Vehicle setup strings
Text tVehicleType("Taxicab");
Text tCharType("");
// Declaration strings - used to declare area and locator vars in the mission loop as the mission stage progresses / iterates
Text tSpawnLocator("BM_Taxi_SFR_01_Customer");
//Text tPickupArea("TaxiMissionCustomerPickupArea"); // CANNOT SEE AREAS RELATING TO THESE IN THE LED. REMOVE IS UNNECESSARY
Text tPickupLocator("BM_Taxi_SFR_01_PU");
//Text tDropOffArea("TaxiMissionCustomerDropOffArea"); // CANNOT SEE AREAS RELATING TO THESE IN THE LED. REMOVE IS UNNECESSARY
Text tDropOffLocator("BM_Taxi_SFR_01_DO");
Text tPickupHotspot("HotSpot_SideMission_Taxi_Pickup_SFResidentialRings_");
Text tDropOffHotspot("HotSpot_SideMission_Taxi_DropOff_SFResidentialRings_");
Text tRing("BM_Taxi_SFR_01_Ring");
Text tCurrentRing("");
// Response text based on player performance
Text tGood_01("MISSION_TAXI_CUSTOMER_RESPONSE_GOOD_01");
Text tNeutral_01("MISSION_TAXI_CUSTOMER_RESPONSE_FAIR_01");
Text tPoor_01("MISSION_TAXI_CUSTOMER_RESPONSE_POOR_01");
// Temporary text to differentiate between different taxi varients
Text tPrompt("MISSION_TAXI_STUDRING_PROMPT");
Number nStage(1);
Number nMaxStage(2); // Number of passengers / loops of pickups
Number nTimeLimit(600); // Seconds allowed for the mission to be completed within
// Definitions needed for new timer system and two tier stud awards
Number nStage01Timer(50);
Number nStage02Timer(70);
Number nStage03Timer(70);
Number nStage04Timer(70);
Number nStage05Timer(70);
Number nBonusThreshold(0);
Number nTimeMultiplier(500);
Number nTimeBonusMultiplier(1000);
Number nStudAward(0);
Number nHeroTarget(25000);
Number nPassengerSet(0);
Number nCust01PickupRings(6);
Number nCust01DropoffRings(12);
Number nCust02PickupRings(18);
Number nCust02DropoffRings(26);
Number nAbortDistance(5);
Timer scripttimer(0);
Timer missionTimer(0);
WorldLevel wlCity ("Lego_City");
WorldLevel wlMissionStart("SF_Residential_1122");
WorldLevel wlPassenger1("SF_Residential_0921");
WorldLevel wlPassenger2("SF_Residential_0919");
WorldLevel wlPassenger3("SF_Residential_0919");
WorldLevel wlPassenger4("SF_Residential_0919");
WorldLevel wlPassenger5("SF_Residential_0919");
WorldLevel wlCurrentPassenger("SF_Residential_0921");
/////////////////////////////////////////////////////////////////
// Level Load
/////////////////////////////////////////////////////////////////
Function LevelEnter (WorldLevel level)
{
if ( level == wlCity )
{
if (!cPlayer1)
{
cPlayer1 = "player1";
};
};
};
/////////////////////////////////////////////////////////////////////////////////
//// SETUP STAGE
/////////////////////////////////////////////////////////////////////////////////
State Setup()
{
Conditions
{
if ( wlCity.IsLoaded() )
{
goto EnableHotspot();
};
};
Actions
{
};
};
State EnableHotspot()
{
Conditions
{
};
Actions
{
hMissionStart = "BM_Taxi_SFR_01_StudRingStart";
lTaxiSpawn = "BM_Taxi_SFR_01_StudRingSpawn";
// setup stuff...
// [NOTE: stuff done here must be un-done in Cleanup()]
hMissionStart.SetHaloVisible(false);
hMissionStart.SetIcon("Bonus");
hMissionStart.SetActive(true);
hMissionStart.NoCondition();
goto WaitForReturnToTile();
};
};
// Wait for the player to be in the tile
State WaitForReturnToTile()
{
Conditions
{
if( wlMissionStart.IsLoaded() )
{
goto WaitForPlayerInTaxi();
};
};
Actions
{
if ( cTaxi )
{
if ( cPlayer1.GetVehicle() != cTaxi AND cPlayer2.GetVehicle() != cTaxi )
{
cTaxi.Deactivate();
cTaxi = "";
};
};
};
};
// Activate, then await the player to enter the taxi.
State WaitForPlayerInTaxi()
{
Number n(0);
Conditions
{
// Check to see if the player enters the mission's vehicle
if ( wlCity.IsLoaded() )
{
if ( cTaxi )
{
if( cPlayer1.GetVehicle() == cTaxi )
{
if (MissionFocus(cPlayer1))
{
UI_RemoveMissionHelpText();
cMissionPlayer = cPlayer1;
goto GiveMissionPrompts();
};
};
if( cPlayer2.GetVehicle() == cTaxi )
{
if (MissionFocus(cPlayer2))
{
UI_RemoveMissionHelpText();
cMissionPlayer = cPlayer2;
goto GiveMissionPrompts();
};
};
};
if( !wlMissionStart.IsLoaded() )
{
goto WaitForReturnToTile();
};
if ( cTaxi )
{
if (cPlayer1.DistanceToXZ(cTaxi) < 1 AND n == 0)
{
n = 1;
UI_SetMissionHelpText(tPrompt);
};
if (cPlayer1.DistanceToXZ(cTaxi) > 1 AND n == 1)
{
n = 0;
UI_RemoveMissionHelpText();
};
};
};
};
Actions
{
Number nDirection(0);
Number nDirectionSeat(0);
if ( !cTaxi )
{
nDirection = lTaxiSpawn.GetDirection();
cTaxi = CreateAIVehicle( tVehicleType, "Taxi", lTaxiSpawn, nDirection );
Wait(1);
cTaxi.SetParked(true);
};
};
};
// Checks to see if the player starts the mission or not - handles accepting the mission
State GiveMissionPrompts()
{
// Number n(0);
Conditions
{
// Gets out of the vehicle before pressing LB to initiate mission...
if( cMissionPlayer.GetVehicle() != cTaxi )
{
cTaxi.SetParked(false);
UI_HideMissionPrompt();
MissionUnfocus();
goto WaitForPlayerInTaxi();
};
if( PlayerPressedButton(cMissionPlayer, "A") )
{
MissionActivate();
};
};
Actions
{
UI_ShowMissionPrompt("Hud_Mission_Bonus_Taxi", "MISSION_INSTRUCTIONS_TAXI", "MISSION_PROMPT", "MISSION_TITLE_TAXI");
};
};
/////////////////////////////////////////////////////////////////////////////////
///// Cleanup
/////////////////////////////////////////////////////////////////////////////////
State Cleanup()
{
Actions
{
// cleanup stuff...
if (wlCity.IsLoaded())
{
if ( cTaxi )
{
cTaxi.Deactivate();
cTaxi = "";
};
if ( cPassengerCurrent )
{
cPassengerCurrent.SetScript("KillOffScreen");
cPassengerCurrent = "";
};
if ( hMissionStart )
{
hMissionStart.SetActive(false);
};
// All tidy, let the game know...
};
MissionCleanupEnd();
};
};
/////////////////////////////////////////////////////////////////////////////////
//// Mission Loop
/////////////////////////////////////////////////////////////////////////////////
Function ParkTaxi()
{
cTaxi.SetParked(true);
};
Function ParkTaxiDropOff()
{
cTaxi.SetParked(true);
goto DropOffCustomer();
};
State Begin()
{
Number n(0);
Actions
{
UI_StartMission();
hMissionStart.Trigger();
cTaxi.SetParked(false);
UI_SetHeroBarMax(nHeroTarget);
goto StageSetup();
};
};
// States below here comprise the mission loop
State StageSetup()
{
HotSpot hPickup( tPickupHotspot + nStage.ToText("int 2") );
Locator lPickUp( "" + tPickupLocator + nStage.ToText("int 2") );
Number n(0);
Conditions
{
};
Actions
{
if (nStage == 1)
{
nTimeLimit = nStage01Timer;
wlCurrentPassenger = wlPassenger1;
While (n < nCust01PickupRings)
{
n = n + 1;
tCurrentRing = (tRing + n.ToText("Int 2") + "_Gold");
ChickenRingSetVisible(tCurrentRing, true);
};
}
elseif (nStage == 2)
{
nTimeLimit = nStage02Timer;
wlCurrentPassenger = wlPassenger2;
n = nCust01PickupRings;
While (n < nCust01DropoffRings)
{
n = n + 1;
tCurrentRing = (tRing + n.ToText("Int 2") + "_Gold");
ChickenRingSetVisible(tCurrentRing, false);
};
While (n < nCust02PickupRings)
{
n = n + 1;
tCurrentRing = (tRing + n.ToText("Int 2") + "_Gold");
ChickenRingSetVisible(tCurrentRing, true);
};
}
elseif (nStage == 3)
{
nTimeLimit = nStage03Timer;
wlCurrentPassenger = wlPassenger3;
}
elseif (nStage == 4)
{
nTimeLimit = nStage04Timer;
wlCurrentPassenger = wlPassenger4;
}
elseif (nStage == 5)
{
nTimeLimit = nStage05Timer;
wlCurrentPassenger = wlPassenger5;
};
hPickup.SetActive(true);
hPickup.ScriptResponse("ParkTaxi");
hPickup.SetIcon("Bonus");
SetSatNavDestination( lPickUp );
if ( nStage != 1 )
{
UI_SetMissionCounter( (nStage - 1), nMaxStage, false ) ;
UI_ShowMissionCounter( true );
Wait(1.5);
UI_ShowMissionCounter( false );
};
missionTimer = 0;
UI_StopHUDTimer();
UI_ShowHUDTimer(false);
UI_SetHUDTimer( nTimeLimit, 1, missionTimer );
UI_ShowHUDTimer(true);
Text t("MISSION_TAXI_DIRECTIONS_PICKUP_");
t = t + nStage.ToText("int 2");
UI_RadioCall( true, 6 );
Wait(0.25);
UI_SetMissionHelpText( t, 5 );
goto HeadToCustomer();
};
};
State HeadToCustomer( )
{
Number n(0);
NUmber nTimeExceeded(0);
Conditions
{
if (nStage == 1 AND missionTimer > nStage01Timer AND nTimeExceeded == 0)
{
nTimeExceeded = 1;
n = 0;
While (n < nCust01PickupRings)
{
n = n + 1;
tCurrentRing = (tRing + n.ToText("Int 2") + "_Gold");
ChickenRingSetVisible(tCurrentRing, false);
};
};
if (nStage == 2 AND missionTimer > nStage02Timer AND nTimeExceeded == 0)
{
nTimeExceeded = 1;
n = nCust01DropoffRings;
While (n < nCust02PickupRings)
{
n = n + 1;
tCurrentRing = (tRing + n.ToText("Int 2") + "_Gold");
ChickenRingSetVisible(tCurrentRing, false);
};
};
if ( wlCurrentPassenger.IsLoaded() )
{
goto SpawnCustomer();
};
};
Actions
{
};
};
// Spawn the customer
State SpawnCustomer( )
{
Locator lSpawn( "" + tSpawnLocator + nStage.ToText("int 2") );
Number n(0);
Text tType01("BusinessMan");
Text tType02("ConstructionWorker");
Text tType03("Male01");
Text tType04("collect_nurse");
Number z(0);
Number nTimeExceeded(0);
Conditions
{
if (nStage == 1 AND missionTimer > nStage01Timer AND nTimeExceeded == 0)
{
nTimeExceeded = 1;
z = 0;
While (z < nCust01PickupRings)
{
z = z + 1;
tCurrentRing = (tRing + z.ToText("Int 2") + "_Gold");
ChickenRingSetVisible(tCurrentRing, false);
};
};
if (nStage == 2 AND missionTimer > nStage02Timer AND nTimeExceeded == 0)
{
nTimeExceeded = 1;
z = nCust01DropoffRings;
While (z < nCust02PickupRings)
{
z = z + 1;
tCurrentRing = (tRing + z.ToText("Int 2") + "_Gold");
ChickenRingSetVisible(tCurrentRing, false);
};
};
};
Actions
{
if (nPassengerSet == 0)
{
n = RandomInt( 1, 4 );
if ( n == 1 ) { tCharType = tType01; }
elseif ( n == 2 ) { tCharType = tType02; }
elseif ( n == 3 ) { tCharType = tType03; }
elseif ( n == 4 ) { tCharType = tType04; }
else { tCharType = tType01; };
Position pCabPos( cTaxi );
//gLocMoveTo = pCabPos;
tCharType = tType01; // REMOVE WHEN ISSUE OF CHARACTERS GETTING INTO VEHICLES IS SORTED
nPassengerSet = 1;
};
n = lSpawn.GetDirection();
cPassengerCurrent = CreateAICharacter( tCharType, "Pedestrian", lSpawn, n);
goto CustomerFollowTaxi();
};
};
State CustomerFollowTaxi( )
{
Locator lSpawn( "" + tSpawnLocator + nStage.ToText("int 2") );
Locator lMoveTo( "" );
Number n(1);
Number z(0);
Number y(0);
Number nTimeExceeded(0);
Conditions
{
if (nStage == 1 AND missionTimer > nStage01Timer AND nTimeExceeded == 0)
{
nTimeExceeded = 1;
y = 0;
While (y < nCust01PickupRings)
{
y = y + 1;
tCurrentRing = (tRing + y.ToText("Int 2") + "_Gold");
ChickenRingSetVisible(tCurrentRing, false);
};
};
if (nStage == 2 AND missionTimer > nStage02Timer AND nTimeExceeded == 0)
{
nTimeExceeded = 1;
y = nCust01DropoffRings;
While (y < nCust02PickupRings)
{
y = y + 1;
tCurrentRing = (tRing + y.ToText("Int 2") + "_Gold");
ChickenRingSetVisible(tCurrentRing, false);
};
};
if ( cPassengerCurrent.GetVehicle( ) != cTaxi AND cMissionPlayer.DistanceToXZ( lSpawn ) > 10 AND n == 0 )
{
cPassengerCurrent.MoveTo( lSpawn, 1.0 );
n = 1;
};
if (n == 1 AND cPassengerCurrent.GetVehicle() != cTaxi AND cPassengerCurrent.DistanceToXZ( cMissionPlayer ) < 10)
{
// cPassengerCurrent.FollowCharacter( cTaxiSeat ); // THIS HAS YET TO BE IMPLEMENTED BY CODE -- chrysp: this should be : cPassengerCurrent.EnterVehicle( cTaxi, "seatXYZ");
n = 0;
};
if ( cPassengerCurrent.DistanceToXZ( cMissionPlayer ) < 3.5 )
{
z = cTaxi.GetSpeed();
if( z <= 1)
{
//cPassengerCurrent.TakeOver( cTaxiSeat );
//cPassengerCurrent.EnterVehicle(cTaxi, "seatXYZ");
goto HeadToDropOff();
};
};
if ( !wlCurrentPassenger.IsLoaded() )
{
cPassengerCurrent.Kill();
goto HeadToCustomer();
};
};
Actions
{
//cPassengerCurrent.FollowCharacter( cTaxiSeat ); // THIS HAS YET TO BE IMPLEMENTED BY CODE
};
};
State HeadToDropOff( )
{
Locator lDropOff( "" + tDropOffLocator + nStage.ToText("int 2") );
HotSpot hDropOff( tDropOffHotspot + nStage.ToText("int 2") );
HotSpot hPickup( tPickupHotspot + nStage.ToText("int 2") );
Number n(0);
Number nTimeExceeded(0);
Timer nSetupTimer(0);
Conditions
{
if (nStage == 1 AND missionTimer > nStage01Timer AND nTimeExceeded == 0 AND nSetupTimer > 1)
{
nTimeExceeded = 1;
n = nCust01PickupRings;
While (n < nCust01DropoffRings)
{
n = n + 1;
tCurrentRing = (tRing + n.ToText("Int 2") + "_Gold");
ChickenRingSetVisible(tCurrentRing, false);
};
};
if (nStage == 2 AND missionTimer > nStage02Timer AND nTimeExceeded == 0 AND nSetupTimer > 1)
{
nTimeExceeded = 1;
n = nCust02PickupRings;
While (n < nCust02DropoffRings)
{
n = n + 1;
tCurrentRing = (tRing + n.ToText("Int 2") + "_Gold");
ChickenRingSetVisible(tCurrentRing, false);
};
};
};
Actions
{
if (nStage == 1)
{
While (n < nCust01PickupRings)
{
n = n + 1;
tCurrentRing = (tRing + n.ToText("Int 2") + "_Gold");
ChickenRingSetVisible(tCurrentRing, false);
};
While (n < nCust01DropoffRings)
{
n = n + 1;
tCurrentRing = (tRing + n.ToText("Int 2") + "_Gold");
ChickenRingSetVisible(tCurrentRing, true);
};
};
if (nStage == 2)
{
n = nCust01DropoffRings;
While (n < nCust02PickupRings)
{
n = n + 1;
tCurrentRing = (tRing + n.ToText("Int 2") + "_Gold");
ChickenRingSetVisible(tCurrentRing, false);
};
While (n < nCust02DropoffRings)
{
n = n + 1;
tCurrentRing = (tRing + n.ToText("Int 2") + "_Gold");
ChickenRingSetVisible(tCurrentRing, true);
};
};
hPickup.SetActive(false);
cTaxi.SetParked(false);
Text t("MISSION_TAXI_DIRECTIONS_DROPOFF_");
t = t + nStage.ToText("int 2");
UI_SetMissionHelpText( t, 5 );
hDropOff.SetActive(true);
hDropOff.ScriptResponse("ParkTaxiDropOff");
hDropOff.SetIcon("Bonus");
SetSatNavDestination( lDropOff );
// REMOVE THIS ONCE WE CAN RELEASE CHARACTERS TO THE CITY AS AMBIENT CHARACTERS
};
};
State DropOffCustomer( )
{
Locator lDropOff( "" + tDropOffLocator + nStage.ToText("int 2") );
HotSpot hDropOff( tDropOffHotspot + nStage.ToText("int 2") );
Number n(0);
Conditions
{
n = cTaxi.GetSpeed();
If( n <= 1 )
{
hDropOff.SetActive(false);
//cPassengerCurrent.ReleaseTakeOver(0.5, 1);
//cPassengerCurrent.ExitVehicle(); //chrysp: fix this up
goto Reward();
};
if ( cPassengerCurrent.InVehicle( cTaxiSeat ) AND cMissionPlayer.DistanceToXZ( lDropOff ) > 20 )
{
goto HeadToDropOff();
};
};
Actions
{
};
};
State Reward( )
{
Conditions
{
};
Actions
{
// Award the player based on the time taken
nPassengerSet = 0;
nBonusThreshold = nTimeLimit / 4;
nStudAward = nTimeLimit - missionTimer;
goto PassengerResponse();
};
};
State PassengerResponse( )
{
Text t("");
Conditions
{
};
Actions
{
if ( MissionTimer >= nTimelimit )
{
t = tPoor_01;
}
else
{
if (nStudAward > nBonusThreshold)
{
t = tGood_01;
}
else
{
t = tNeutral_01;
};
};
// Give customer dialogue feedback (temporary version)
UI_SetMissionHelpText( t, 4 );
cTaxi.SetParked(false);
UI_StopHudTimer();
wait(1);
goto NextStage();
};
};
State NextStage( )
{
Conditions
{
};
Actions
{
// Set up ready for next stage or complete the mission
nStage = nStage + 1;
cPassengerCurrent.SetScript( "KillOffScreen" );; // REMOVE THIS ONCE WE CAN RELEASE CHARACTERS TO THE CITY AS AMBIENT CHARACTERS
if ( nStage > nMaxStage )
{
goto MissionEnd();
}
else
{
goto StageSetup();
};
};
};
State OutOfTime( )
{
Conditions
{
};
Actions
{
UI_EndMission("MISSION_FAIL_TIMEOUT", false);
goto HandleFailScreen();
};
};
State HandleFailScreen( )
{
Timer time(0);
Bool b(false);
Conditions
{
if ( time > 0.1 AND ( PlayerPressedButton(cMissionPlayer, "A") OR PlayerPressedButton("Y") ) AND !b )
{
UI_ResetMission();
goto Reset();
}
else
{
if ( (b AND !cMissionPlayer.GetVehicle()) OR PlayerPressedButton(cMissionPlayer, "A") OR PlayerPressedButton("Y") )
{
UI_ResetMission();
goto Reset();
};
};
};
Actions
{
if ( cMissionPlayer.GetVehicle() )
{
b = true;
};
};
};
State MissionEnd( )
{
Number n(0);
Conditions
{
};
Actions
{
n = nCust02PickupRings;
While (n < nCust02DropoffRings)
{
n = n + 1;
tCurrentRing = (tRing + n.ToText("Int 2") + "_Gold");
ChickenRingSetVisible(tCurrentRing, false);
};
// UI_EndMission("MISSION_COMPLETE", true);
goto Reset();
};
};
State Reset( )
{
Conditions
{
};
Actions
{
UI_SetStatsStuds();
SetSatNavDestination();
SetHotSpot();
UI_StopHUDTimer();
UI_ShowHUDTimer(false);
cTaxi = "";
if ( nStage > nMaxStage )
{
MissionComplete(); // NEEDS TO CHECK AGAINST MISSION COMPLETE STATUS AND FAIL / END MISSION IF MISSION FAILED / ABANDONED ONCE THAT STATE IS AVAILABLE
}
else
{
MissionAbort();
};
};
};
TAXI_MISSION_STUDTRAIL.SF
// This script is the Taxi Mission Handler - when you jump into a Taxi (at the moment a
// specific one, later on it should be any of them) it will spawn the first customer. That
// customer will then further the mission by getting picked up and dropped off.
// If the player gets out of the taxi they have 5 seconds to get back in it before the
// script will abort, and any customer who is in the taxi will get out.
// We execute this ONCE only. Couples the Taxi up and then heads to WaitForTaxiMission
HotSpot hMissionStart("");
// Mission vehicle spawn locations
Locator lTaxiSpawn("");
// Characters used in the mission
Character cPlayer1("player1");
Character cPlayer2("player2");
Character cMissionPlayer("");
Character cTaxi("");
Character cPassengerCurrent("");
Global Locator gLocMoveTo("");
// Vehicle setup strings
Text tVehicleType("Taxi");
Text tCharType("");
// Declaration strings - used to declare area and locator vars in the mission loop as the mission stage progresses / iterates
Text tSpawnLocator("BM_Taxi_SFR_01_Customer");
//Text tPickupArea("TaxiMissionCustomerPickupArea"); // CANNOT SEE AREAS RELATING TO THESE IN THE LED. REMOVE IS UNNECESSARY
Text tPickupLocator("BM_Taxi_SFR_01_PU");
//Text tDropOffArea("TaxiMissionCustomerDropOffArea"); // CANNOT SEE AREAS RELATING TO THESE IN THE LED. REMOVE IS UNNECESSARY
Text tDropOffLocator("BM_Taxi_SFR_01_DO");
Text tPickupHotspot("HotSpot_SideMission_Taxi_Pickup_SFResidentialStuds_");
Text tDropOffHotspot("HotSpot_SideMission_Taxi_DropOff_SFResidentialStuds_");
// Used to reference correct stud complex gizmos
Text tPickup("_pickup_");
Text tDropOff("_dropoff_");
// Response text based on player performance
Text tGood_01("MISSION_TAXI_CUSTOMER_RESPONSE_GOOD_01");
Text tNeutral_01("MISSION_TAXI_CUSTOMER_RESPONSE_FAIR_01");
Text tPoor_01("MISSION_TAXI_CUSTOMER_RESPONSE_POOR_01");
// Temporary text to differentiate between different taxi varients
Text tPrompt("MISSION_TAXI_CHARACTER_PROMPT");
Text tReturnState(""); // State the mission returns to
Global Number nTaxiStage(0);
Global Number nTaxiDropOff(0);
Number nMaxStage(2); // Number of passengers / loops of pickups
Number nTimeLimit(600); // Seconds allowed for the mission to be completed within
// Definitions needed for new timer system and two tier stud awards
Number nTaxiStage01Timer(50);
Number nTaxiStage02Timer(70);
Number nTaxiStage03Timer(70);
Number nTaxiStage04Timer(70);
Number nTaxiStage05Timer(70);
Number nBonusThreshold(0);
Number nTimeMultiplier(500);
Number nTimeBonusMultiplier(1000);
Number nStudAward(0);
Number nHeroTarget(10000);
Number nPassengerSet(0);
Number nAbortDistance(8); // Distance from vehicle the mission will be aborted.
// Timers
Timer scripttimer(0);
Global Timer globalTaxiStudMissionTimer(0);
WorldLevel wlCity ("Lego_City");
WorldLevel wlMissionStart("SF_Residential_1122");
WorldLevel wlPassenger1("SF_Residential_0921");
WorldLevel wlPassenger2("SF_Residential_0919");
WorldLevel wlPassenger3("SF_Residential_0919");
WorldLevel wlPassenger4("SF_Residential_0919");
WorldLevel wlPassenger5("SF_Residential_0919");
WorldLevel wlCurrentPassenger("SF_Residential_0921");
// Objective OBJ_Abort("Abort_Check");
/////////////////////////////////////////////////////////////////
// Functions
/////////////////////////////////////////////////////////////////
Function LevelEnter (WorldLevel level)
{
if ( level == wlCity )
{
if (!cPlayer1)
{
cPlayer1 = "player1";
};
};
};
Function CheckInVehicle( Text tStateName )
{
if ( cMissionPlayer.GetVehicle() != cTaxi )
{
tReturnState = tStateName;
goto WatchDistance();
};
};
/////////////////////////////////////////////////////////////////////////////////
//// SETUP STAGE
/////////////////////////////////////////////////////////////////////////////////
State Setup()
{
Conditions
{
if ( wlCity.IsLoaded() )
{
goto EnableHotspot();
};
};
Actions
{
};
};
State EnableHotspot()
{
Conditions
{
};
Actions
{
hMissionStart = "BM_Taxi_SFR_01_StudTrailStart";
lTaxiSpawn = "BM_Taxi_SFR_01_StudTrailSpawn";
// setup stuff...
// [NOTE: stuff done here must be un-done in Cleanup()]
hMissionStart.SetHaloVisible(false);
hMissionStart.SetIcon("Bonus");
hMissionStart.SetActive(true);
hMissionStart.NoCondition();
goto WaitForReturnToTile();
};
};
// Wait for the player to be in the tile
State WaitForReturnToTile()
{
Conditions
{
if( wlMissionStart.IsLoaded() )
{
goto WaitForPlayerInTaxi();
};
};
Actions
{
// OBJ_Abort.Release();
if ( cTaxi )
{
if ( cPlayer1.GetVehicle() != cTaxi AND cPlayer2.GetVehicle() != cTaxi )
{
cTaxi.Deactivate();
cTaxi = "";
};
};
};
};
// Activate, then await the player to enter the taxi.
State WaitForPlayerInTaxi()
{
Bool bPrompt(false); // Number used for latching character prompt
Bool bPromptSecondPlayer(false);
Bool bNoTargetSet(false);
Gizmo gCharacterPickup("c_TaxiDriverCharkit");
Number nDistance(1.5);
Conditions
{
// Check to see if the player enters the mission's vehicle
if ( wlCity.IsLoaded() )
{
if ( cTaxi )
{
if ( cPlayer1 )
{
if( cPlayer1.GetVehicle() == cTaxi )
{
if (MissionFocus(cPlayer1))
{
UI_RemoveMissionHelpText();
cMissionPlayer = cPlayer1;
goto GiveMissionPrompts();
};
};
}
else
{
cPlayer1 = "player1";
};
if ( cPlayer2 )
{
if( cPlayer2.GetVehicle() == cTaxi )
{
if (MissionFocus(cPlayer2))
{
UI_RemoveMissionHelpText();
cMissionPlayer = cPlayer2;
goto GiveMissionPrompts();
};
};
}
else
{
cPlayer2 = "player2";
};
};
if( !wlMissionStart.IsLoaded() )
{
goto WaitForReturnToTile();
};
if ( gCharacterPickup.GetOutput(0) AND !Mission_IsFlagSet(#characterUnlocked) )
{
Mission_SetFlag( #characterUnlocked, true );
if ( cTaxi )
{
if (cPlayer1.DistanceToXZ(cTaxi) < nDistance)
{
UI_RemoveMissionHelpText(cPlayer1);
};
if (cPlayer2.DistanceToXZ(cTaxi) < nDistance)
{
UI_RemoveMissionHelpText(cPlayer2);
};
};
//cTaxi.SetTaggable(true); // RE-ENABLE ONCE SETTAGGABLE WORKS //chrysp: use SetLocked(false) instead
bNoTargetSet = false;
};
if ( cTaxi AND !Mission_IsFlagSet(#characterUnlocked) ) // checks to see if the taxi exists and the mission value has yet to be flagged as true.
{
if ( cPlayer1.DistanceToXZ(cTaxi) < nDistance AND !bPrompt )
{
UI_SetMissionHelpText(tPrompt, 6, cPlayer1 );
bPrompt = true;
}
elseif ( cPlayer1.DistanceToXZ(cTaxi) > nDistance AND bPrompt )
{
UI_RemoveMissionHelpText(cPlayer1);
bPrompt = false;
};
if ( cPlayer2.DistanceToXZ(cTaxi) < nDistance AND !bPromptSecondPlayer )
{
bPromptSecondPlayer = true;
UI_SetMissionHelpText(tPrompt, 6, cPlayer2 );
}
elseif ( cPlayer2.DistanceToXZ(cTaxi) > nDistance AND bPromptSecondPlayer )
{
bPromptSecondPlayer = false;
UI_RemoveMissionHelpText(cPlayer2);
};
};
};
};
Actions
{
Number nDirection(0);
Number nDirectionSeat(0);
// OBJ_Abort.Prepare();
UI_LoadMissionPrompt("Hud_Mission_Bonus_Taxi");
if ( !cTaxi )
{
nDirection = lTaxiSpawn.GetDirection();
cTaxi = CreateAIVehicle( tVehicleType, "Taxi", lTaxiSpawn, nDirection );
Wait();
if ( !Mission_IsFlagSet(#characterUnlocked) )
{
//cTaxi.SetTaggable(false); // RE-ENABLE ONCE SETTAGGABLE WORKS //chrysp: use SetLocked(true) instead
};
cTaxi.SetParked(true);
};
};
};
// Checks to see if the player starts the mission or not - handles accepting the mission
State GiveMissionPrompts()
{
// Number n(0);
Conditions
{
// Gets out of the vehicle before pressing LB to initiate mission...
if( cMissionPlayer.GetVehicle() != cTaxi )
{
cTaxi.SetParked(false);
UI_HideMissionPrompt();
MissionUnfocus();
StreamedCharacterRelease("Mission_TaxiDriver");
goto WaitForPlayerInTaxi();
};
if( PlayerPressedButton(cMissionPlayer, "A") )
{
if ( cPlayer1 == cMissionPlayer )
{
PlayerSetCharacter( 1, "Mission_TaxiDriver");
}
else
{
PlayerSetCharacter( 2, "Mission_TaxiDriver");
};
MissionActivate();
};
};
Actions
{
UI_ShowMissionPrompt("Hud_Mission_Bonus_Taxi", "MISSION_INSTRUCTIONS_TAXI", "MISSION_PROMPT", "MISSION_TITLE_TAXI");
StreamedCharacterPreLoad("Mission_TaxiDriver");
};
};
/////////////////////////////////////////////////////////////////////////////////
///// Cleanup
/////////////////////////////////////////////////////////////////////////////////
State Cleanup()
{
Actions
{
if (wlCIty.IsLoaded())
{
// cleanup stuff...
if ( cTaxi )
{
cTaxi.Deactivate();
cTaxi = "";
};
if ( cPassengerCurrent )
{
cPassengerCurrent.SetScript("KillOffScreen");
cPassengerCurrent = "";
};
if ( hMissionStart )
{
hMissionStart.SetActive(false);
};
if ( wlCity.IsLoaded() )
{
nTaxiStage = 0;
nTaxiDropOff = 0;
};
};
if ( MissionWasAborted() )
{
SetSatNavDestination();
};
if ( MissionWasCompleted() )
{
SetSatNavDestination();
};
// All tidy, let the game know...
MissionCleanupEnd();
};
};
/////////////////////////////////////////////////////////////////////////////////
//// Mission Loop
/////////////////////////////////////////////////////////////////////////////////
Function ParkTaxi()
{
goto EnsureInsideTaxi();
//cTaxi.SetParked(true);
//goto HeadToDropOff();
};
Function ParkTaxiDropOff()
{
goto DropOffCustomer();
};
State Begin()
{
Actions
{
UI_StartMission();
hMissionStart.Trigger();
cTaxi.SetParked(false);
UI_SetHeroBarMax(nHeroTarget);
nTaxiStage = 1;
// OBJ_Abort.ScriptGoto("Begin");
goto StageSetup();
};
};
// States below here comprise the mission loop
State StageSetup()
{
HotSpot hPickup( tPickupHotspot + nTaxiStage.ToText("int 2") );
Locator lPickUp( "" + tPickupLocator + nTaxiStage.ToText("int 2") );
Conditions
{
};
Actions
{
// Timelimit, studs
if (nTaxiStage == 1)
{
nTimeLimit = nTaxiStage01Timer;
wlCurrentPassenger = wlPassenger1;
}
elseif (nTaxiStage == 2)
{
nTimeLimit = nTaxiStage02Timer;
wlCurrentPassenger = wlPassenger2;
}
elseif (nTaxiStage == 3)
{
nTimeLimit = nTaxiStage03Timer;
wlCurrentPassenger = wlPassenger3;
}
elseif (nTaxiStage == 4)
{
nTimeLimit = nTaxiStage04Timer;
wlCurrentPassenger = wlPassenger4;
}
elseif (nTaxiStage == 5)
{
nTimeLimit = nTaxiStage05Timer;
wlCurrentPassenger = wlPassenger5;
};
// UI Setup
hPickup.SetActive(true);
hPickup.ScriptResponse("ParkTaxi");
hPickup.SetIcon("Bonus");
SetSatNavDestination( lPickUp );
if ( nTaxiStage != 1 )
{
UI_SetMissionCounter( (nTaxiStage - 1), nMaxStage, false ) ;
UI_ShowMissionCounter( true );
Wait(1.5);
UI_ShowMissionCounter( false );
};
globalTaxiStudMissionTimer = 0;
UI_StopHUDTimer();
UI_ShowHUDTimer(false);
UI_SetHUDTimer( nTimeLimit, 1, globalTaxiStudMissionTimer );
UI_ShowHUDTimer(true);
Text t("MISSION_TAXI_DIRECTIONS_PICKUP_");
t = t + nTaxiStage.ToText("int 2");
UI_RadioCall( true, 6 );
Wait(0.25);
UI_SetMissionHelpText( t, 5 );
goto HeadToCustomer();
};
};
State HeadToCustomer( )
{
Conditions
{
if ( wlCurrentPassenger.IsLoaded() )
{
goto SpawnCustomer();
};
CheckInVehicle("HeadToCustomer");
};
Actions
{
};
};
// Spawn the customer
State SpawnCustomer( )
{
Locator lSpawn( "" + tSpawnLocator + nTaxiStage.ToText("int 2") );
Number n(0);
Text tType01("BusinessMan");
Text tType02("ConstructionWorker");
Text tType03("Male01");
Text tType04("collect_nurse");
Conditions
{
};
Actions
{
if (nPassengerSet == 0)
{
n = RandomInt( 1, 4 );
if ( n == 1 ) { tCharType = tType01; }
elseif ( n == 2 ) { tCharType = tType02; }
elseif ( n == 3 ) { tCharType = tType03; }
elseif ( n == 4 ) { tCharType = tType04; }
else { tCharType = tType01; };
Position pCabPos( cTaxi );
//gLocMoveTo = pCabPos;
tCharType = tType01; // REMOVE WHEN ISSUE OF CHARACTERS GETTING INTO VEHICLES IS SORTED
nPassengerSet = 1;
};
n = lSpawn.GetDirection();
cPassengerCurrent = CreateAICharacter( tCharType, "Pedestrian", lSpawn, n);
cPassengerCurrent.SetZoneAbility(#include, #A, #B );
goto CustomerFollowTaxi();
};
};
State CustomerFollowTaxi( )
{
Locator lSpawn( "" + tSpawnLocator + nTaxiStage.ToText("int 2") );
Locator lMoveTo( "" );
Number n(1);
Number z(0);
Conditions
{
if ( cPassengerCurrent.GetVehicle( ) != cTaxi AND cMissionPlayer.DistanceToXZ( lSpawn ) > 10 AND n == 0 )
{
cPassengerCurrent.MoveTo( lSpawn, 1 );
n = 1;
};
if (n == 1 AND cPassengerCurrent.GetVehicle() != cTaxi AND cPassengerCurrent.DistanceToXZ( cMissionPlayer ) < 10)
{
// cPassengerCurrent.FollowCharacter( cTaxiSeat ); // THIS HAS YET TO BE IMPLEMENTED BY CODE
n = 0;
};
if ( !wlCurrentPassenger.IsLoaded() )
{
cPassengerCurrent.Kill();
goto HeadToCustomer();
};
if ( cPassengerCurrent.DistanceToXZ( cMissionPlayer ) < 3.5 )
{
z = cTaxi.GetSpeed();
if( z <= 1)
{
goto EnsureInsideTaxi();
};
};
CheckInVehicle("CustomerFollowTaxi");
};
Actions
{
//cPassengerCurrent.FollowCharacter( cTaxiSeat ); // THIS HAS YET TO BE IMPLEMENTED BY CODE
};
};
State EnsureInsideTaxi( )
{
Timer timeLoop(0);
Conditions
{
if ( cPassengerCurrent.GetVehicle() == cTaxi )
{
goto HeadToDropOff();
};
if ( timeLoop > 5 )
{
goto EnsureInsideTaxi();
};
};
Actions
{
cTaxi.SetParked(true);
//cPassengerCurrent.TakeOver( cTaxiSeat );
//cPassengerCurrent.EnterVehicle(cTaxi, "seatXYZ"); //chrysp: fixup the seat here
};
};
State HeadToDropOff( )
{
Locator lDropOff( "" + tDropOffLocator + nTaxiStage.ToText("int 2") );
HotSpot hDropOff( tDropOffHotspot + nTaxiStage.ToText("int 2") );
HotSpot hPickup( tPickupHotspot + nTaxiStage.ToText("int 2") );
Actions
{
// Disable studs from previous route
nTaxiDropOff = nTaxiDropOff + 1;
cTaxi.SetParked(false);
Text t("MISSION_TAXI_DIRECTIONS_DROPOFF_");
t = t + nTaxiStage.ToText("int 2");
UI_SetMissionHelpText( t, 5 );
hPickup.SetActive(false);
hDropOff.SetActive(true);
hDropOff.ScriptResponse("ParkTaxiDropOff");
hDropOff.SetIcon("Bonus");
SetSatNavDestination( lDropOff );
goto AwaitDropOffArrival();
// REMOVE THIS ONCE WE CAN RELEASE CHARACTERS TO THE CITY AS AMBIENT CHARACTERS
};
};
State AwaitDropOffArrival( )
{
Conditions
{
CheckInVehicle("AwaitDropOffArrival");
};
};
State DropOffCustomer( )
{
Locator lDropOff( "" + tDropOffLocator + nTaxiStage.ToText("int 2") );
Number n(0);
HotSpot hDropOff( tDropOffHotspot + nTaxiStage.ToText("int 2") );
Conditions
{
n = cTaxi.GetSpeed();
if( n <= 1)
{
hDropOff.SetActive(false);
//cPassengerCurrent.ReleaseTakeOver(0.5, 1);
//cPassengerCurrent.ExitVehicle(); //chrysp: fixup the exit position
goto PassengerResponse();
};
if ( cPassengerCurrent.GetVehicle() == cTaxi AND cMissionPlayer.DistanceToXZ( lDropOff ) > 20 )
{
goto HeadToDropOff();
};
CheckInVehicle("DropOffCustomer");
};
Actions
{
};
};
State Reward( )
{
Conditions
{
};
Actions
{
// Award the player based on the time taken
Number nTotal(0);
nPassengerSet = 0;
nBonusThreshold = nTimeLimit / 4;
nStudAward = nTimeLimit - globalTaxiStudMissionTimer;
if (globalTaxiStudMissionTimer < nTimeLimit)
{
if (nStudAward > nBonusThreshold)
{
nTotal = (nBonusThreshold * nTimeMultiplier);
ntotal = ntotal + ((nStudAward - nBonusThreshold) * nTimeBonusMultiplier);
Playergivestuds(nTotal);
}
else
{
nTotal = nStudAward * nTimeMultiplier;
Playergivestuds(nTotal);
};
};
goto PassengerResponse();
};
};
State PassengerResponse( )
{
Text t("");
Conditions
{
};
Actions
{
if ( globalTaxiStudMissionTimer >= nTimelimit )
{
t = tPoor_01;
}
else
{
if (nStudAward > nBonusThreshold)
{
t = tGood_01;
}
else
{
t = tNeutral_01;
};
};
// Give customer dialogue feedback (temporary version)
UI_SetMissionHelpText( t, 4 );
cTaxi.SetParked(false);
UI_StopHudTimer();
wait(1);
goto NextStage();
};
};
State NextStage( )
{
Conditions
{
};
Actions
{
// Set up ready for next stage or complete the mission
cPassengerCurrent.SetScript( "KillOffScreen" ); // REMOVE THIS ONCE WE CAN RELEASE CHARACTERS TO THE CITY AS AMBIENT CHARACTERS
if ( nTaxiStage == nMaxStage )
{
goto MissionEnd();
}
else
{
nTaxiStage = nTaxiStage + 1;
goto StageSetup();
};
};
};
/////////////////////////////////////////////////////////////////////////////////
// Abandon Mission States
/////////////////////////////////////////////////////////////////////////////////
State WatchDistance( )
{
Text tOutOfVehiclePrompt("MISSION_TAXI_RETURN_TO_CAB");
Text tAbandonedVehiclePrompt("MISSION_TAXI_ABANDONED");
Conditions
{
if ( cMissionPlayer.GetVehicle() == cTaxi )
{
UI_RemoveMissionMessage();
if ( tReturnState == "HeadToCustomer" ) { goto HeadToCustomer(); }
elseif ( tReturnState == "CustomerFollowTaxi" ) { goto CustomerFollowTaxi(); }
elseif ( tReturnState == "AwaitDropOffArrival" ) { goto AwaitDropOffArrival(); }
elseif ( tReturnState == "DropOffCustomer" ) { goto DropOffCustomer(); };
};
if ( cMissionPlayer.DistanceToXZ( cTaxi ) > nAbortDistance )
{
UI_SetMissionMessage( tAbandonedVehiclePrompt, 5 );
MissionAbort();
};
};
Actions
{
UI_SetMissionMessage( tOutOfVehiclePrompt );
};
};
State HandleFailScreen( )
{
Timer time(0);
Bool b(false);
Conditions
{
if ( time > 0.1 AND ( PlayerPressedButton(cMissionPlayer, "A") OR PlayerPressedButton("Y") ) AND !b )
{
UI_ResetMission();
goto Reset();
}
else
{
if ( (b AND !cMissionPlayer.GetVehicle()) OR PlayerPressedButton(cMissionPlayer, "A") OR PlayerPressedButton("Y") )
{
UI_ResetMission();
goto Reset();
};
};
};
Actions
{
if ( cMissionPlayer.GetVehicle() )
{
b = true;
};
};
};
/////////////////////////////////////////////////////////////////////////////////
// Mission Ended
/////////////////////////////////////////////////////////////////////////////////
State MissionEnd( )
{
Conditions
{
};
Actions
{
goto Reset();
};
};
State Reset( )
{
Conditions
{
};
Actions
{
UI_SetStatsStuds();
SetSatNavDestination();
UI_StopHUDTimer();
UI_ShowHUDTimer(false);
cTaxi = "";
if ( nTaxiStage == nMaxStage )
{
MissionComplete(); // NEEDS TO CHECK AGAINST MISSION COMPLETE STATUS AND FAIL / END MISSION IF MISSION FAILED / ABANDONED ONCE THAT STATE IS AVAILABLE
}
else
{
MissionAbort();
};
};
};
TOW_TRUCK_MISSION.SF
// NOTE: this script currently only handles 2 stages, one where the player drives to a spellit and constructs it, the other where the player drives to a car and tows it.
// However, it is setup to be easily scaled to allow for multiple iterations of these stages. Simply increase the nMaxStage value and add to the checks in HeadToPickup()
// against nStage if you have additional Spellits - ensure you maintain the naming convention for all locators, areas and spellits.
HotSpot hMissionStart("");
Timer scripttimer(0);
Timer missionTimer(0);
Number nStage(1);
Number nMaxStage(2); // Number of passengers / loops of pickups
Number nMaxTime(600); // Seconds allowed for the mission to be completed within
Number nMaxDistance(8); // Max distance allowed from patient is 8 units
Number nAbandonTime(15); // Abandon time of 15 seconds
Number nPhaseType(0); // 0 is a repair phase and 1 is a tow phase
Number nHeroMax(5000);
Number nRepairStuds(2500);
Number nTowStuds(2500);
Character cPlayer1("player1");
Character cPlayer2("player2");
Character cMissionPlayer("");
Character cTruck("");
Character cPickup("");
Character cCustomer("");
Character cTempA("");
Character cTempB("");
Locator lTruckSpawn( "" );
Global Bool bBuilt(false);
WorldLevel wlCity ("Lego_City");
WorldLevel wlMissionStart("SF_Residential_0921"); // Tile the mission vehicle starts on
WorldLevel wlTowMission01("SF_Residential_0819"); // Stage 1's assets exist in this tile
WorldLevel wlTowMission02("SF_Residential_1020"); // Stage 2's assets exist in this tile
WorldLevel wlCurrentMission("SF_Residential_0819");
/////////////////////////////////////////////////////////////////
// Level Load
/////////////////////////////////////////////////////////////////
Bool bTemp(true); // Horrible nasty bool check for giving UI elements for the first time, so that the state can be entered and exited to respawn characters as they fall through the world
Function LevelEnter (WorldLevel level)
{
if (!cPlayer1)
{
cPlayer1 = "player1";
};
};
/////////////////////////////////////////////////////////////////////////////////
//// SETUP STAGE
/////////////////////////////////////////////////////////////////////////////////
State Setup()
{
Conditions
{
if ( wlCity.IsLoaded() )
{
goto EnableHotspot();
};
};
Actions
{
};
};
state EnableHotspot()
{
Conditions
{
};
Actions
{
hMissionStart = "BM_Tow_SFR_01_Start";
lTruckSpawn = "BM_Tow_SFR_01_SpawnTowTruck";
// setup stuff...
// [NOTE: stuff done here must be un-done in Cleanup()]
hMissionStart.SetActive(true);
hMissionStart.NoCondition();
hMissionStart.SetHaloVisible(false);
hMissionStart.SetIcon("Bonus");
goto WaitForReturnToTile();
};
};
// Wait for the player to be in the tile
State WaitForReturnToTile()
{
Conditions
{
if( wlMissionStart.IsLoaded() )
{
if ( cTruck )
{
if ( cPlayer1.InVehicle() != cTruck )
{
cTruck.Kill();
};
};
goto WaitForPlayerInTruck();
};
};
Actions
{
};
};
// Activate, then await the player to enter the truck.
State WaitForPlayerInTruck()
{
Conditions
{
// Check to see if the player enters the mission's vehicle
if ( wlCity.IsLoaded() )
{
if ( cTruck )
{
if ( cPlayer1 )
{
if( cPlayer1.InVehicle() == cTruck )
{
if (MissionFocus(cPlayer1))
{
cMissionPlayer = cPlayer1;
goto GiveMissionPrompts();
};
};
}
else
{
cPlayer1 = "player1";
};
if ( cPlayer2 )
{
if( cPlayer2.InVehicle() == cTruck )
{
if (MissionFocus(cPlayer2))
{
cMissionPlayer = cPlayer2;
goto GiveMissionPrompts();
};
};
}
else
{
cPlayer2 = "player2";
};
};
if( !wlMissionStart.IsLoaded() )
{
if ( cTruck )
{
cTruck.Kill();
cTruck = "";
};
goto WaitForReturnToTile();
};
};
};
Actions
{
UI_LoadMissionPrompt("Hud_Mission_Bonus_Tow");
if ( !cTruck )
{
Number nDirection(0);
nDirection = lTruckSpawn.GetDirection();
cTruck = CreateCharacter( "industrial_towtruck", lTruckSpawn, "default", nDirection );
wait(0);
cTruck.SetParked(true);
};
};
};
// Checks to see if the player starts the mission or not - handles accepting the mission
State GiveMissionPrompts()
{
Number n(0);
Conditions
{
// Gets out of the vehicle before pressing LB to initiate mission...
if( cMissionPlayer.InVehicle() != cTruck )
{
cTruck.SetParked(false);
UI_HideMissionPrompt();
MissionUnfocus();
goto WaitForPlayerInTruck();
};
if( PlayerPressedButton(cMissionPlayer, "A") )
{
MissionActivate(); // START THE MISSION!
};
// Remove vehicles and characters from previous iterations of the mission if they exist
if ( cTempA )
{
if ( !cTempA.OnScreen() )
{
cTempA.Deactivate();
cTempA = "";
};
};
if ( cTempB )
{
if ( !cTempB.OnScreen() )
{
cTempB.Deactivate();
cTempB = "";
};
};
};
Actions
{
UI_ShowMissionPrompt("Hud_Mission_Bonus_Tow", "MISSION_INSTRUCTIONS_TOWTRUCK", "MISSION_PROMPT", "MISSION_TITLE_TOWTRUCK");
};
};
/////////////////////////////////////////////////////////////////////////////////
///// CLEANUP
/////////////////////////////////////////////////////////////////////////////////
state Cleanup()
{
Actions
{
// cleanup stuff...
if ( cTruck )
{
cTruck.Release();
cTruck = "";
};
if ( cPickup )
{
cPickup.Release();
cPickup = "";
};
if ( cCustomer )
{
cCustomer.Release();
cCustomer = "";
};
if ( cTempA )
{
cTempA.Release();
cTempA = "";
};
if ( cTempB )
{
cTempB.Release();
cTempB = "";
};
if ( hMissionStart )
{
hMissionStart.SetActive(false);
};
if ( wlCity.IsLoaded() )
{
Number n(1);
Gizmo gBuildit("iSaloon_Alom_Buildit" + n.ToText("int 2"));
gBuildit.SetActive(false);
// gBuildit.SetVisible(false);
};
StreamedCharacterReleaseAll();
// All tidy, let the game know...
MissionCleanupEnd();
};
};
/////////////////////////////////////////////////////////////////////////////////
//// Mission Loop
/////////////////////////////////////////////////////////////////////////////////
state Begin()
{
Actions
{
UI_StartMission();
hMissionStart.Trigger();
cTruck.SetParked(false);
missionTimer = 0;
UI_SetHUDTimer( nMaxTime, 1, missionTimer );
UI_ShowHUDTimer(true);
StreamedCharacterPreLoad("businessman");
StreamedCharacterPreLoad("SaloonCars_Cetan");
StreamedCharacterPreLoad("SaloonCars_Alom");
goto IntialiseStage();
};
};
// Set the tow type (head to the correct state loop) and give the UI prompt and set the satnav & hotspots up
State IntialiseStage()
{
Locator lCustomerSpawn("BM_Tow_SFR_01_PIP" + nStage.ToText("int 2"));
Locator lSatNav( "BM_Tow_SFR_01_PIP" + nStage.ToText("int 2") );
HotSpot hPickup( "BM_Tow_SFR_01_HS" + nStage.ToText("int 2") );
Conditions
{
};
Actions
{
// Set the current stage's tile, to check against being loaded
if ( nStage == 1 )
{
wlCurrentMission = wlTowMission01;
}
elseif (nStage == 2)
{
wlCurrentMission = wlTowMission02;
};
// Give UI instructions
Text t("MISSION_TOWTRUCK_DIRECTIONS_PICKUP_");
t = t + nStage.ToText("int 2");
UI_SetHeroBarMax(nHeroMax);
UI_PhoneCall( true, 6.25 );
Wait(0.25);
UI_SetMissionHelpText( t, 5 );
Wait(1.5);
UI_ShowMissionCounter( false );
// Enable hotspot and satnav
hPickup.SetActive(true);
hPickup.NoCondition();
hPickup.SetIcon("Story");
SetSatNavDestination( lSatNav );
// Choose which tow type to use (i.e. which state loop to enter) for this stage
if ( nPhaseType == 0 )
{
lCustomerSpawn = ( "BM_Tow_SFR_01_NPC" + nStage.ToText("int 2") );
cCustomer = CreateAICharacter( "businessman", "Pedestrian", lCustomerSpawn );
goto HandleBuilderCar();
}
else
{
goto HeadToPickup();
};
};
};
/////////////////////////////////////////////////////////////////////////////////
//// Towing Phase
/////////////////////////////////////////////////////////////////////////////////
// Handle the start of heading to the next vehicle to tow or spellit to build
State HeadToPickup()
{
Locator lCustomerSpawn("BM_Tow_SFR_01_PIP" + nStage.ToText("int 2"));
Locator lTowSpawnTarget("BM_Tow_SFR_01_PIP" + nStage.ToText("int 2"));
HotSpot hPickup( "BM_Tow_SFR_01_HS" + nStage.ToText("int 2") );
Conditions
{
if ( cPickup )
{
if ( cTruck.IsTowing( cPickup ) )
{
hPickup.Trigger();
goto HeadToDropOff();
};
if ( cPlayer1.InVehicle() == cPickup OR cPlayer2.InVehicle() == cPickup )
{
cPickup.SetParked(true);
};
};
// if ( cMissionPlayer.InVehicle() != cTruck ) { goto ReturnToVehicle(); };
if ( missionTimer > nMaxTime ) { goto OutOfTime(); };
if ( wlCurrentMission.IsLoaded() AND !cPickup AND nStage != 1 )
{
goto RespawnPickup();
};
};
Actions
{
};
};
State RespawnPickup( )
{
Conditions
{
if ( cPickup )
{
goto HeadToPickup();
};
};
Actions
{
Locator lTowSpawnTarget( "BM_Tow_SFR_01_TARGET" + nStage.ToText("int 2") );
cPickup = CreateCharacter( "SaloonCars_Cetan", lTowSpawnTarget, "default" );
};
};
// Handle drop off checks for vehicles being towed
State HeadToDropOff( )
{
Locator lSatNav( "BM_Tow_SFR_01_DOP" + nStage.ToText("int 2") );
Area aHotSpot( "BM_Tow_SFR_01_DP" + nStage.ToText("int 2") );
HotSpot hDropOff( "BM_Tow_SFR_01_DP" + nStage.ToText("int 2") );
Conditions
{
if ( cPickup.InArea( aHotSpot ) AND !cTruck.IsTowing( cPickup ) )
{
Playergivestuds(nTowStuds);
hDropOff.Trigger();
cPickup.SetParked(false);
goto CheckStage();
};
if ( cPlayer1.InVehicle() == cPickup OR cPlayer2.InVehicle() == cPickup )
{
cPickup.SetParked(true);
};
if ( missionTimer > nMaxTime ) { goto OutOfTime(); };
};
Actions
{
hDropOff.NoCondition();
hDropOff.SetActive(true);
hDropOff.SetIcon("Story");
SetSatNavDestination( lSatNav );
Text t("MISSION_TOWRUCK_DIRECTIONS_DROPOFF_");
t = t + nStage.ToText("int 2");
UI_PhoneCall( true );
Wait(0.25);
UI_SetMissionHelpText( t, 5 );
Wait( 5.5 );
UI_PhoneCall( false );
};
};
/////////////////////////////////////////////////////////////////////////////////
//// Buildit Phase
/////////////////////////////////////////////////////////////////////////////////
// If there's a spellit involved in this stage of the mission, watch for its completion
State HandleBuilderCar( )
{
Gizmo gBuildit("iSaloon_Alom_Buildit" + nStage.ToText("int 2"));
Bool bGizmo(true);
HotSpot hPickup( "BM_Tow_SFR_01_HS" + nStage.ToText("int 2") );
Conditions
{
if ( gBuildit.HasFinished() ) // OR _Message("msg_Level.nyut_ttrepaired") == 1.0 )
{
gBuildit.SetVisible( false );
gBuildit.SetActive( false );
hPickup.Trigger();
goto SpawnBuiltCar();
};
// if ( cMissionPlayer.InVehicle() != cTruck AND cMissionPlayer.DistanceToXZ( gBuildit ) > nMaxDistance ) { goto ReturnToVehicleOrSpellit(); };
if ( missionTimer > nMaxTime ) { goto OutOfTime(); };
if ( wlCurrentMission.IsLoaded() AND !cCustomer )
{
goto RespawnDriver();
};
if ( bGizmo )
{
if ( wlCurrentMission.IsLoaded() )
{
bGizmo = false;
gBuildit.SetActive(false);
gBuildit.SetActive(true);
};
}
else
{
if ( !wlCurrentMission.IsLoaded() )
{
bGizmo = true;
};
};
};
Actions
{
};
};
State RespawnDriver( )
{
Gizmo gBuildit("iSaloon_Alom_Buildit" + nStage.ToText("int 2"));
Conditions
{
if ( cCustomer )
{
goto HandleBuilderCar();
};
};
Actions
{
Locator lCustomerSpawn( "BM_Tow_SFR_01_NPC" + nStage.ToText("int 2") );
gBuildit.SetActive(false);
gBuildit.SetActive(true);
cCustomer = CreateAICharacter( "businessman", "Pedestrian", lCustomerSpawn );
};
};
// Spawn the built car, tell the customer NPC to jump in and drive off, then increment nStage
State SpawnBuiltCar( )
{
Gizmo gBuildit("iSaloon_Alom_Buildit" + nStage.ToText("int 2"));
Number n(1);
Conditions
{
if ( cCustomer AND cPickup )
{
cCustomer.TakeOver( cPickup );
cPickup.Release();
cCustomer.Release();
cPickup = "";
cCustomer = "";
Playergivestuds(nRepairStuds);
goto CheckStage();
};
};
Actions
{
n = gBuildit.GetDirection();
cPickup = CreateCharacter( "SaloonCars_Alom", gBuildit, "default", n);
Wait(0.5);
};
};
/////////////////////////////////////////////////////////////////////////////////
//// Stage End logic
/////////////////////////////////////////////////////////////////////////////////
// Check whether to move to the next stage or complete the mission
State CheckStage( )
{
Conditions
{
};
Actions
{
bTemp = true;
nStage = nStage + 1;
UI_SetMissionCounter ( (nStage - 1), nMaxStage, false ) ;
UI_ShowMissionCounter( true );
if (nPhaseType == 0)
{
nPhaseType = 1;
}
else
{
nPhaseType = 0;
};
if ( nStage > nMaxStage )
{
goto MissionEnd();
}
else
{
if (nStage == 2)
{
wlCurrentMission = wlTowMission02;
goto IntialiseStage();
};
};
};
};
/////////////////////////////////////////////////////////////////////////////////
//// Return to Vehicle states
/////////////////////////////////////////////////////////////////////////////////
// If the player remains out of the vehicle and moves far enough away from the spellit, or enters another vehicle, abandon the mission
State ReturnToVehicleOrSpellit( )
{
Gizmo gBuildit("iSaloon_Alom_Buildit" + nStage.ToText("int 2") );
Timer abandonTimer(0);
Conditions
{
if ( ( cMissionPlayer.InVehicle() AND cMissionPlayer.InVehicle() != cTruck ) OR abandonTimer > nAbandonTime )
{
UI_RemoveMissionMessage();
goto AbandonMission();
};
if ( cMissionPlayer.DistanceToXZ( gBuildit ) <= nMaxDistance OR cMissionPlayer.InVehicle() == cTruck )
{
UI_RemoveMissionMessage();
goto HandleBuilderCar();
};
};
Actions
{
UI_SetMissionMessage("MISSION_GENERIC_RETURN_TO_MISSION");
};
};
// Prompt the player to return to their vehicle after they complete each spellit
State ReturnToVehicle( )
{
Area aHotSpot( "SFRD_TowTruckArea_PIP" + nStage.ToText("int 2") );
Timer abandonTimer(0);
Conditions
{
if ( cMissionPlayer.InVehicle() == cTruck )
{
if ( cPickup.InArea( aHotSpot ) )
{
UI_RemoveMissionMessage();
goto HeadToPickup();
}
else
{
UI_RemoveMissionMessage();
goto HeadToDropOff();
};
};
if ( abandonTimer > nAbandonTime )
{
UI_RemoveMissionMessage();
goto AbandonMission();
};
};
Actions
{
UI_SetMissionMessage("MISSION_GENERIC_RETURN_TO_MISSION");
};
};
/////////////////////////////////////////////////////////////////////////////////
//// End or complete mission states
/////////////////////////////////////////////////////////////////////////////////
// Mission ends due to player running out of time - Give out of time message and reset mission
State OutOfTime( )
{
Conditions
{
};
Actions
{
UI_EndMission("MISSION_FAIL_TIMEOUT", false);
goto HandleFailScreen();
};
};
State AbandonMission( )
{
Conditions
{
};
Actions
{
UI_EndMission("MISSION_GENERIC_ABANDONED", false);
goto HandleFailScreen();
};
};
State HandleFailScreen( )
{
Timer time(0);
Bool b(false);
Conditions
{
if ( time > 0.1 AND ( PlayerPressedButton(cMissionPlayer, "A") OR PlayerPressedButton("Y") ) AND !b )
{
UI_ResetMission();
goto Reset();
}
else
{
if ( (b AND !cMissionPlayer.InVehicle()) OR PlayerPressedButton(cMissionPlayer, "A") OR PlayerPressedButton("Y") )
{
UI_ResetMission();
goto Reset();
};
};
};
Actions
{
if ( cMissionPlayer.InVehicle() )
{
b = true;
};
};
};
// Give the mission complete message
State MissionEnd( )
{
Actions
{
UI_ShowMissionCounter( false );
goto Reset();
};
};
// Reset the mission so it can be started again
State Reset( )
{
Conditions
{
};
Actions
{
UI_SetStatsStuds();
SetSatNavDestination();
SetHotSpot();
if ( cTruck )
{
// cTruck.SetScript( "default" );
cTruck = "";
};
Number n(1);
Gizmo gBuildit("iSaloon_Alom_Buildit" + n.ToText("int 2"));
gBuildit.SetVisible( false );
gBuildit.SetActive( false );
StreamedCharacterReleaseAll();
UI_StopHUDTimer();
UI_ShowHUDTimer( false );
if ( nStage > nMaxStage )
{
MissionComplete(); // NEEDS TO CHECK AGAINST MISSION COMPLETE STATUS AND FAIL / END MISSION IF MISSION FAILED / ABANDONED ONCE THAT STATE IS AVAILABLE
}
else
{
MissionAbort();
};
};
};
UFO_MISSION.SF
HotSpot hMissionStart("");
Hotspot hCaptureArea("");
Character cPlayer1("player1");
Character cPlayer2("player2");
Character cMissionPlayer("");
Character cLiveStock01("");
Character cLiveStock02("");
Character cLiveStock03("");
Character cLiveStock04("");
Character cLiveStock05("");
Vehicle cUFO;
Locator lVehicleSpawn;
Locator lSpawnLiveStock01;
Locator lSpawnLiveStock02;
Locator lSpawnLiveStock03;
Locator lSpawnLiveStock04;
Locator lSpawnLiveStock05;
Area aTile01("");
Area aTile02("");
Area aTargetA("");
Area aTargetB("");
Area aUFO_OutOfBound("");
// Debug messages
Text tUI_StartMission("Press A to start the UFO abduction mission!");
Text tMissionDesc("Use the UFO to abduct and corral the livestock! Press A to start");
// Vehicle setup strings
Text tVehicleType("UFO");
// Declaration strings
Number nTimeLimit(600); // Seconds allowed for the mission to be completed within
Number nTargetsCaught(0);
Number nMaxTargets(5);
Number nHeroMax(10000);
Number nLiveStockAward(2000);
Timer scripttimer(0);
Timer missionTimer(0);
WorldLevel wlCity("Lego_City");
WorldLevel wlFarmLands("WI_Farmlands_0507");
WorldLevel wlFarmLands2("WI_Farmlands_0505");
WorldLevel wlFarmLands3("WI_Farmlands_0506");
Bool bLiveStockFree01(true);
Bool bLiveStockFree02(true);
Bool bLiveStockFree03(true);
Bool bLiveStockFree04(true);
Bool bLiveStockFree05(true);
Bool bCounterOn(false);
Number nLiveStockCaught01(0);
Number nLiveStockCaught02(0);
Number nLiveStockCaught03(0);
Number nLiveStockCaught04(0);
Number nLiveStockCaught05(0);
/////////////////////////////////////////////////////////////////
// Level Load
/////////////////////////////////////////////////////////////////
Function LevelEnter (WorldLevel level)
{
cPlayer1 = "player1";
cPlayer2 = "player2";
};
/////////////////////////////////////////////////////////////////////////////////
//// SETUP STAGE
/////////////////////////////////////////////////////////////////////////////////
State Setup( )
{
Conditions
{
if ( wlCity.IsLoaded() )
{
goto EnableHotspot();
};
};
Actions
{
};
};
state EnableHotspot( )
{
Conditions
{
};
Actions
{
hMissionStart = "BM_UFO_FL_01_Start";
hCaptureArea = "BM_UFO_FL_01_CaptureArea";
lVehicleSpawn = "BM_UFO_FL_01_SpawnUFO";
lSpawnLiveStock01 = "BM_UFO_FL_01_SpawnLiveStock01";
lSpawnLiveStock02 = "BM_UFO_FL_01_SpawnLiveStock02";
lSpawnLiveStock03 = "BM_UFO_FL_01_SpawnLiveStock03";
lSpawnLiveStock04 = "BM_UFO_FL_01_SpawnLiveStock04";
lSpawnLiveStock05 = "BM_UFO_FL_01_SpawnLiveStock05";
aTile01 = "WI_Farmlands01";
aTile02 = "WI_Farmlands02";
aUFO_OutOfBound = "BM_UFO_FL_01_OutOfBounds";
aTargetA = "BM_UFO_FL_01_LiveStockCylinder";
aTargetB = "BM_UFO_FL_01_LiveStockCube";
// setup stuff...
// [NOTE: stuff done here must be un-done in Cleanup()]
hMissionStart.SetHaloVisible(false);
hMissionStart.SetIcon("Bonus");
hMissionStart.SetActive(true);
hMissionStart.NoCondition();
goto WaitForReturnToTile();
};
};
// Wait for the player to be in the tile
State WaitForReturnToTile()
{
Conditions
{
if ( wlCity.IsLoaded() )
{
if( wlFarmLands.IsLoaded() )
{
// PrintToScreen("DEBUG: WaitForReturnToTile");
if ( cUFO )
{
if ( cMissionPlayer )
{
if (cMissionPlayer.GetVehicle() != cUFO)
{
cUFO.Destroy();
};
}
else
{
cUFO.Destroy();
};
};
cUFO = "";
goto WaitForPlayerInVehicle();
};
};
};
Actions
{
};
};
// Activate, then await the player to enter the taxi.
State WaitForPlayerInVehicle()
{
Conditions
{
if ( wlCity.IsLoaded() )
{
// Check to see if the player enters the mission's vehicle
if ( cUFO )
{
if ( cPlayer1 )
{
if( cPlayer1.GetVehicle() == cUFO )
{
if (MissionFocus(cPlayer1))
{
cMissionPlayer = cPlayer1;
goto GiveMissionPrompts();
};
};
}
else
{
cPlayer1 = "player1";
};
if ( cPlayer2 )
{
if( cPlayer2.GetVehicle() == cUFO )
{
if (MissionFocus(cPlayer2))
{
cMissionPlayer = cPlayer2;
goto GiveMissionPrompts();
};
};
}
else
{
cPlayer2 = "player2";
};
};
if( !wlFarmLands.IsLoaded() ) { goto WaitForReturnToTile(); };
};
};
Actions
{
UI_LoadMissionPrompt("Hud_Mission_Bonus_UFO");
if ( !cUFO )
{
Number nDirection(0);
nDirection = lVehicleSpawn.GetDirection();
cUFO = CreateAIVehicle( tVehicleType, "Aircraft", lVehicleSpawn, nDirection );
wait(0);
cUFO.SetParked(true);
};
};
};
// Checks to see if the player starts the mission or not - handles accepting the mission
State GiveMissionPrompts()
{
Number n(0);
Conditions
{
// Gets out of the vehicle before pressing LB to initiate mission...
if( cMissionPlayer.GetVehicle() != cUFO )
{
cUFO.SetParked(false);
UI_HideMissionPrompt();
MissionUnfocus();
goto WaitForPlayerInVehicle();
};
if( PlayerPressedButton(cMissionPlayer, "A") )
{
MissionActivate(); // START THE MISSION!
};
};
Actions
{
UI_ShowMissionPrompt("Hud_Mission_Bonus_UFO", "MISSION_INSTRUCTIONS_UFO", "MISSION_PROMPT", "MISSION_TITLE_UFO");
};
};
/////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////
state Cleanup()
{
Actions
{
// cleanup stuff...
if ( cLiveStock01 )
{
cLiveStock01.Kill();
cLiveStock01 = "";
};
if ( cLiveStock02 )
{
cLiveStock02.Kill();
cLiveStock02 = "";
};
if ( cLiveStock03 )
{
cLiveStock03.Kill();
cLiveStock03 = "";
};
if ( cLiveStock04 )
{
cLiveStock04.Kill();
cLiveStock04 = "";
};
if ( cLiveStock05 )
{
cLiveStock05.Kill();
cLiveStock05 = "";
};
if ( cUFO )
{
cUFO.Destroy();
cUFO = "";
};
if ( hMissionStart )
{
hMissionStart.SetActive(false);
};
if (hCaptureArea)
{
hCaptureArea.SetActive(false);
};
// All tidy, let the game know...
MissionCleanupEnd();
};
};
/////////////////////////////////////////////////////////////////////////////////
//// Mission Loop
/////////////////////////////////////////////////////////////////////////////////
state Begin()
{
Actions
{
UI_StartMission();
hMissionStart.Trigger();
hCaptureArea.SetActive(true);
hCaptureArea.NoCondition();
cUFO.SetParked(false);
cMissionPlayer.SetNoTagRelease(false);
missionTimer = 0;
UI_SetHUDTimer( nTimeLimit, 1, missionTimer );
UI_ShowHUDTimer(true);
goto AbductCheck();
};
};
State AbductCheck()
{
Text tDebug("");
Timer ResetCounterTime(0);
Conditions
{
if ( cLiveStock01 )
{
if ( bLiveStockFree01 )
{
if ( cLiveStock01.InArea( aTargetA ) AND cLiveStock01.InArea( aTargetB ) )
{
nTargetsCaught = nTargetsCaught + 1;
UI_SetMissionCounter( nTargetsCaught, nMaxTargets, false, 1.5 );
UI_ShowMissionCounter( true );
ResetCounterTime = 0;
bCounterOn = true;
bLiveStockFree01 = false;
if (nLiveStockCaught01 == 0)
{
nLiveStockCaught01 = 1;
Playergivestuds(nLiveStockAward);
};
};
}
else
{
if ( !cLiveStock01.InArea( aTargetA ) OR !cLiveStock01.InArea( aTargetB ) )
{
nTargetsCaught = nTargetsCaught - 1;
UI_SetMissionCounter( nTargetsCaught, nMaxTargets, false, 1.5 );
UI_ShowMissionCounter( true );
ResetCounterTime = 0;
bCounterOn = true;
bLiveStockFree01 = true;
};
};
};
if ( cLiveStock02 )
{
if ( bLiveStockFree02 )
{
if ( cLiveStock02.InArea( aTargetA ) AND cLiveStock02.InArea( aTargetB ) )
{
nTargetsCaught = nTargetsCaught + 1;
UI_SetMissionCounter( nTargetsCaught, nMaxTargets, false, 1.5 );
UI_ShowMissionCounter( true );
ResetCounterTime = 0;
bCounterOn = true;
bLiveStockFree02 = false;
if (nLiveStockCaught02 == 0)
{
nLiveStockCaught02 = 1;
Playergivestuds(nLiveStockAward);
};
};
}
else
{
if ( !cLiveStock02.InArea( aTargetA ) OR !cLiveStock02.InArea( aTargetB ) )
{
nTargetsCaught = nTargetsCaught - 1;
UI_SetMissionCounter( nTargetsCaught, nMaxTargets, false, 1.5 );
UI_ShowMissionCounter( true );
ResetCounterTime = 0;
bCounterOn = true;
bLiveStockFree02 = true;
};
};
};
if ( cLiveStock03 )
{
if ( bLiveStockFree03 )
{
if ( cLiveStock03.InArea( aTargetA ) AND cLiveStock03.InArea( aTargetB ) )
{
nTargetsCaught = nTargetsCaught + 1;
UI_SetMissionCounter( nTargetsCaught, nMaxTargets, false, 1.5 );
UI_ShowMissionCounter( true );
ResetCounterTime = 0;
bCounterOn = true;
bLiveStockFree03 = false;
if (nLiveStockCaught03 == 0)
{
nLiveStockCaught03 = 1;
Playergivestuds(nLiveStockAward);
};
};
}
else
{
if ( !cLiveStock03.InArea( aTargetA ) OR !cLiveStock03.InArea( aTargetB ) )
{
nTargetsCaught = nTargetsCaught - 1;
UI_SetMissionCounter( nTargetsCaught, nMaxTargets, false, 1.5 );
UI_ShowMissionCounter( true );
ResetCounterTime = 0;
bCounterOn = true;
bLiveStockFree03 = true;
};
};
};
if ( cLiveStock04 )
{
if ( bLiveStockFree04 )
{
if ( cLiveStock04.InArea( aTargetA ) AND cLiveStock04.InArea( aTargetB ) )
{
nTargetsCaught = nTargetsCaught + 1;
UI_SetMissionCounter( nTargetsCaught, nMaxTargets, false, 1.5 );
UI_ShowMissionCounter( true );
ResetCounterTime = 0;
bCounterOn = true;
bLiveStockFree04 = false;
if (nLiveStockCaught04 == 0)
{
nLiveStockCaught04 = 1;
Playergivestuds(nLiveStockAward);
};
};
}
else
{
if ( !cLiveStock04.InArea( aTargetA ) OR !cLiveStock04.InArea( aTargetB ) )
{
nTargetsCaught = nTargetsCaught - 1;
UI_SetMissionCounter( nTargetsCaught, nMaxTargets, false, 1.5 );
UI_ShowMissionCounter( true );
ResetCounterTime = 0;
bCounterOn = true;
bLiveStockFree04 = true;
};
};
};
if ( cLiveStock05 )
{
if ( bLiveStockFree05 )
{
if ( cLiveStock05.InArea( aTargetA ) AND cLiveStock05.InArea( aTargetB ) )
{
nTargetsCaught = nTargetsCaught + 1;
UI_SetMissionCounter( nTargetsCaught, nMaxTargets, false, 1.5 );
UI_ShowMissionCounter( true );
ResetCounterTime = 0;
bCounterOn = true;
bLiveStockFree05 = false;
if (nLiveStockCaught05 == 0)
{
nLiveStockCaught05 = 1;
Playergivestuds(nLiveStockAward);
};
};
}
else
{
if ( !cLiveStock05.InArea( aTargetA ) OR !cLiveStock05.InArea( aTargetB ) )
{
nTargetsCaught = nTargetsCaught - 1;
UI_SetMissionCounter( nTargetsCaught, nMaxTargets, false, 1.5 );
UI_ShowMissionCounter( true );
ResetCounterTime = 0;
bCounterOn = true;
bLiveStockFree05 = true;
};
};
};
if ( bCounterOn AND ResetCounterTime > 2.5 )
{
UI_ShowMissionCounter( false );
bCounterOn = false;
};
if( nTargetsCaught >= nMaxTargets ) { goto FinishedMission(); };
if( cMissionPlayer.GetVehicle() != cUFO OR !cMissionPlayer.InArea(aUFO_OutOfBound)) { goto AbandonedWaitForTimer(); };
if( missionTimer > nTimeLimit ) { goto OutOfTime(); };
};
Actions
{
Number nDirection(0);
UI_SetHeroBarMax(nHeroMax);
if (cLiveStock01 == "")
{
nDirection = lSpawnLiveStock01.GetDirection();
cLiveStock01 = CreateAICharacter( "BusinessMan", "Pedestrian", lSpawnLiveStock01, nDirection );
};
if (cLiveStock02 == "")
{
nDirection = lSpawnLiveStock02.GetDirection();
cLiveStock02 = CreateAICharacter( "BusinessMan", "Pedestrian", lSpawnLiveStock02, nDirection );
};
if (cLiveStock03 == "")
{
nDirection = lSpawnLiveStock03.GetDirection();
cLiveStock03 = CreateAICharacter( "BusinessMan", "Pedestrian", lSpawnLiveStock03, nDirection );
};
if (cLiveStock04 == "")
{
nDirection = lSpawnLiveStock04.GetDirection();
cLiveStock04 = CreateAICharacter( "BusinessMan", "Pedestrian", lSpawnLiveStock04, nDirection );
};
if (cLiveStock05 == "")
{
nDirection = lSpawnLiveStock05.GetDirection();
cLiveStock05 = CreateAICharacter( "BusinessMan", "Pedestrian", lSpawnLiveStock05, nDirection );
};
};
};
// ---------------- Out Of Time ---------------- ;
// Called if the timer reaches 0
State OutOfTime()
{
Conditions
{
};
Actions
{
cUFO.SetParked(true);
cMissionPlayer.SetNoTagRelease(true);
UI_StopHUDTimer();
UI_ShowHUDTimer(false);
UI_EndMission("MISSION_FAIL_TIMEOUT", false);
goto HandleFailScreen();
};
};
// Wait for the timer to get to 5 seconds...
State AbandonedWaitForTimer()
{
Timer tAbandon(0);
Conditions
{
// If player gets back into the pizza bike, don't reinitialise the mission, just goes back to WaitForNextCheckpoint state.
if( cMissionPlayer.GetVehicle() == cUFO AND cMissionPlayer.InArea(aUFO_OutOfBound) )
{
UI_RemoveMissionMessage();
goto AbductCheck();
};
// If the player enters any vehicle other than the race car, immediately abandon the mission.
if( cMissionPlayer.GetVehicle() AND cMissionPlayer.GetVehicle() != cUFO )
{
UI_RemoveMissionMessage();
goto Abandoned();
};
if( tAbandon > 7.5 )
{
UI_RemoveMissionMessage();
goto Abandoned();
};
If (!wlFarmLands.IsLoaded() AND !wlFarmLands2.IsLoaded() AND !wlFarmLands3.IsLoaded())
{
goto Abandoned();
};
};
Actions
{
UI_SetMissionMessage("MISSION_GENERIC_RETURN_TO_MISSION");
};
};
// Player has officially abandoned the mission.
State Abandoned()
{
Conditions
{
};
Actions
{
// Reset the mission and cleanup anything being used
UI_StopHUDTimer();
UI_ShowHUDTimer(false);
cUFO.SetParked(true);
UI_EndMission("MISSION_GENERIC_ABANDONED", false);
goto HandleFailScreen();
};
};
State HandleFailScreen( )
{
Timer time(0);
Bool b(false);
Conditions
{
if ( time > 0.1 AND ( PlayerPressedButton(cMissionPlayer, "A") OR PlayerPressedButton("Y") ) AND !b )
{
UI_ResetMission();
goto ResetMission();
}
else
{
if ( (b AND !cMissionPlayer.GetVehicle()) OR PlayerPressedButton(cMissionPlayer, "A") OR PlayerPressedButton("Y") )
{
UI_ResetMission();
goto ResetMission();
};
};
};
Actions
{
if ( cMissionPlayer.GetVehicle() )
{
b = true;
};
};
};
// Handles Mission complete
State FinishedMission()
{
Conditions
{
};
Actions
{
UI_StopHUDTimer();
UI_ShowHUDTimer(false);
// UI_EndMission("MISSION_COMPLETE", true);
goto ResetMission();
};
};
// Reset everything in the mission so it's in a state to be restarted
State ResetMission()
{
Conditions
{
};
Actions
{
UI_SetStatsStuds();
hCaptureArea.SetActive(false);
Wait(2.5);
FadeScreen(true);
Wait(1);
cLiveStock01.Kill();
cLiveStock02.Kill();
cLiveStock03.Kill();
cLiveStock04.Kill();
cLiveStock05.Kill();
cUFO.SetParked(false);
cUFO.SetLocked(false);
cMissionPlayer.ReleaseTakeOver();
// cUFO.Deactivate();
// Number nDirection(0);
// nDirection = lVehicleSpawn.GetDirection();
// cUFO = CreateCharacter( tVehicleType, lVehicleSpawn, "default", nDirection );
Wait(2);
FadeScreen(false);
if ( nTargetsCaught >= nMaxTargets )
{
MissionComplete(); // NEEDS TO CHECK AGAINST MISSION COMPLETE STATUS AND FAIL / END MISSION IF MISSION FAILED / ABANDONED ONCE THAT STATE IS AVAILABLE
}
else
{
MissionAbort();
};
// goto WaitForPlayerInVehicle();
};
};
(Source: RandomWizKid)