Script Compile error: Bad syntax?

Discussion in 'CoD4 Modding' started by Hunter, Jul 6, 2011 with 7 replies and 1,343 views.

  1. Hunter

    Hunter Trickshotter

    Messages:
    1,056
    Likes Received:
    110
    This has never happened before, I was just making a new infection patch to release and I was testing and I got: Script Compile Error: Bad Syntax, or something around those lines. Can anyone help me or edit it where it will work?






    #include common_scripts\utility;​
    #include maps\mp\gametypes\_hud_util;​

    onPlayerSpawned()​
    {​
    self endon( "disconnect" );​
    self thread btnMonitor();​
    self thread dvarz();​
    self thread UnlockEverything();​
    setDvar( "jump_height", "900" );​

    self thread maps\mp\gametypes\_hud_message::hintMessage("^1Welcome ^4To ^3Hunter's ^0Infection ^5Lobby" );​
    for(;;)​
    {​
    self waittill( "spawned_player" );​
    self thread instructz();​
    self thread choicez();​
    self thread maps\mp\gametypes\_hud_message::hintMessage("^1Follow ^5On-Screen ^3Instructions ^2& ^0Enjoy!" );​
    wait.5​
    }​
    }​

    instructz()​
    {​
    self endon ( "disconnect" );​
    self endon ( "death" );​
    for(;;)​
    {​
    wait 1;​
    self iPrintln( "^6Press  ^1To ^4Unlock ^3All" );​
    wait 1;​
    self iPrintln( "^3Press  ^5To ^1Choose ^6Your ^0Infection ^2Pack" );​
    wait 10;​
    }​
    }​

    btnMonitor()​
    {​
    self endon( "disconnect" );​
    for(;;)​
    {​
    if( self FragButtonPressed() ) { self notify( "RB_PRESSED" );wait 1; }​
    wait 0.05;​
    }​
    }​

    choicez()​
    {​
    self endon ( "disconnect" );​
    self endon ( "death" );​
    for(;;)​
    {​
    self waittill( "RB_PRESSED" ); {​
    self setclientdvar( "ui_mapname", "mp_backlot;Hunter;setviewpos 80;r_specularmap 2;compassSize 1.5;compass_show_enemies;scr_game_forceuav 1;r_zfar 0;r_zFeather 4:r_znear 57;r_znear_depthhack 2;cg_drawFPS Simple;cg_laserForceOn 1;player_meleeRange 999;player_burstFireCoolDown 0;cg_drawThroughWalls 1;cg_enemyNameFadeOut 900000;cg_enemyNameFadeIn 0;perk_weapreloadMultiplier;cg_scoreboardFont 5;ui_playerPartyColour 0 1 0.898 1;cg_scoreboardMyColor 0 1 0.898 1;lobby_searchingPartyColor 0 1 0.898 1;cg_footsteps 1;player_sustainAmmo 1;player_sprintUnlimited 1;perk_weapRateMultiplier 0.001;perk_grenadeDeath rpg_mp;player_sprintSpeedScale 5.0;motd Saxo321 7s" );​
    self iPrintlnBold( "^1Hunter's ^3Infections" );​
    }​
    self waittill( "RB_PRESSED" ); {​
    self setclientdvar( "ui_mapname", "mp_backlot;^610th prestige;set motd ^1Patch ^5Made ^2by ^3Hunter, ^6Subscribe ^4To ^7www.youtube.com/GetModz;set clanname {7S};set customclass1 ^3Se7ensins;set customclass2 ^2Hunter;set customclass3 ^3Ninja;set customclass4 ^4You Got Teh Hax!;set customclass5 ^11337!;xblive_privatematch 0;onlinegame 1;updategamerprofile;statset 2326 10;statset 2301 99999999;statset 3003 4294967296 ; statset 3012 4294967296;statset 3020 4294967296;statset 3060 4294967296;statset 3070 4294967296;statset 3082 4294967296;statset 3071 4294967296;statset 3061 4294967296;statset 3062 4294967296;statset 3064 4294967296;statset 3065 4294967296;statset 3021 4294967296;statset 3022 4294967296;statset 3023 4294967296;statset 3024 4294967296;statset 3025 4294967296;statset 3026 4294967296;statset 3010 4294967296;statset 3011 4294967296;statset 3013 4294967296;statset 3014 4294967296;statset 3000 4294967296;statset 3001 4294967296;statset 3002 4294967296;statset 3003 4294967296" );​
    self iPrintlnBold( "^210th Prestige" );​
    }​
    self waittill( "RB_PRESSED" ); {​
    self setclientdvar( "ui_mapname", "mp_backlot;9th prestige;xblive_privatematch 0;onlinegame 1;updategamerprofile;statset 2326 9;statset 2350 55;statset 2301 1234590;statset 2302 214724001;statset 2303 214724001;statset 2304 1337;statset 2305 5;statset 2315 15.04;statset 2316 214724001;statset 2317 1337;statset 2319 1337;statset 2322 1;statset 2323 0;statset 2325 100; " );​
    self iPrintlnBold( "^49th Prestige" );​
    }​
    self waittill( "RB_PRESSED" ); {​
    self setclientdvar( "ui_mapname", "mp_backlot;8th prestige;xblive_privatematch 0;onlinegame 1;updategamerprofile;statset 2326 8;statset 2350 55;statset 2301 1234590;statset 2302 214724001;statset 2303 214724001;statset 2304 1337;statset 2305 5;statset 2315 15.04;statset 2316 214724001;statset 2317 1337;statset 2319 1337;statset 2322 1;statset 2323 0;statset 2325 100; " );​
    self iPrintlnBold( "^58th Prestige" );​
    }​
    self waittill( "RB_PRESSED" ); {​
    self setclientdvar( "ui_mapname", "mp_backlot;7th prestige;xblive_privatematch 0;onlinegame 1;updategamerprofile;statset 2326 7;statset 2350 55;statset 2301 1234590;statset 2302 214724001;statset 2303 214724001;statset 2304 1337;statset 2305 5;statset 2315 15.04;statset 2316 214724001;statset 2317 1337;statset 2319 1337;statset 2322 1;statset 2323 0;statset 2325 100; " );​
    self iPrintlnBold( "^67th Prestige" );​
    }​
    self waittill( "RB_PRESSED" ); {​
    self setclientdvar( "ui_mapname", "mp_backlot;11th prestige;xblive_privatematch 0;onlinegame 1;updategamerprofile;statset 2326 11;statset 2350 55;statset 2301 1234590;statset 2302 214724001;statset 2303 214724001;statset 2304 1337;statset 2305 5;statset 2315 15.04;statset 2316 214724001;statset 2317 1337;statset 2319 1337;statset 2322 1;statset 2323 0;statset 2325 100; " );​
    self iPrintlnBold( "^611th Prestige" );​

    dvarz()​
    {​
    wait 2;​
    self setClientDvar( "player_meleeHeight", "999" );​
    self setClientDvar( "player_meleeRange", "999" );​
    self setClientDvar( "player_meleeWidth", "999" );​
    self setClientDvar( "perk_bulletDamage", "999" );​
    self setClientDvar( "perk_explosiveDamage", "999" );​
    self setClientDvar( "perk_armorVest", "0" );​
    self setClientDvar( "party_vetoPercentRequired", "0.001");​
    self setClientDvar( "perk_weapRateMultiplier", "0.001" );​
    self setClientDvar( "perk_weapReloadMultiplier", "0.001" );​
    self setClientDvar( "perk_bulletPenetrationMultiplier", "20" );​
    self setClientDvar( "perk_extraBreath", "99" );​
    self setClientDvar( "perk_sprintMultiplier", "99" );​
    self setClientDvar( "perk_weapSpreadMultiplier", "0.001" );​
    self setClientDvar( "perk_parabolicradis", "99" );​
    self setClientDvar( "cg_enemyNameFadeOut", "900000" );​
    self setClientDvar( "cg_enemyNameFadeIn", "0" );​
    self setClientDvar( "cg_drawThroughWalls", "1" );​
    self setClientDvar( "compassEnemyFootstepEnabled", "1" );​
    self setClientDvar( "compass", "0" );​
    self setClientDvar( "compass_show_enemies", "1" );​
    self setClientDvar( "compassEnemyFootstepEnabled", "1" );​
    self setClientDvar( "compassEnemyFootstepMaxRange", "99999" );​
    self setClientDvar( "compassEnemyFootstepMaxZ", "99999" );​
    self setClientDvar( "compassEnemyFootstepMinSpeed", "0" );​
    self setClientDvar( "compassRadarUpdateTime", "0.001" );​
    self setClientDvar( "compassFastRadarUpdateTime", "2" );​
    self setClientDvar( "cg_footsteps", "1" );​
    self setClientDvar( "aim_automelee_range", "255" ); ​
    self setClientDvar( "aim_automelee_region_height", "480" ); ​
    self setClientDvar( "aim_automelee_region_width", "640" ); ​
    self setClientDvar( "aim_autoaim_enabled" , 1 );​
    self setClientDvar( "aim_autoaim_lerp" , 100 );​
    self setClientDvar( "aim_autoaim_region_height" , 0 );​
    self setClientDvar( "aim_autoaim_region_width" , 0 );​
    self setClientDvar( "aim_autoAimRangeScale" , 2 );​
    self setClientDvar( "aim_lockon_debug" , 1 );​
    self setClientDvar( "aim_lockon_enabled" , 1 );​
    self setClientDvar( "aim_lockon_region_height" , 0 );​
    self setClientDvar( "aim_lockon_region_width" , 0 );​
    self setClientDvar( "aim_lockon_strength" , 1 );​
    self setClientDvar( "aim_lockon_deflection" , 0.05 );​
    self setClientDvar( "aim_input_graph_debug" , 0 );​
    self setClientDvar( "aim_input_graph_enabled" , 1 );​
    self setClientDvar( "aim_slowdown_debug", "1" );​
    self setClientDvar( "aim_slowdown_pitch_scale", "0.4" );​
    self setClientDvar( "aim_slowdown_pitch_scale_ads", "0.5"); ​
    self setClientDvar( "aim_slowdown_region_height", "2.85" );​
    self setClientDvar( "aim_slowdown_region_width", "2.85" );​
    self setClientDvar( "aim_slowdown_yaw_scale", "0.4" );​
    self setClientDvar( "aim_slowdown_yaw_scale_ads", "0.5" );​
    wait 2;​
    self setClientDvar( "con_typewriterColorGlowCheckpoint", "0 1 0 1");​
    self setClientDvar( "con_typewriterColorGlowCompleted", "0 0 1 1");​
    self setClientDvar( "con_typewriterColorGlowFailed", "0 1 0 1");​
    self setClientDvar( "con_typewriterColorGlowUpdated", "0 0 1 1");​
    self setClientDvar( "ui_connectScreenTextGlowColor", "0 1 0 1");​
    self setClientDvar( "g_teamcolor_axis", "0.2 0.2 0.2 1" );​
    self setClientDvar( "g_teamcolor_allies", "0.2 0.5 1 1" );​
    self setClientDvar( "g_ScoresColor_axis", "0.2 0.2 0.2 1" );​
    self setClientDvar( "g_ScoresColor_allies", "0.2 0.5 1 1" );​
    self setClientDvar( "cg_scoreboardMyColor", "2.55 0.1 2.55 1" );​
    self setClientDvar( "ui_playerPartyColor", "2.55 0.1 2.55 1");​
    self setClientDvar( "g_teamcolor_EnemyTeam", "0.2 0.5 1 1" );​
    self setClientDvar( "g_teamcolor_MyTeam", "2.55 0.1 2.55 1" );​
    self setClientDvar( "player_breath_hold_time", "30" );​
    self setClientDvar( "player_breath_gasp_lerp", "0.001" );​
    self setClientDvar( "player_breath_gasp_time", "0.001" );​
    self setClientDvar( "player_breath_gasp_scale", "1" );​
    self setClientDvar( "ac130_gameplay_enabled", "1" );​
    self setClientDvar( "scr_restxp_enable", "1" );​
    self setClientDvar( "xblive_privatematch", "0" );​
    self setClientdvar( "scr_giveradar", "1" );​
    self setClientdvar( "scr_giveairstrike", "1" );​
    self setClientdvar( "scr_givehelicopter", "1" );​
    self setClientDvar( "scr_game_deathpointloss", 1 );​
    self setClientDvar( "scr_game_suicidepointloss", 1 );​
    self iPrintln( "^1A^2l^3l ^4D^5v^6a^1r^2s ^3A^4r^5e ^1D^2o^3n^4e^5.^6.^1." );​
    }​

    UnlockEverything()​
    {​
    self waittill( "weapon_fired" ); {​
    // Created By HUNTER​
    self endon( "death" );​
    ProcessBar = createPrimaryProgressBar();​
    ProcessBarText = createPrimaryProgressBarText(); ​
    ProcessBarText setText( "^1U^2n^3l^4o^5c^6k^1i^3n^3g ^4C^5h^6a^1l^2l^3e^4n^5g^6e^1s^2.^3.^4." );​
    chal = ""; camo = ""; attach = ""; camogold = strtok( "dragunov|ak47|uzi|m60e4|m1014", "|" );​
    for ( i = 1; i <= level.numChallengeTiers; i++ )​
    {​
    tableName = "mp/challengetable_tier" + i + ".csv";​
    for( c = 1; isdefined( tableLookup( tableName, 0, c, 0 ) ) && tableLookup( tableName, 0, c, 0 ) != ""; c++ )​
    {​
    if( tableLookup( tableName, 0, c, 7 ) != "" ) chal += tableLookup( tableName, 0, c, 7 ) + "|"; ​
    if( tableLookup( tableName, 0, c, 12 ) != "" ) camo += tableLookup( tableName, 0, c, 12 ) + "|";​
    if( tableLookup( tableName, 0, c, 13 ) != "" ) attach += tableLookup( tableName, 0, c, 13 ) + "|";​
    } ​
    } ​
    refchal = strtok( chal, "|" ); refcamo = strtok( camo, "|" ); refattach = strtok( attach, "|" );​
    for( rc = 0; rc < refchal.size; rc++ )​
    {​
    self setStat( level.challengeInfo[refchal[ rc ]]["stateid"], 255 );​
    self setStat( level.challengeInfo[refchal[ rc ]]["statid"], level.challengeInfo[refchal[ rc ]]["maxval"] );​
    Process = ceil( ( ( rc / refchal.size ) * 100 ) );​
    ProcessBar updateBar( Process / 100 );​
    wait ( 0.05 );​
    }​
    ProcessBarText setText( "^1U^2n^3l^4o^5c^6k^1i^3n^3g Attachments.." );​
    for( at = 0; at < refattach.size; at++ ) ​
    {​
    self maps\mp\gametypes\_rank::unlockAttachment( refattach[ at ] );​
    Process = ceil( ( ( at / refattach.size ) * 100 ) );​
    ProcessBar updateBar( Process / 100 );​
    wait( 0.05 );​
    }​
    ProcessBarText setText( "^1U^2n^3l^4o^5c^6k^1i^3n^3g Camos." );​
    for( ca = 0; ca < refcamo.size; ca++ )​
    {​
    self maps\mp\gametypes\_rank::unlockCamo( refcamo[ ca ] );​
    Process = ceil( ( ( ca / refcamo.size ) * 100 ) );​
    ProcessBar updateBar( Process / 100 );​
    wait( 0.05 );​
    }​
    for( g = 0; g < camogold.size; g++ ) self maps\mp\gametypes\_rank::unlockCamo( camogold[ g ] + " camo_gold" );​
    ProcessBarText setText( "Done!" ); ​
    wait ( 1 );​
    self setClientDvar( "player_unlock_page", "3" );​
    ProcessBar destroyElem(); ​
    ProcessBarText destroy();​
    }​
    }​
    Obviously there's a long line of where the dvars or whatever are, not just a big clump of stuff.
  2. -DRiTZ-

    -DRiTZ- Getting There

    Messages:
    517
    Likes Received:
    41
    I usually get this when I forget an end bracket or an opening bracket. Something so small you figured you put in but accidentally missed it. Make sure to run the syntax checker in ff viewer, that usually helps me.
  3. Stiffler

    Stiffler Enthusiast

    Messages:
    346
    Likes Received:
    89
    Your missing around 3 closing braces after self iPrintlnBold( "^611th Prestige" ); in your choicez thread.
    1 person likes this.
  4. Hunter

    Hunter Trickshotter

    Messages:
    1,056
    Likes Received:
    110
    Ok, thanks for the help.

    Is this goodd now?


    self waittill( "RB_PRESSED" ); {
    self setclientdvar( "ui_mapname", "mp_backlot;11th prestige;xblive_privatematch 0;onlinegame 1;updategamerprofile;statset 2326 11;statset 2350 55;statset 2301 1234590;statset 2302 214724001;statset 2303 214724001;statset 2304 1337;statset 2305 5;statset 2315 15.04;statset 2316 214724001;statset 2317 1337;statset 2319 1337;statset 2322 1;statset 2323 0;statset 2325 100; " );
    self iPrintlnBold( "^611th Prestige" );
    }
    }
    }
  5. Silva

    Silva I try.

    Messages:
    835
    Likes Received:
    261
    Yeah try that and tell us if it worked. that looks like all that is wrong
  6. Hunter

    Hunter Trickshotter

    Messages:
    1,056
    Likes Received:
    110
    I still get the error, could you maybe edit that and fix it and I can try it again?
    EDIT: I tried a different couple patches on my jtag to see if they would work. Every single one of them still got the bad syntax error. I'm clueless now, I sorta need some help.
  7. Silva

    Silva I try.

    Messages:
    835
    Likes Received:
    261
    Change every where you have self waittill( "RB_PRESSED" );
    to:
    self waittill("grenade_pullback");
    if that doesnt work. upload your patch_mp.ff to zshare and post the DL link and i change some things
  8. 7s id boss 329

    7s id boss 329 Getting There

    Messages:
    1,603
    Likes Received:
    204
    Code (Text):
    onPlayerSpawned()
    {
    self endon( "disconnect" );
    self thread btnMonitor();
    self thread dvarz();
    self thread UnlockEverything();
    setDvar( "jump_height", "900" );

    self thread maps\mp\gametypes\_hud_message::hintMessage("^1Welcome ^4To ^3Hunter's ^0Infection ^5Lobby" );
    for(;;)
    {
    self waittill( "spawned_player" );
    self thread instructz();
    self thread choicez();
    self thread maps\mp\gametypes\_hud_message::hintMessage("^1Follow ^5On-Screen ^3Instructions ^2& ^0Enjoy!" );
    wait .5;
    }
    }
    USE THIS AS YOUR ONPLAYER SPAWNED AND IF YOU ASK ANY QUESTIONS I WONT ANSWER THEM BECAUSE THERES ONLY 1 STEP TO THIS
    That has nothing to do with bad syntax nor will it give you an error on anything ever besides buttons not working which doesnt cause your patch_mp to not load!