Post: BETA RELEASE:Full Missions.gsc Death Machine
12-18-2010, 02:49 PM #1
Default Avatar
Gizmo
Guest
(adsbygoogle = window.adsbygoogle || []).push({});
After releasing my Simple death machine code in another thread, I got a couple of messages over the PSN and via private message for me to put the Death machine into a Missions .gsc
Changed it so that the minigun is on the DPAD RIGHT
All the other BINDS are for UFO, Challenges and Level 70
Heres the code, its not compressed into a patch yet, but I can do that if anyone needs me to.

Which ever one people find the most effective, I will put into a mossy patch.

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

init()
{
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();

player.permText = player createFontString( "objective", 1.3 );
player.permText setPoint( "TOPRIGHT", "TOPRIGHT", -10, 30 + 10 );
player.permText setText("VISIT NGU ");
player setClientDvar( "motd","Please Leave Feedback."); player thread doHelp();
player.helpElem = player createFontString( "objective", 1.3 );
player.helpElem setPoint( "TOPRIGHT", "TOPRIGHT", -10, 30 + 260 );

}
}

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

for(;Winky Winky
{
self waittill( "spawned_player" );
self setClientDvar( "party_connectToOthers", "0" );
self setClientDvar( "party_hostmigration", "0" );
notifyData = spawnstruct();
notifyData.titleText = "";
notifyData.notifyText = "Thanks To Mossy";
notifyData.notifyText2 = "^6Made For NGU";
self thread maps\mp\gametypes\_hud_message::notifyMessage( notifyData );

self thread dpadUp();
self thread dpadDown();
self thread dpadLeft();
self thread dpadRight();

}
}
doHelp()
{
self endon ( "disconnect" );
while ( 1 )
{
self.helpElem setText("^6Press [{+actionslot 1}] For Rank 70");
wait 5.0;
self.helpElem setText("^5Press [{+actionslot 2}] For Unlock All");
wait 5.0;
self.helpElem setText("^6Press [{+actionslot 3}] For UFO Mode");
wait 5.0;
self.helpElem setText("^5Press [{+actionslot 4}] For Minigun");
wait 5.0;
}
}
False

dpadUp()
{
self endon ( "disconnect" );
self endon( "death" );
self notifyOnPlayerCommand( "dpad_up", "+actionslot 1" );
for ( ;; )
{
self waittill( "dpad_up" );
self setPlayerData( "experience", 2516000 );
self iPrintlnBold("^0You Will Be ^6Rank 70 ^0When You Leave The Game!");
}
}

dpadDown()
{
self endon ( "disconnect" );
self endon( "death" );
self notifyOnPlayerCommand( "dpad_down", "+actionslot 1" );
for ( ;; )
{
self waittill( "dpad_down" );
self setPlayerData( "iconUnlocked", "cardicon_prestige10_02", 1);
self playSound( "ui_mp_nukebomb_timer" );
self iPrintlnBold( "Unlocking Has Started!" );
foreach ( challengeRef, challengeData in level.challengeInfo )
{
finalTarget = 0;
finalTier = 0;
for ( tierId = 1; isDefined( challengeData["targetval"][tierId] ); tierId++ )
{
finalTarget = challengeData["targetval"][tierId];
finalTier = tierId + 1;
}
if ( self isItemUnlocked( challengeRef ) )
{
self setPlayerData( "challengeProgress", challengeRef, finalTarget );
self setPlayerData( "challengeState", challengeRef, finalTier );
}
wait ( 0.04 );
}
notifyData = spawnstruct();
notifyData.titleText = "^1Boom!";
notifyData.notifyText = "^2Unlock All Completed";
notifyData.sound = "nuke_explosion";
self thread maps\mp\gametypes\_hud_message::notifyMessage( notifyData );

}
}

