/*----------------------------------------------------- file: rhi1.gsc description: level script for Rhineland 1 scripter: Chris_P builder: Jeff Zaring -----------------------------------------------------*/ #include maps\_utility; #include common_scripts\utility; main() { init_starts(); init_vehicles(); level.tanks = 0; // Required to set up the vehicles through the vehicle script maps\_flak88::main( "german_artillery_flak88_nm" ); //_load baby! maps\_load::main(); //level flags level.patrollers_cleared = false; level.pod1_enemies_cleared = false; level.pod1_complete = false; level.ai_at_lvt1 = false; level.ai_at_lvt2 = false; level.lvt1 = getent("player_vehicle_1","targetname"); level.lvt2 = getent("player_vehicle_2","targetname"); //level support scripts maps\rhi1_anim::main(); maps\rhi1_fx::main(); maps\rhi1_amb::main(); maps\rhi1_status::main(); maps\_mortarteam::main(); createthreatbiasgroup("engineers"); createthreatbiasgroup("attackers"); //camera stuff maps\createcam\rhi1_cam::main(); //Start Ambient sounds thread maps\rhi1_amb::main(); } /*----------------------------------------------------- initialize the skipto's -----------------------------------------------------*/ init_starts() { add_start( "factory", ::start_factory_assault ); add_start("pod2",::pod_2); add_start("pod3",::start_pod3); add_start("camera",::camera_start); default_start( ::pod_1 ); } /*----------------------------------------------------- initialize vehicles -----------------------------------------------------*/ init_vehicles() { maps\_buffalo::main( "vehicle_usa_tracked_lvt4" ); maps\_flak88::main( "german_artillery_flak88_nm" ); //maps\_jeep::main( "vehicle_german_kubel_nomandy" ); } camera_start() { //level thread maps\rhi1_fx::dust(); } /*----------------------------------------------------- start the first event -----------------------------------------------------*/ pod_1() { // wait until the first player spawns into the game before setting up friendlies //level waittill("first_player_ready",player); //set initial friendlychain players = get_players(); players[0] setfriendlychain( getnode("pod1_chain_start","targetname")); //put AI on LVT for first "pod" thread put_ai_on_lvt(1,1,true); thread put_ai_on_lvt(2,1,true); //add the first objective level waittill("introscreen_complete"); //level thread maps\_camsys::playback_scene( "beg" ); //level waittill("plackback_finished"); //put players on LVT thread put_players_on_lvt(); objective_add(1,"current",&"RHI1_OBJ1"); //start the LVT's rolling and monitor them level notify("start lvts"); thread monitor_lvt(1,1); thread monitor_lvt(2,1); //monitor the patrollers thread pod1_patrollers(); //add the new objective when the players get off the vehicle level waittill("lvt unloaded"); objective_add (2,"current",&"RHI1_OBJ_SECURE",(-12992,17034,50)); //wait until the players clear pod1... //this doesn't always work right ? level waittill_aigroupcleared ("pod1_enemies"); //put players and AI back onto the LVTs to take them to the next area thread ai_goto_lvt(1); objective_state(2,"done"); wait(1); objective_add(3,"current",&"RHI1_OBJ_REGROUP",level.lvt1.origin); objective_additionalposition(3,1,level.lvt2.origin); lvt_wait(); level waittill("player used lvt"); objective_state(3,"done"); objective_delete(3); objective_delete(2); thread put_ai_on_lvt(1,2,false); thread put_ai_on_lvt(2,2,false); thread put_players_on_lvt(); level notify("start lvts"); thread monitor_lvt(1,2); thread monitor_lvt(2,2); thread house_shutter_guys("house1_shutter_guys",1); thread house_shutter_guys("house2_shutter_guys",2); level waittill("lvt unloaded"); thread runners(); objective_add (3,"current",&"RHI1_OBJ_SECURE",(-14678,12879,150)); //Why doesn't this work sometimes ??? //level waittill_aigroupcleared("pod2_enemies"); while(get_ai_group_ai("pod2_enemies").size >0) { wait(2); } objective_state(3,"done"); wait(1); objective_add(4,"current",&"RHI1_OBJ_REGROUP",level.lvt1.origin); objective_additionalposition(4,1,level.lvt2.origin); thread ai_goto_lvt(2); lvt_wait(); objective_state(3,"done"); objective_delete(3); objective_delete(2); pod_3(false); } start_pod3() { pod_3(true); } pod_3(start) { //thread pod3_stuff(); if(!start) { level waittill("player used lvt"); //objective_state(4,"done"); objective_delete(3); objective_delete(4); objective_delete(2); } players = get_players(); players[0] setfriendlychain( getnode("pod3_chain_start","targetname")); thread put_ai_on_lvt(1,3,start); thread put_ai_on_lvt(2,3,start); thread put_players_on_lvt(); wait(1); level notify("start lvts"); thread monitor_lvt(1,3); thread monitor_lvt(2,3); wait (randomint(4)); level.lvt1 thread lvt_explosions(); level.lvt2 thread lvt_explosions(); level waittill("lvt unloaded"); players = get_players(); players[0] setfriendlychain( getnode("pod3_chain_start","targetname")); level notify("end lvt mortars"); objective_add (2,"current",&"RHI1_OBJ_SECURE",(-8626,10964,600)); //level waittill_aigroupcleared ("pod3_enemies"); while(get_ai_group_ai("pod3_enemies").size >0) { wait(2); } objective_state(2,"done"); wait(2); start_factory_assault(); } /*----------------------------------------------------- The guys who run away from you at pod2 -----------------------------------------------------*/ runners() { runners = getentarray("runners","targetname"); for(i=0;i0) { wait(1); } //level waittill_aigroupcleared("pod2_enemies"); objective_state(3,"done"); wait(1); objective_add(4,"current",&"RHI1_OBJ_REGROUP"); lvt_Wait(); pod_3(false); } /*----------------------------------------------------- make the lvts usable -----------------------------------------------------*/ lvt_wait() { //level.lvt1 makevehicleusable(); //level.lvt2 makevehicleusable(); level.lvt1 thread lvt_think(1); level.lvt2 thread lvt_think(2); } /*----------------------------------------------------- monitor for players to use the LVT // - currently just waits for player to get within a radius -----------------------------------------------------*/ lvt_think(lvt_num) { //self waittill("trigger",other); level endon("player used lvt"); waiting = true; while(waiting) { wait(1); players = get_players(); for(i=0;i