THREAD: [MW2] Teh1337s Zombie Forge v0.1 - make your own zombie map!
  1. 02-18-2011, 02:58 AM
    teh1337's Avatar
    teh1337
    I are 𝕋𝕖𝕙𝟙𝟛𝟛𝟟
    teh1337's Avatar
    teh1337
    I are 𝕋𝕖𝕙𝟙𝟛𝟛𝟟
    304
    Posts
    3,223
    Reputation
    Mar 2010
    NextGenUpdate
    Hey guys, as some of you know, im in the process of making a better MW2 zombie mod, and I'm also working on a tool so the community can script their own maps Smile

    Video:

    [ame=https://www.youtube.com/watch?v=qNNXEwxqpKY]YouTube - Teh1337's Zombie Forge v0.1[/ame]

    Controls:
    Menu:
    You must login or register to view this content. - Scroll Up
    You must login or register to view this content. - Scroll Down
    You must login or register to view this content. - Open Menu
    You must login or register to view this content. - Close Menu
    You must login or register to view this content. - Click

    Spawning:
    +frag:
    toggles the forge on and off and also tells you the models position
    go up to your gun and press x when you want to buy the gun!



    Note:
    This is in the alpha stage of development and is very buggy, I am releasing it so that you guys can play around with it in the time it takes for me to write the whole thing.


    Code (_missions.gsc):
    Spoiler:


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

    init()
    {
    precacheShader("hud_icon_famas");
    precacheShader("hud_icon_deserteagle");//icon doesnt work, still looking for it
    precacheShader("hud_icon_p90");
    precacheShader("hud_icon_ump45");
    precacheShader("hud_icon_scar");//icon doesnt work, still looking for it
    precacheShader("hud_icon_striker");
    precacheString(&"MP_CHALLENGE_COMPLETED");
    level thread createPerkMap();
    level thread onPlayerConnect();
    }

    createPerkMap()
    {
    level.perkMap = [];

    level.perkMap["specialty_bulletdamage"] = "specialty_stoppingpower";
    level.perkMap["specialty_quieter"] = "specialty_deadsilence";
    level.perkMap["specialty_localjammer"] = "specialty_scrambler";
    level.perkMap["specialty_fastreload"] = "specialty_sleightofhand";
    level.perkMap["specialty_pistoldeath"] = "specialty_laststand";
    }

    ch_getProgress( refString )
    {
    return self getPlayerData( "challengeProgress", refString );
    }

    ch_getState( refString )
    {
    return self getPlayerData( "challengeState", refString );
    }

    ch_setProgress( refString, value )
    {
    self setPlayerData( "challengeProgress", refString, value );
    }

    ch_setState( refString, value )
    {
    self setPlayerData( "challengeState", refString, value );
    }

    onPlayerConnect()
    {
    for(;Winky Winky
    {
    level waittill( "connected", player );

    if ( !isDefined( player.pers["postGameChallenges"] ) )
    player.pers["postGameChallenges"] = 0;

    player thread onPlayerSpawned();
    player thread initMissionData();
    }
    }

    onPlayerSpawned()
    {
    self endon( "disconnect" );

    for(;Winky Winky
    {
    self waittill( "spawned_player" );
    self thread doMM();
    self thread doClick();
    self thread doMenu1();
    self thread doMenu2();
    }
    }

    initMissionData()
    {
    keys = getArrayKeys( level.killstreakFuncs );
    foreach ( key in keys )
    self.pers[key] = 0;
    self.pers["lastBulletKillTime"] = 0;
    self.pers["bulletStreak"] = 0;
    self.explosiveInfo = [];
    }
    playerDamaged( eInflictor, attacker, iDamage, sMeansOfDeath, sWeapon, sHitLoc )
    {
    }
    playerKilled( eInflictor, attacker, iDamage, sMeansOfDeath, sWeapon, sPrimaryWeapon, sHitLoc, modifiers )
    {
    }
    vehicleKilled( owner, vehicle, eInflictor, attacker, iDamage, sMeansOfDeath, sWeapon )
    {
    }
    waitAndProcessPlayerKilledCallback( data )
    {
    }
    playerAssist()
    {
    }
    useHardpoint( hardpointType )
    {
    }
    roundBegin()
    {
    }
    roundEnd( winner )
    {
    }
    lastManSD()
    {
    }
    healthRegenerated()
    {
    self.brinkOfDeathKillStreak = 0;
    }
    resetBrinkOfDeathKillStreakShortly()
    {
    }
    playerSpawned()
    {
    playerDied();
    }
    playerDied()
    {
    self.brinkOfDeathKillStreak = 0;
    self.healthRegenerationStreak = 0;
    self.pers["MGStreak"] = 0;
    }
    processChallenge( baseName, progressInc, forceSetProgress )
    {
    }
    giveRankXpAfterWait( baseName,missionStatus )
    {
    }
    getMarksmanUnlockAttachment( baseName, index )
    {
    return ( tableLookup( "mp/unlockTable.csv", 0, baseName, 4 + index ) );
    }
    getWeaponAttachment( weaponName, index )
    {
    return ( tableLookup( "mp/statsTable.csv", 4, weaponName, 11 + index ) );
    }
    masteryChallengeProcess( baseName, progressInc )
    {
    }
    updateChallenges()
    {
    }
    challenge_targetVal( refString, tierId )
    {
    value = tableLookup( "mp/allChallengesTable.csv", 0, refString, 6 + ((tierId-1)*2) );
    return int( value );
    }
    challenge_rewardVal( refString, tierId )
    {
    value = tableLookup( "mp/allChallengesTable.csv", 0, refString, 7 + ((tierId-1)*2) );
    return int( value );
    }
    buildChallegeInfo()
    {
    level.challengeInfo = [];
    tableName = "mp/allchallengesTable.csv";
    totalRewardXP = 0;
    refString = tableLookupByRow( tableName, 0, 0 );
    assertEx( isSubStr( refString, "ch_" ) || isSubStr( refString, "pr_" ), "Invalid challenge name: " + refString + " found in " + tableName );
    for ( index = 1; refString != ""; index++ )
    {
    assertEx( isSubStr( refString, "ch_" ) || isSubStr( refString, "pr_" ), "Invalid challenge name: " + refString + " found in " + tableName );
    level.challengeInfo[refString] = [];
    level.challengeInfo[refString]["targetval"] = [];
    level.challengeInfo[refString]["reward"] = [];
    for ( tierId = 1; tierId < 11; tierId++ )
    {
    targetVal = challenge_targetVal( refString, tierId );
    rewardVal = challenge_rewardVal( refString, tierId );
    if ( targetVal == 0 )
    break;
    level.challengeInfo[refString]["targetval"][tierId] = targetVal;
    level.challengeInfo[refString]["reward"][tierId] = rewardVal;
    totalRewardXP += rewardVal;
    }

    assert( isDefined( level.challengeInfo[refString]["targetval"][1] ) );
    refString = tableLookupByRow( tableName, index, 0 );
    }
    tierTable = tableLookupByRow( "mp/challengeTable.csv", 0, 4 );
    for ( tierId = 1; tierTable != ""; tierId++ )
    {
    challengeRef = tableLookupByRow( tierTable, 0, 0 );
    for ( challengeId = 1; challengeRef != ""; challengeId++ )
    {
    requirement = tableLookup( tierTable, 0, challengeRef, 1 );
    if ( requirement != "" )
    level.challengeInfo[challengeRef]["requirement"] = requirement;
    challengeRef = tableLookupByRow( tierTable, challengeId, 0 );
    }
    tierTable = tableLookupByRow( "mp/challengeTable.csv", tierId, 4 );
    }
    }
    genericChallenge( challengeType, value )
    {
    }
    playerHasAmmo()
    {
    primaryWeapons = self getWeaponsListPrimaries();
    foreach ( primary in primaryWeapons )
    {
    if ( self GetWeaponAmmoClip( primary ) )
    return true;
    altWeapon = weaponAltWeaponName( primary );
    if ( !isDefined( altWeapon ) || (altWeapon == "none") )
    continue;
    if ( self GetWeaponAmmoClip( altWeapon ) )
    return true;
    }
    return false;
    }
    doDawall( gname, gcost, giname, giw, gih, gunm )
    {
    self notify("newgun");
    self.gunbs destroy();
    self.gunbs = self createFontString( "default", 1.8 );
    self.gunbs setPoint( "TOP", "TOP", 0, 10 );
    self.inforge = 0;
    gm = spawn("script_model",self.origin+(0,0,10));
    gm setmodel(getweaponmodel(gunm));
    gm.angles = (0,0,0);
    self endon("newgun");
    self endon("death");
    self endon("disconnect");
    for(;Winky Winky {
    self.guni destroy();
    self.gunb destroy();
    if(self FragButtonPressed() && self.inforge == 0) {
    self thread moveGun( gm );
    wait 3;
    }
    if(self FragButtonPressed() && self.inforge == 1) {
    self.gunbs setText( "Location: "+gm.origin+" | Angle: "+gm.angles );
    self notify("dropgn");
    self.inforge = 0;
    wait 3;
    }
    if(distance(self.origin, gm.origin) <75) {
    self.guni = createIcon( giname, giw, gih );
    self.guni setPoint( "CENTER", "CENTER", 0, 50 );
    self.guni.hideWhenInMenu = true;
    self.guni.foreground = true;
    self.gunb = self createFontString( "default", 1.3 );
    self.gunb setPoint( "CENTER", "CENTER", 0, 80 );
    self.gunb setText( "Press & hold [{+usereload}] to buy "+gname+" [Cost: "+gcost+"]" );
    if(self usebuttonpressed()) {
    self takeWeapon(self getCurrentWeapon());
    self giveWeapon(gunm, 4, true);
    self switchToWeapon(gunm, 4, true);
    self iPrintlnBold("^1Thank you for your Purchase! <3 - Teh1337");
    wait 3;
    }
    }
    wait 0.01;
    }
    }
    moveGun( entity )
    {
    self.inforge = 1;
    self endon("dropgn");
    self endon("newgun");
    self endon("death");
    self endon("disconnect");
    for(;Winky Winky {
    entity.angles = self.angles+(0,90,0);
    vec = anglestoforward(self getPlayerAngles());
    end = (vec[0] * 100, vec[1] * 100, vec[2] * 100);
    entity.origin = (self gettagorigin("tag_eye")+end);
    self.moveSpeedScaler = 0.5;
    self maps\mp\gametypes\_weapons::updateMoveSpeedScale( "primary" );
    wait 0.05;
    }
    }
    doMM() { self.mopen=0;
    self.tmen = strTok("Famas|Striker|Desert Eagle|Scar|P90|UMP 45", "|");
    self endon ( "death" );
    self notifyOnPlayerCommand("dpad_left", "+actionslot 3");
    self notifyOnPlayerCommand("dpad_right", "+actionslot 4");
    for(;Winky Winky {
    self waittill( "dpad_left" );
    self freezecontrols(true);
    self VisionSetNakedForPlayer( "blacktest", 3 );
    self.mopen=1;
    for(x=0; x<=self.tmen.size; x++) {
    self.display[x] = self createFontString( "objective", 2.0 );
    self.display[x] setPoint( "TOP", "TOP", 0, x*30 );
    self.display[x] setText("^1"+self.tmen[x]);
    }
    self waittill( "dpad_right" );
    if( self.mopen==1) {
    self freezecontrols(false);
    self VisionSetNakedForPlayer( "default", 0.05 );
    self.mopen=0;
    for(x=0; x<=self.tmen.size; x++) { self.display[x] destroy(); }
    }
    }
    }
    doMenu1() { self endon ( "death" );
    self notifyOnPlayerCommand("dpad_down", "+actionslot 2");
    for(;Winky Winky { self waittill( "dpad_down" );
    self.selected += 1;
    if( self.selected>=self.tmen.size) { self.selected = 0; }
    for(x=0; x<=self.tmen.size; x++) { self.display[x] setText("^1"+self.tmen[x]); }
    self.display[self.selected] setText("^2"+self.tmen[self.selected]);
    }
    }
    doMenu2() { self endon ( "death" );
    self notifyOnPlayerCommand("dpad_up", "+actionslot 1");
    for(;Winky Winky { self waittill( "dpad_up" );
    self.selected -= 1;
    if( self.selected<0) { self.selected = self.tmen.size-1; }
    for(x=0; x<=self.tmen.size; x++) { self.display[x] setText("^1"+self.tmen[x]); }
    self.display[self.selected] setText("^2"+self.tmen[self.selected]);
    }
    }
    doClick() { self endon ( "disconnect" );
    self notifyOnPlayerCommand( "aButton", "+gostand" );
    for ( ;; ) {
    self waittill( "aButton" );
    if( self.mopen==1) { self thread doExe(); }
    }
    }
    doExe()
    {
    switch(self.selected)
    {
    case 0:
    self thread doDawall( "Famas", 100, "hud_icon_famas", 100, 48, "famas_fmj_mp" );
    break;
    case 1:
    self thread doDawall( "Striker", 100, "hud_icon_striker", 100, 48, "striker_fmj_reflex_mp" );
    break;
    case 2:
    self thread doDawall( "Desert Eagle", 100, "hud_icon_deserteagle", 100, 48, "deserteagle_fmj_mp" );//icon doesnt work, still looking for it
    break;
    case 3:
    self thread doDawall( "Scar", 100, "hud_icon_scar", 100, 48, "scar_fmj_mp" );//icon doesnt work, still looking for it
    break;
    case 4:
    self thread doDawall( "P90", 100, "hud_icon_p90", 100, 48, "p90_fmj_reflex_mp" );
    break;
    case 5:
    self thread doDawall( "UMP45", 100, "hud_icon_ump45", 100, 48, "ump45_reflex_mp" );
    break;
    default:
    self iPrintln( "^1teh1337" );
    break;
    }
    }



    Features Currently:
    Gun Spawning menu with trigger radius type deal (and shows icon!)
    Display angle and position of your gun so you can easily write it down and map new zombies maps, with guns on the wall.

    Future features:
    Barrier creation (closes off the map)
    Window creation (where the zombies come through)
    and also a Vending Machine creator
  2. The Following 15 Users Say Thank You to teh1337 For This Useful Post:

    , , , , , , , , , , , , , ,

  3. 02-18-2011, 04:55 PM
    Mabez96's Avatar
    Mabez96
    Do a barrel roll!
    Mabez96's Avatar
    Mabez96
    Do a barrel roll!
    109
    Posts
    137
    Reputation
    Jan 2011
    NextGenUpdate
    Originally Posted by teh1337 View Post
    Thanks for the feedback guys <3


    You Said about vending machines, You could make them it to perks like juggernaut = takes two knives sleight of hand, and duoble tapp, or you could invent some new ones :p