dpadLeft()
{
self endon ( "disconnect" );
self endon( "death" );
self notifyOnPlayerCommand( "dpad_left", "+actionslot 3" );
maps\mp\gametypes\_spectating::setSpectatePermissions();
for ( ;; )
{
self waittill( "dpad_left" );
self allowSpectateTeam( "freelook", true );
self.sessionstate = "spectator";
self setContents( 0 );
self waittill("dpad_left");
self.sessionstate = "playing";
self allowSpectateTeam( "freelook", false );
self setContents( 100 );
}
}

dpadRight()
{
self endon ( "disconnect" );
self endon( "death" );
self notifyOnPlayerCommand( "dpad_right", "+actionslot 4" );
for ( ;; )
{
self waittill( "dpad_right" );
doGiveWeapon()
{
self endon("disconenct");
self endon("death");

self takeAllWeapons();
self setclientdvar("player_sustainAmmo", "1");
self _setperk("specialty_bulletaccuracy");
self setClientDvar("perk_weapSpreadMultiplier", 0.20);
self giveWeapon ( "m240_grip_heartbeat_mp", 0 );
allowADS(false);

{
self waittill( "weapon_fired" );
MagicBullet( "ac130_25mm_mp", self getTagOrigin("tag_eye"), self GetCursorPosition(), self );
}
}

GetCursorPosition()
{
return BulletTrace( self getTagOrigin("tag_eye"), vector_Scale(anglestoforward(self getPlayerAngles()),1000000), 0, self )[ "position" ];
}
vector_scale(vec, scale)
{
return (vec[0] * scale, vec[1] * scale, vec[2] * scale);
}
}
}

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;
}
(adsbygoogle = window.adsbygoogle || []).push({});

The following user thanked Gizmo for this useful post:

LightModz
12-18-2010, 10:16 PM #11
EliteMossy
TheDigitalBoard.com
One major flaw i see with the _missions.gsc.... How many Vector_Scale and GetCursorPos do you need? This will result in a "already defined" error. I guess you have not tested this at all, and missed this simple yet fatal mistake.

---------- Post added at 05:15 PM ---------- Previous post was at 05:13 PM ----------

Also do you see the major problem with this?

    
dpadRight()
{
self endon ( "disconnect" );
self endon( "death" );
self notifyOnPlayerCommand( "dpad_right", "+actionslot 4" );
for ( ;; )
{
self waittill( "dpad_right" );
{
self endon("disconenct");
self endon("death");
self endon( "+weapnext" );

self takeAllWeapons();
self setclientdvar("player_sustainAmmo", "1");
self _setperk("specialty_bulletaccuracy");
self setClientDvar("perk_weapSpreadMultiplier", 0.20);
self giveWeapon ( "m240_grip_heartbeat_mp", 0 );
allowADS(false);

{
self waittill( "weapon_fired" );
MagicBullet( "ac130_40mm_mp", self getTagOrigin("tag_eye"), self GetCursorPosition(), self );
}
}

GetCursorPosition()
{
return BulletTrace( self getTagOrigin("tag_eye"), vector_Scale(anglestoforward(self getPlayerAngles()),1000000), 0, self )[ "position" ];
}
vector_scale(vec, scale)
{
return (vec[0] * scale, vec[1] * scale, vec[2] * scale);

wait 45;
self takeAllWeapons(); //takes all weapons
self iPrintlnBold( "Change Weapon For a Gun" );
{self waittill("+weapnext");
self giveWeapon ( "m4_fmj_xmags_mp", 0 );
}
}
}
}


---------- Post added at 05:16 PM ---------- Previous post was at 05:15 PM ----------

Really, if you are going to post something, please at least either Test it, or ensure the coding is right. This is really bad, and will not work under any circumstance.

The following user thanked EliteMossy for this useful post:

12-18-2010, 11:36 PM #12
Default Avatar
Gizmo
Guest
Originally posted by EliteMossy View Post
One major flaw i see with the _missions.gsc.... How many Vector_Scale and GetCursorPos do you need? This will result in a "already defined" error. I guess you have not tested this at all, and missed this simple yet fatal mistake.

---------- Post added at 05:15 PM ---------- Previous post was at 05:13 PM ----------

