Release Pointstreaks
#1
Rainbow 
I made this about a week ago. whenever I saw the idea of pointstreaks in MW3 I tought that would be kinda nice to have in a game where nobody plays the objective.

I tought it would be really hard to do and stuff, but after looking tru alot of stuff its actually only 1 simple function... lol.

Code:
#include common_scripts\utility; #include maps\mp\_utility; init() { // the player will recieve a 'point' on one of these events level.pointstreak = array( "capture", "kill_carrier", "plant", "defuse", "destroyer" ); // this will make the script run level.onPlayerScore = ::streakCheck; } streakCheck( event, player, victim ); { if ( !isKillStreaksEnabled() ) return; if( !level.teamBased ) return; // this runs on every EVENT, which means also on a kill, suicide, and every other // time the 'givePlayerScore' function gets called. it only gives a point if it is a valid event isValidPointstreak = false; for( i = 0; i < level.pointstreak.size; i++ ) if( event == level.pointstreak[i] ) isValidPointstreak = true; // give the point if its valid if( isValidPointstreak ) { player.pers[ "cur_kill_streak" ]++; player thread maps\mp\gametypes\_hardpoints::giveKillstreakForStreak(); } // default onPlayerScore stuff maps\mp\gametypes\_globallogic_score::default_onPlayerScore( event, player, victim ); }

just call it on _load.gsc or something
Code:
maps\mp\WHATEVER_YOU_NAMED_IT::init();

Its still untested but I do not have blops installed anymore so I dont feel like installing it just to test, I'm pretty sure it works anyway.

You can add more events to the array, the ones that exist in the game are these:
Code:
capture // captured a: dom point, flag, headquarters kill // killed someone headshot // made a headshot suicide // suicided kill_carrier // killed the flagcarrier= destroyer // destroyed a bombsite defuse // defused a bomb plant // planted a bomb pickup // picked up a ctf flag assault // killed a flag/headquarters defender defend // defended your flag/headquarters melee_kill // melee kill, used in wager matches hatchet_kill // hatchet kill, used in wager matches other_kill // unknown .. used in wager matches death // you died
(08-10-2011, 12:58)Pozzuh Wrote:
Se7en Wrote:Stealed, from cod4 mod ...
look who's talking

[Release] Old School Mod v2.2
[Release] Scroll menu

Reply

#2
Looks good, y u no create mod?
Reply

#3
(10-23-2011, 03:35)jariz Wrote: Looks good, y u no create mod?

coz me no have idea, now test it bitch.
(08-10-2011, 12:58)Pozzuh Wrote:
Se7en Wrote:Stealed, from cod4 mod ...
look who's talking

[Release] Old School Mod v2.2
[Release] Scroll menu

Reply

#4
Nice code, everything seems like it would work, but I can't test it :X
You never restore the killstreak if they die? or does it not reset?

and here's a slight optimization but is my preference only

(10-23-2011, 03:24)iAegle Wrote:
Code:
level.onPlayerScore_old = level.onPlayerScore; level.onPlayerScore = ::streakCheck; //replace maps\mp\gametypes\_globallogic_score::default_onPlayerScore( event, player, victim ); //with thread [[level.onPlayerScore_old]](event, player, victim); //just incase level.onPlayerScore is modified and points to somewhere other than globallogic_score
[Image: b_560_95_1.png]
Reply

#5
(10-23-2011, 04:04)Nukem Wrote: Nice code, everything seems like it would work, but I can't test it :X
You never restore the killstreak if they die? or does it not reset?

and here's a slight optimization but is my preference only

(10-23-2011, 03:24)iAegle Wrote:
Code:
level.onPlayerScore_old = level.onPlayerScore; level.onPlayerScore = ::streakCheck; //replace maps\mp\gametypes\_globallogic_score::default_onPlayerScore( event, player, victim ); //with thread [[level.onPlayerScore_old]](event, player, victim); //just incase level.onPlayerScore is modified and points to somewhere other than globallogic_score
Ieagle uses player.pers[ "cur_kill_streak" ]++ which is already used by the default killstreak system so it should reset when you die.
You still need to put the player.pers[ "cur_kill_streak" ]++ out of player_killed() in globallogic_player.gsc though so that you won't get a killstreak point for both a kill and score (unless you want that of course). Just watch out that you don't have both player.pers[ "cur_kill_streak" ]++ in player_killed() and kill in the array or you'll get two killstreak points for one kill. Tongue
Would like to make a donation? Click here
Reply

#6

Quote:Ieagle

[Image: eaglecl.jpg]
[Image: eagle2g.jpg]

REQUESTING IEAGLE'S NICK CHANGE

Ontopic : Sounds cool, anybody tested it ?
[Image: lQDUjba.jpg]
Reply

#7
(10-23-2011, 09:06)Cyborgking Wrote:
(10-23-2011, 04:04)Nukem Wrote: Nice code, everything seems like it would work, but I can't test it :X
You never restore the killstreak if they die? or does it not reset?

and here's a slight optimization but is my preference only

(10-23-2011, 03:24)iAegle Wrote:
Code:
level.onPlayerScore_old = level.onPlayerScore; level.onPlayerScore = ::streakCheck; //replace maps\mp\gametypes\_globallogic_score::default_onPlayerScore( event, player, victim ); //with thread [[level.onPlayerScore_old]](event, player, victim); //just incase level.onPlayerScore is modified and points to somewhere other than globallogic_score
Ieagle uses player.pers[ "cur_kill_streak" ]++ which is already used by the default killstreak system so it should reset when you die.
You still need to put the player.pers[ "cur_kill_streak" ]++ out of player_killed() in globallogic_player.gsc though so that you won't get a killstreak point for both a kill and score (unless you want that of course). Just watch out that you don't have both player.pers[ "cur_kill_streak" ]++ in player_killed() and kill in the array or you'll get two killstreak points for one kill. Tongue

But you still get a 'point' in mw3 when you kill someone right?

edit:
Just because its nukem and the function will not give any XP/popup when th event is not valid, here's a new one:
Code:
#include common_scripts\utility; #include maps\mp\_utility; init() { level.pointstreak = array( "capture", "kill_carrier", "plant", "defuse", "destroyer" ); level.onPlayerScore_old = level.onPlayerScore; level.onPlayerScore = ::streakCheck; } streakCheck( event, player, victim ) { thread [[level.onPlayerScore_old]]( event, player, victim ); if( !isKillStreaksEnabled() ) return; if( !level.teamBased ) return; isValidPointstreak = false; for( i = 0; i < level.pointstreak.size; i++ ) if( event == level.pointstreak[i] ) isValidPointstreak = true; if( isValidPointstreak ) { player.pers[ "cur_kill_streak" ]++; player thread maps\mp\gametypes\_hardpoints::giveKillstreakForStreak(); } }
(08-10-2011, 12:58)Pozzuh Wrote:
Se7en Wrote:Stealed, from cod4 mod ...
look who's talking

[Release] Old School Mod v2.2
[Release] Scroll menu

Reply

#8
How do this when you want to give self.money to a player, when he does this:

level.pointstreak = array( "capture", "plant", "defuse", "destroyer" );
Black Ops Mods:

RPG(rocket launcher) mod
Get the Specials

Old aliasses:

eliteCVDelite
CVD

Reply



Forum Jump:


Users browsing this thread:
1 Guest(s)

Forum Powered By MyBB, Theme by © 2002-2026 Melroy van den Berg.