So for my SP map I just have a basic objective setup and it is working. Before I move on, I want to get the intro down pat-( the black screen with the noted date, location, and name of the character)
Here is my sample GSC I am using for the basic objective- this works as is. The problem I am having is noted under the .gsc
/*
UTILITIES FIRST
*/
#include maps\_music;
#include maps\_utility;
#include maps\_anim;
#include common_scripts\utility;
#using_animtree ("generic_human");
main()
{
maps\_load::main();
// maps\cherbourg_anim::main();
maps\cherbourg_fx::main();
// precache any models used in your objectives here
// precacheModel("weapon_explosives");
// the players are in the level, now we can thread to our first objective
thread obj1();
}
obj1()
{
obj1 = getent("obj1", "targetname");
objective_add(1, "active", &"cherbourg_CLEAROUT",getent("obj1","targetname").origin);
objective_current(1);
obj1 waittill("trigger");
objective_state(1, "done");
obj1 delete();
wait(2);
iprintlnbold (&"cherbourg_OBJ_COMPLETED"); //Lets the player know the objective is complete
}
CodMapper was nice enough to share with me some basic information on what to add in order to get the intro screen working. However when I add the information to my GSC I get a { bad snyntax error and cannot figure out where the problem is starting. Here is the entire GSC with the added intro code. Any help of where the grammer error is coming from or what I could be doing better within the script to better organize the GSC would be greatly appreciated!
Thanks guys!
/*
Lets sort out our utilities first
*/
#include maps\_music;
#include maps\_utility;
#include maps\_anim;
#include common_scripts\utility;
#using_animtree ("generic_human");
main()
{
maps\_load::main();
// maps\cherbourg_anim::main();
maps\cherbourg_fx::main();
// precache any models used in your objectives here
// precacheModel("weapon_explosives");
custom_introscreen( STRING1, string2, string3, string4, string5 )
{
/#
if( GetDvar( "introscreen" ) == "0" )
{
wait( 0.05 );
waittillframeend;
level notify( "finished final intro screen fadein" );
waittillframeend;
flag_set( "starting final intro screen fadeout" );
waittillframeend;
level notify( "controls_active" ); // Notify when player controls have been restored
waittillframeend;
flag_set( "introscreen_complete" ); // Do final notify when player controls have been restored
flag_set( "pullup_weapon" );
return;
}
if( level.start_point != "default" )
{
return;
}
#/
level.introblack = NewHudElem();
level.introblack.x = 0;
level.introblack.y = 0;
level.introblack.horzAlign = "fullscreen";
level.introblack.vertAlign = "fullscreen";
level.introblack.foreground = true;
level.introblack SetShader( "black", 640, 480 );
flag_wait( "all_players_connected" );
// SCRIPTER_MOD
// MikeD( 3/16/200 ): Freeze all of the players controls
// level.player FreezeControls( true );
freezecontrols_all( true );
// MikeD( 11/14/2007 ): Used for freezing controls on players who connect during the introscreen
level._introscreen = true;
wait( 0.05 );
level.introstring = [];
//Title of level
if( IsDefined( STRING1 ) )
{
maps\_introscreen::introscreen_create_line( STRING1, "lower_left", 1.75 );
}
wait( 2 );
level thread set_all_players_double_vision( 5, 0.05 );
level thread set_all_players_blur( 2, 0.05 );
if( IsDefined( string2 ) )
{
maps\_introscreen::introscreen_create_line( string2, "lower_left", 1.75 );
}
if( IsDefined( string3 ) )
{
maps\_introscreen::introscreen_create_line( string3, "lower_left", 1.75 );
}
level thread set_all_players_shock( "mak_intro", 6 );
if( IsDefined( string4 ) )
{
wait( 2 );
maps\_introscreen::introscreen_create_line( string4, "lower_left", 1.75 );
}
if( IsDefined( string5 ) )
{
wait( 2 );
maps\_introscreen::introscreen_create_line( string5, "lower_left", 1.75 );
}
level notify( "finished final intro screen fadein" );
wait( 2 );
// Fade out black
level.introblack FadeOverTime( 0.5 );
level.introblack.alpha = 0;
flag_set( "starting final intro screen fadeout" );
// Only restore controls if we have blood
if( is_mature() )
{
// Restore player controls part way through the fade in
freezecontrols_all( false );
}
level._introscreen = false;
level notify( "controls_active" ); // Notify when player controls have been restored
// Fade out text
level thread maps\_introscreen::introscreen_fadeOutText();
flag_set( "introscreen_complete" ); // Notify when complete
// Extra Blur stuff.
level thread set_all_players_double_vision( 0, 2 );
level thread set_all_players_blur( 0, 2 );
wait( 4.5 );
// Get dizzy again
level thread set_all_players_shock( "mak_intro", 3 );
level thread set_all_players_double_vision( 3, 2 );
level thread set_all_players_blur( 1, 2 );
wait( 2.25 );
// Ok, now focus
level thread set_all_players_double_vision( 0, 3 );
level thread set_all_players_blur( 0, 3.25 );
}
// the players are in the level, now we can thread to our first objective
thread obj1();
}
obj1()
{
obj1 = getent("obj1", "targetname");
objective_add(1, "active", &"cherbourg_CLEAROUT",getent("obj1","targetname").origin);
objective_current(1);
obj1 waittill("trigger");
objective_state(1, "done");
obj1 delete();
wait(2);
iprintlnbold (&"cherbourg_OBJ_COMPLETED"); //Let player know he is done
} |