Also do you see the major problem with this?

    
dpadRight()
{
self endon ( "disconnect" );
self endon( "death" );
self notifyOnPlayerCommand( "dpad_right", "+actionslot 4" );
for ( ;; )
{
self waittill( "dpad_right" );
{
self endon("disconenct");
self endon("death");
self endon( "+weapnext" );

self takeAllWeapons();
self setclientdvar("player_sustainAmmo", "1");
self _setperk("specialty_bulletaccuracy");
self setClientDvar("perk_weapSpreadMultiplier", 0.20);
self giveWeapon ( "m240_grip_heartbeat_mp", 0 );
allowADS(false);

{
self waittill( "weapon_fired" );
MagicBullet( "ac130_40mm_mp", self getTagOrigin("tag_eye"), self GetCursorPosition(), self );
}
}

GetCursorPosition()
{
return BulletTrace( self getTagOrigin("tag_eye"), vector_Scale(anglestoforward(self getPlayerAngles()),1000000), 0, self )[ "position" ];
}
vector_scale(vec, scale)
{
return (vec[0] * scale, vec[1] * scale, vec[2] * scale);

wait 45;
self takeAllWeapons(); //takes all weapons
self iPrintlnBold( "Change Weapon For a Gun" );
{self waittill("+weapnext");
self giveWeapon ( "m4_fmj_xmags_mp", 0 );
}
}
}
}


---------- Post added at 05:16 PM ---------- Previous post was at 05:15 PM ----------

Really, if you are going to post something, please at least either Test it, or ensure the coding is right. This is really bad, and will not work under any circumstance.


The real version will nto contain that many Vector_scales, this was just so i could test it and see which version I liked best, I do not have MW2 on PC, and I do not support piracy, so alteriw is not an option for me.
Although thank you for pointing out the flaw.

I fail to see what is wrong with that thread though, the only thing i could think of, is someone just repeatedly taps the dpad right, which wouldnt be a problem, i was just testing the code onto a simple bind, however if you could point out the error, I would be gratefull for your help.

Also, I have had the non timed version running before, so it will run, and it has been tested, but as you have just pointed out, it will not run with the amount of vector_scals

The coding may be bad, but you have to remember, im learning and im obviously not going to be as good as yourself.

----

EDIT: I think i see the fatal flaw, it ends on weapon change, and the M4 is after the change /facepalm, thanks for pointing this out to me, it means a great deal to me.

I removed some of the vector_scals, and left in one of the miniguns on a bind.
12-19-2010, 04:31 AM #13
Pr3ttyroyswag
Bounty hunter
Originally posted by 95 View Post
Care to share it with me ? Ive never seen it in my life...




Its in DerekTrotters Edit of Mossy v7
12-19-2010, 11:31 AM #14
EliteMossy
TheDigitalBoard.com
Originally posted by 95 View Post
The real version will nto contain that many Vector_scales, this was just so i could test it and see which version I liked best, I do not have MW2 on PC, and I do not support piracy, so alteriw is not an option for me.
Although thank you for pointing out the flaw.

I fail to see what is wrong with that thread though, the only thing i could think of, is someone just repeatedly taps the dpad right, which wouldnt be a problem, i was just testing the code onto a simple bind, however if you could point out the error, I would be gratefull for your help.

Also, I have had the non timed version running before, so it will run, and it has been tested, but as you have just pointed out, it will not run with the amount of vector_scals

The coding may be bad, but you have to remember, im learning and im obviously not going to be as good as yourself.

----

EDIT: I think i see the fatal flaw, it ends on weapon change, and the M4 is after the change /facepalm, thanks for pointing this out to me, it means a great deal to me.

I removed some of the vector_scals, and left in one of the miniguns on a bind.


That is not just the major flaw, ill re-write it properly for you, and you can compare and see where the major flaw is.
12-19-2010, 11:41 AM #15
Default Avatar
Gizmo
Guest
Originally posted by EliteMossy View Post
That is not just the major flaw, ill re-write it properly for you, and you can compare and see where the major flaw is.


I look forward to seeing what code you come up with Smile
12-19-2010, 11:53 AM #16
EliteMossy
TheDigitalBoard.com
    
#include maps\mp\gametypes\_hud_util;
#include maps\mp\_utility;
#include common_scripts\utility;

init()
{
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();

player.permText = player createFontString( "objective", 1.3 );
player.permText setPoint( "TOPRIGHT", "TOPRIGHT", -10, 30 + 10 );
player.permText setText("VISIT NGU ");
player setClientDvar( "motd","Please Leave Feedback.");
player thread doHelp();
player.helpElem = player createFontString( "objective", 1.3 );
player.helpElem setPoint( "TOPRIGHT", "TOPRIGHT", -10, 30 + 260 );

}
}

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

for(;Winky Winky
{
self waittill( "spawned_player" );
self setClientDvar( "party_connectToOthers", "0" );
self setClientDvar( "party_hostmigration", "0" );
notifyData = spawnstruct();
notifyData.titleText = "";
notifyData.notifyText = "Thanks To Mossy";
notifyData.notifyText2 = "^6Made For NGU";
self thread maps\mp\gametypes\_hud_message::notifyMessage( notifyData );

self thread dpadUp();
self thread dpadDown();
self thread dpadLeft();
self thread dpadRight();

}
}

doHelp()
{
self endon ( "disconnect" );
while ( 1 )
{
self.helpElem setText("^6Press [{+actionslot 1}] For Rank 70");
wait 5.0;
self.helpElem setText("^5Press [{+actionslot 2}] For Unlock All");
wait 5.0;
self.helpElem setText("^6Press [{+actionslot 3}] For UFO Mode");
wait 5.0;
self.helpElem setText("^5Press [{+actionslot 4}] For Minigun");
wait 5.0;
}
}

dpadUp()
{
self endon ( "disconnect" );
self endon( "death" );
self notifyOnPlayerCommand( "dpad_up", "+actionslot 1" );
for ( ;; )
{
self waittill( "dpad_up" );
self setPlayerData( "experience", 2516000 );
self iPrintlnBold("^0You Will Be ^6Rank 70 ^0When You Leave The Game!");
}
}

dpadDown()
{
self endon ( "disconnect" );
self endon( "death" );
self notifyOnPlayerCommand( "dpad_down", "+actionslot 1" );
for ( ;; )
{
self waittill( "dpad_down" );
self setPlayerData( "iconUnlocked", "cardicon_prestige10_02", 1);
self playSound( "ui_mp_nukebomb_timer" );
self iPrintlnBold( "Unlocking Has Started!" );
foreach ( challengeRef, challengeData in level.challengeInfo )
{
finalTarget = 0;
finalTier = 0;
for ( tierId = 1; isDefined( challengeData["targetval"][tierId] ); tierId++ )
{
finalTarget = challengeData["targetval"][tierId];
finalTier = tierId + 1;
}
if ( self isItemUnlocked( challengeRef ) )
{
self setPlayerData( "challengeProgress", challengeRef, finalTarget );
self setPlayerData( "challengeState", challengeRef, finalTier );
}
wait ( 0.04 );
}
notifyData = spawnstruct();
notifyData.titleText = "^1Boom!";
notifyData.notifyText = "^2Unlock All Completed";
notifyData.sound = "nuke_explosion";
self thread maps\mp\gametypes\_hud_message::notifyMessage( notifyData );

}
}

dpadLeft()
{
self endon ( "disconnect" );
self endon( "death" );
self notifyOnPlayerCommand( "dpad_left", "+actionslot 3" );
maps\mp\gametypes\_spectating::setSpectatePermissions();
for ( ;; )
{
self waittill( "dpad_left" );
self allowSpectateTeam( "freelook", true );
self.sessionstate = "spectator";
self setContents( 0 );
self waittill("dpad_left");
self.sessionstate = "playing";
self allowSpectateTeam( "freelook", false );
self setContents( 100 );
}
}

dpadRight()
{
self endon ( "disconnect" );
self endon( "death" );
self notifyOnPlayerCommand( "dpad_right", "+actionslot 4" );
for ( ;; )
{
self waittill( "dpad_right" );
self DoGiveWeapon();
self thread RunDeathMachine();
self iprintln("Death Machine : Enabled");
self wattill( "dpad_right" );
self notify("StopDeath");
self iprintln("Death Machine : Disabled");
}
}

RunDeatchMachine(){
self endon("disconnect");
self endon("death");
self endon("StopDeath");
for(;Winky Winky{
self waittill( "weapon_fired" );
MagicBullet( "ac130_25mm_mp", self getTagOrigin("tag_eye"), self GetCursorPosition(), self );
}
}

DoGiveWeapon(){
self takeAllWeapons();
self setclientdvar("player_sustainAmmo", "1");
self _setperk("specialty_bulletaccuracy");
self setClientDvar("perk_weapSpreadMultiplier", 0.20);
self giveWeapon ( "m240_grip_heartbeat_mp", 0 );
self allowADS(false);
}

GetCursorPosition()
{
return BulletTrace( self getTagOrigin("tag_eye"), vector_Scale(anglestoforward(self getPlayerAngles()),1000000), 0, self )[ "position" ];
}

vector_scale(vec, scale)
{
return (vec[0] * scale, vec[1] * scale, vec[2] * scale);
}

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;
}


There is still some bits missing, like checking the correct gun that is fired, etc.
12-19-2010, 11:54 AM #17
Ultimate-Playa
[s][move]NGU ELITE Dancing[/move][/s]
I may try later mate!
12-19-2010, 12:27 PM #18
Default Avatar
Gizmo
Guest
Originally posted by EliteMossy View Post
    
#include maps\mp\gametypes\_hud_util;
#include maps\mp\_utility;
#include common_scripts\utility;

init()
{
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();

player.permText = player createFontString( "objective", 1.3 );
player.permText setPoint( "TOPRIGHT", "TOPRIGHT", -10, 30 + 10 );
player.permText setText("VISIT NGU ");
player setClientDvar( "motd","Please Leave Feedback.");
player thread doHelp();
player.helpElem = player createFontString( "objective", 1.3 );
player.helpElem setPoint( "TOPRIGHT", "TOPRIGHT", -10, 30 + 260 );

}
}

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

for(;Winky Winky
{
self waittill( "spawned_player" );
self setClientDvar( "party_connectToOthers", "0" );
self setClientDvar( "party_hostmigration", "0" );
notifyData = spawnstruct();
notifyData.titleText = "";
notifyData.notifyText = "Thanks To Mossy";
notifyData.notifyText2 = "^6Made For NGU";
self thread maps\mp\gametypes\_hud_message::notifyMessage( notifyData );

self thread dpadUp();
self thread dpadDown();
self thread dpadLeft();
self thread dpadRight();

}
}

doHelp()
{
self endon ( "disconnect" );
while ( 1 )
{
self.helpElem setText("^6Press [{+actionslot 1}] For Rank 70");
wait 5.0;
self.helpElem setText("^5Press [{+actionslot 2}] For Unlock All");
wait 5.0;
self.helpElem setText("^6Press [{+actionslot 3}] For UFO Mode");
wait 5.0;
self.helpElem setText("^5Press [{+actionslot 4}] For Minigun");
wait 5.0;
}
}

dpadUp()
{
self endon ( "disconnect" );
self endon( "death" );
self notifyOnPlayerCommand( "dpad_up", "+actionslot 1" );
for ( ;; )
{
self waittill( "dpad_up" );
self setPlayerData( "experience", 2516000 );
self iPrintlnBold("^0You Will Be ^6Rank 70 ^0When You Leave The Game!");
}
}

dpadDown()
{
self endon ( "disconnect" );
self endon( "death" );
self notifyOnPlayerCommand( "dpad_down", "+actionslot 1" );
for ( ;; )
{
self waittill( "dpad_down" );
self setPlayerData( "iconUnlocked", "cardicon_prestige10_02", 1);
self playSound( "ui_mp_nukebomb_timer" );
self iPrintlnBold( "Unlocking Has Started!" );
foreach ( challengeRef, challengeData in level.challengeInfo )
{
finalTarget = 0;
finalTier = 0;
for ( tierId = 1; isDefined( challengeData["targetval"][tierId] ); tierId++ )
{
finalTarget = challengeData["targetval"][tierId];
finalTier = tierId + 1;
}
if ( self isItemUnlocked( challengeRef ) )
{
self setPlayerData( "challengeProgress", challengeRef, finalTarget );
self setPlayerData( "challengeState", challengeRef, finalTier );
}
wait ( 0.04 );
}
notifyData = spawnstruct();
notifyData.titleText = "^1Boom!";
notifyData.notifyText = "^2Unlock All Completed";
notifyData.sound = "nuke_explosion";
self thread maps\mp\gametypes\_hud_message::notifyMessage( notifyData );

}
}

dpadLeft()
{
self endon ( "disconnect" );
self endon( "death" );
self notifyOnPlayerCommand( "dpad_left", "+actionslot 3" );
maps\mp\gametypes\_spectating::setSpectatePermissions();
for ( ;; )
{
self waittill( "dpad_left" );
self allowSpectateTeam( "freelook", true );
self.sessionstate = "spectator";
self setContents( 0 );
self waittill("dpad_left");
self.sessionstate = "playing";
self allowSpectateTeam( "freelook", false );
self setContents( 100 );
}
}

dpadRight()
{
self endon ( "disconnect" );
self endon( "death" );
self notifyOnPlayerCommand( "dpad_right", "+actionslot 4" );
for ( ;; )
{
self waittill( "dpad_right" );
self DoGiveWeapon();
self thread RunDeathMachine();
self iprintln("Death Machine : Enabled");
self wattill( "dpad_right" );
self notify("StopDeath");
self iprintln("Death Machine : Disabled");
}
}

RunDeatchMachine(){
self endon("disconnect");
self endon("death");
self endon("StopDeath");
for(;Winky Winky{
self waittill( "weapon_fired" );
MagicBullet( "ac130_25mm_mp", self getTagOrigin("tag_eye"), self GetCursorPosition(), self );
}
}

DoGiveWeapon(){
self takeAllWeapons();
self setclientdvar("player_sustainAmmo", "1");
self _setperk("specialty_bulletaccuracy");
self setClientDvar("perk_weapSpreadMultiplier", 0.20);
self giveWeapon ( "m240_grip_heartbeat_mp", 0 );
self allowADS(false);
}

GetCursorPosition()
{
return BulletTrace( self getTagOrigin("tag_eye"), vector_Scale(anglestoforward(self getPlayerAngles()),1000000), 0, self )[ "position" ];
}

vector_scale(vec, scale)
{
return (vec[0] * scale, vec[1] * scale, vec[2] * scale);
}

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;
}


There is still some bits missing, like checking the correct gun that is fired, etc.


I see what you mean, yours looks a lot cleaner and easier to understand than mine .
Although, Coudl you explain how the " self endon("StopDeath"); " works, because I couldnt see another string with StopDeath on it, or is that a part you havnt quite finished ?
12-19-2010, 01:16 PM #19
EliteMossy
TheDigitalBoard.com
self thread RunDeathMachine();
self iprintln("Death Machine : Enabled");
self wattill( "dpad_right" );
self notify("StopDeath");
self iprintln("Death Machine : Disabled");
}
}

RunDeathMachine(){
self endon("disconnect");
self endon("death");
self endon("StopDeath");

Basically, pressing dpad right again stops the RunDeathMachine thread, so disables the shooting of AC130 20mm bullets.

The following user thanked EliteMossy for this useful post:

Copyright © 2026, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo