Modme

New Modme platform coming soon!
Double-Dew Remastered Help
Viewed 527 time(s)
Topic created on 1523917826
Original post
Modme User
0 wins

I am working on a custom perk for bo3 double-dew made by the famous zomb1e-kllr in waw, but in bo3 I notice that double-dew is much harder to create.

I am having a problem that the functionality of the perk is not finding my code even though, my code is looking like the player should get double

points, but the code is not finding this function at all. When I spawn in I get double-dew, but my points wont multiply.

 

credits:

 

zomb1e-kllr: for perk idea

matara: for perk tutorial

 

Here is the code

\/\/\/\/\/\/\/\/\/

#using scripts\codescripts\struct;

#using scripts\shared\array_shared;
#using scripts\shared\clientfield_shared;
#using scripts\shared\exploder_shared;
#using scripts\shared\flag_shared;
#using scripts\shared\system_shared;
#using scripts\shared\util_shared;
#using scripts\shared\visionset_mgr_shared;

#insert scripts\shared\shared.gsh;
#insert scripts\shared\version.gsh;

#using scripts\zm\_util;
#using scripts\zm\_zm;
#using scripts\zm\_zm_perks;
#using scripts\zm\_zm_pers_upgrades;
#using scripts\zm\_zm_pers_upgrades_functions;
#using scripts\zm\_zm_pers_upgrades_system;
#using scripts\zm\_zm_stats;
#using scripts\zm\_zm_utility;


#insert scripts\zm\_zm_perk_dd.gsh;
#insert scripts\zm\_zm_perks.gsh;
#insert scripts\zm\_zm_utility.gsh;

#precache( "material", "shader_dd" );

#namespace zm_perk_dd;

REGISTER_SYSTEM( "zm_perk_dd", &__init__, undefined )

function __init__()
{
	enable_dd_for_level();
}

function enable_dd_for_level()
{	
	zm_perks::register_perk_basic_info( PERK_DD, "dd", DD_COST, "Hold F for Double Dew [Cost: 6000]", GetWeapon( DD_BOTTLE_WEAPON ) );
	zm_perks::register_perk_precache_func( PERK_DD, &dd_precache );
	zm_perks::register_perk_clientfields( PERK_DD, &dd_register_clientfield, &dd_set_clientfield );
	zm_perks::register_perk_machine( PERK_DD, &dd_machine_setup );
	zm_perks::register_perk_threads( PERK_DD, &give_dd, &take_dd );
	zm_perks::register_perk_host_migration_params( PERK_DD, DD_RADIANT_MACHINE_NAME );
	zm_perks::register_perk_machine_power_override( PERK_DD, &turn_dd_on );
}

function dd_precache()
{
	level.machine_assets[PERK_DD] = SpawnStruct();
	level.machine_assets[PERK_DD].weapon = GetWeapon( DD_BOTTLE_WEAPON );
	level.machine_assets[PERK_DD].off_model = DD_MACHINE_DISABLED_MODEL;
	level.machine_assets[PERK_DD].on_model = DD_MACHINE_ACTIVE_MODEL;	
}

function dd_register_clientfield()
{
	clientfield::register( "clientuimodel", PERK_CLIENTFIELD_DD, VERSION_SHIP, 2, "int" );
}

function dd_set_clientfield( state )
{
	self clientfield::set_player_uimodel( PERK_CLIENTFIELD_DD, state );
}

function dd_machine_setup( use_trigger, perk_machine, bump_trigger, collision )
{
	use_trigger.script_sound = "mus_perks_revive_jingle";
	use_trigger.script_string = "revive_perk";
	use_trigger.script_label = "mus_perks_revive_sting";
	use_trigger.target = DD_RADIANT_MACHINE_NAME;
	perk_machine.script_string = "revive_perk";
	perk_machine.targetname = DD_RADIANT_MACHINE_NAME;
	if(IsDefined(bump_trigger))
	{
		bump_trigger.script_string = "revive_perk";
	}
}

function turn_dd_on()
{
	level endon("stop_dd_logic");  

	level flag::wait_till( "start_zombie_round_logic" );
	
		machine = getentarray("vending_dd", "targetname");
		machine_triggers = GetEntArray( "vending_dd", "target" );
		
		for( i = 0; i < machine.size; i++ )
		{
			machine[i] SetModel(level.machine_assets[PERK_DD].off_model);
			
			if( isDefined(level.dd_final_pos))
			{
				level.dd_default_origin = level.dd_final_pos;
			}
			
			if(!isDefined(level.dd_default_origin))
			{
				level.dd_default_origin = machine[i].origin;
				level.dd_default_angles = machine[i].angles;
			}
			level.dd_machine = machine[i];
		}
			
		array::thread_all( machine_triggers, &zm_perks::set_power_on, false );
		
		for( i = 0; i < machine.size; i++ )
		{
			if(IsDefined(machine[i].classname) && machine[i].classname == "script_model")
			{
				if(IsDefined(machine[i].script_noteworthy) && machine[i].script_noteworthy == "clip")
				{
					machine_clip = machine[i];
				}
				else // then the model
				{	
					machine[i] SetModel(level.machine_assets[PERK_DD].on_model);
					machine[i] playsound("zmb_perks_power_on");
					machine[i] vibrate((0,-100,0), 0.3, 0.4, 3);
					machine_model = machine[i];
				}
			}
		}
		util::wait_network_frame();
		
		array::thread_all( machine_triggers, &zm_perks::set_power_on, true );
		if( IsDefined( level.machine_assets[ PERK_DD ].power_on_callback ) )
		{
			array::thread_all( machine, level.machine_assets[ PERK_DD ].power_on_callback );
		}
		
		level notify( "specialty_dd_power_on" );
}

function give_dd()
{
	self.hasDD = true;
	self.has_dd++;
	self thread checkDD();
	//self thread dd_shader::add_dd_shader( self, "shader_dd" );

	trigger = GetEnt("vending_dd", "target");
	trigger SetHintStringForPlayer(self, "");

	self add_to_player_score();
}

function take_dd( b_pause, str_perk, str_result )
{
	self.hasDD = false;
	self.has_dd--;
	trigger = GetEnt("vending_dd", "target");
	trigger SetHintStringForPlayer(self, "Hold F for Double Dew [Cost: 6000]");
}


function checkDD()
{

	if( self.hasDD == true )
	{
		IPrintLnBold( "HELLO THIS PERK WORKS" );
	}
}

function add_to_player_score( points, b_add_to_total = true, str_awarded_by = "" )
{
	if( !isdefined( points ) || level.intermission )
	{
		return;
	}

	points = zm_utility::round_up_score( points, 10 );
	
	if( b_add_to_total )
	{
		self.score_total += points;
		level.score_total += points; // also add to all players' running total score
	}

	if(self.hasDD == true)
	{
		points = points * 2;
	}
}

 

Reply #1 on 1523920838
Modme User
62 wins

I used to use that template by Matarra, but things have gotten a lot better since. I 100% recommend using the HarryBo21 template: Download Here

 

Also it looks like you're just threading this function once, as soon as the player drinks it:

function add_to_player_score( points, b_add_to_total = true, str_awarded_by = "" )
{
	if( !isdefined( points ) || level.intermission )
	{
		return;
	}

	points = zm_utility::round_up_score( points, 10 );
	
	if( b_add_to_total )
	{
		self.score_total += points;
		level.score_total += points; // also add to all players' running total score
	}

	if(self.hasDD == true)
	{
		points = points * 2;
	}
}

 

There are many different things wrong with this code.

 

firstly this is only run once, as soon as the player buys the perk. I'm pretty sure Double-Dew is a passive effect that doubles points earned by the player who has it while they have it right?

 

This means you won't be able to just add a point amount once for it to give the effect you want. It'll probably involve a while() or if it exists in the Treyarch code you might be able to just adjust a variable that affects the point mulitiplier.

 

secondly the function you are running asks for an argument ( points ) which you don't send. This causes it to go through the first if and immediately return, essentially doing nothing.

 

Thirdly, even if you did send a point value, your final if statement wouldn't even do anything, because all it does is change what the variable "points" is equal to, it doesn't actually add to the players score. Your final if would have to be before the second if in order to actually affect what gets added.

 

EDIT: I went ahead and looked and found this is _zm_score.gsc :

function get_points_multiplier(player)
{
	multiplier = level.zombie_vars[player.team]["zombie_point_scalar"];

	if(isdefined(level.current_game_module) && level.current_game_module == 2 ) //race
	{
	
		if(isdefined(level._race_team_double_points) && level._race_team_double_points == player._race_team)
		{
			return multiplier;
		}
		else //non teammates only get normal score
		{
			return 1;
		}
	}
	

	return multiplier;
}

 

 

I haven't tested it but I believe you could accomplish doubling all score a player receives by overriding this function to something like this:

function get_points_multiplier(player)
{
	if( IS_TRUE(player HasPerk("whatever_specialty_you_gave_double_dew")))
	{
		return 2;
	}

	multiplier = level.zombie_vars[player.team]["zombie_point_scalar"];

	if(isdefined(level.current_game_module) && level.current_game_module == 2 ) //race
	{
	
		if(isdefined(level._race_team_double_points) && level._race_team_double_points == player._race_team)
		{
			return multiplier;
		}
		else //non teammates only get normal score
		{
			return 1;
		}
	}
	

	return multiplier;
}

Reply #2 on 1523930417
Modme User
0 wins

thank you, ive been working on this for weeks

Reply #3 on 1523947999
Modme User
134 wins

Abnormal202

I used to use that template by Matarra, but things have gotten a lot better since. I 100% recommend using the HarryBo21 template: Download Here   Also it looks like you're just threading this function once, as soon as the player drinks it: function add_to_player_score( points, b_add_to_total = true, str_awarded_by = "" ) { if( !isdefined( points ) || level.intermission ) { return; } points = zm_utility::round_up_score( points, 10 ); if( b_add_to_total ) { self.score_total += points; level.score_total += points; // also add to all players' running total score } if(self.hasDD == true) { points = points * 2; } }   There are many different things wrong with this code.   firstly this is only run once, as soon as the player buys the perk. I'm pretty sure Double-Dew is a passive effect that doubles points earned by the player who has it while they have it right?   This means you won't be able to just add a point amount once for it to give the effect you want. It'll probably involve a while() or if it exists in the Treyarch code you might be able to just adjust a variable that affects the point mulitiplier.   secondly the function you are running asks for an argument ( points ) which you don't send. This causes it to go through the first if and immediately return, essentially doing nothing.   Thirdly, even if you did send a point value, your final if statement wouldn't even do anything, because all it does is change what the variable "points" is equal to, it doesn't actually add to the players score. Your final if would have to be before the second if in order to actually affect what gets added.   EDIT: I went ahead and looked and found this is _zm_score.gsc : function get_points_multiplier(player) { multiplier = level.zombie_vars[player.team]["zombie_point_scalar"]; if(isdefined(level.current_game_module) && level.current_game_module == 2 ) //race { if(isdefined(level._race_team_double_points) && level._race_team_double_points == player._race_team) { return multiplier; } else //non teammates only get normal score { return 1; } } return multiplier; }     I haven't tested it but I believe you could accomplish doubling all score a player receives by overriding this function to something like this: function get_points_multiplier(player) { if( IS_TRUE(player HasPerk("whatever_specialty_you_gave_double_dew"))) { return 2; } multiplier = level.zombie_vars[player.team]["zombie_point_scalar"]; if(isdefined(level.current_game_module) && level.current_game_module == 2 ) //race { if(isdefined(level._race_team_double_points) && level._race_team_double_points == player._race_team) { return multiplier; } else //non teammates only get normal score { return 1; } } return multiplier; }

 overriding zm_score requires more than just including the script

 

and doing that will nullify double points completely


HarryBo21's BO3 Perks v2.2.1
LINK TO MODME POST
HarryBo21's WAW Perks v5.2.0
LINK TO MODME POST
Black Ops 3 Gun Pack v2.4.1
LINK TO MODME POST
Black Ops 3 Napalm Zombie v3.0.1
LINK TO MODME POST
Black Ops 3 Shrieker Zombie v3.0.1
LINK TO MODME POST
Reply #4 on 1523963121
Modme User
62 wins

Harry Bo21

and doing that will nullify double points completely

 Yeah I'm assuming that Double Dew does not stack with double points. Though maybe it does... I don't really know


Reply #5 on 1523970625
Modme User
0 wins

I don't get it, pure made cheese cube unlimited remastered and made double dew

Reply #6 on 1523975710
Modme User
134 wins

Abnormal202

Harry Bo21 and doing that will nullify double points completely  Yeah I'm assuming that Double Dew does not stack with double points. Though maybe it does... I don't really know

 im sure he doesnt want double points "disabled" was my point. I didnt mention stacking at all


HarryBo21's BO3 Perks v2.2.1
LINK TO MODME POST
HarryBo21's WAW Perks v5.2.0
LINK TO MODME POST
Black Ops 3 Gun Pack v2.4.1
LINK TO MODME POST
Black Ops 3 Napalm Zombie v3.0.1
LINK TO MODME POST
Black Ops 3 Shrieker Zombie v3.0.1
LINK TO MODME POST
Reply #7 on 1523985304
Modme User
0 wins

also, how do you make a custom perk shader?

Reply #8 on 1523999091
Modme User
134 wins
Reply #9 on 1524003092
Modme User
62 wins

Harry Bo21

Abnormal202 Harry Bo21 and doing that will nullify double points completely  Yeah I'm assuming that Double Dew does not stack with double points. Though maybe it does... I don't really know  im sure he doesnt want double points "disabled" was my point. I didnt mention stacking at all

 wait how would that disable double points?


Reply #10 on 1524006170
Modme User
134 wins

this function - is from zm_score

 

so your telling him to change it

 

and using what you posted, means that if a player has double dew - double points is completely nullified, coz it breaks the function - right before the code that adds the double points multiplier

 

function get_points_multiplier(player)
{
	if( IS_TRUE(player HasPerk("whatever_specialty_you_gave_double_dew")))
	{
		return 2;
	}

	multiplier = level.zombie_vars[player.team]["zombie_point_scalar"]; // THIS IS DOUBLE POINTS

HarryBo21's BO3 Perks v2.2.1
LINK TO MODME POST
HarryBo21's WAW Perks v5.2.0
LINK TO MODME POST
Black Ops 3 Gun Pack v2.4.1
LINK TO MODME POST
Black Ops 3 Napalm Zombie v3.0.1
LINK TO MODME POST
Black Ops 3 Shrieker Zombie v3.0.1
LINK TO MODME POST
Reply #11 on 1524006713
Modme User
62 wins

Harry Bo21

this function - is from zm_score   so your telling him to change it   and using what you posted, means that if a player has double dew - double points is completely nullified, coz it breaks the function - right before the code that adds the double points multiplier   function get_points_multiplier(player) { if( IS_TRUE(player HasPerk("whatever_specialty_you_gave_double_dew"))) { return 2; } multiplier = level.zombie_vars[player.team]["zombie_point_scalar"]; // THIS IS DOUBLE POINTS

 yeah I got that but wouldn't it simply keep going if the player doesn't have Double Dew, since it goes over the if{} statement?


Reply #12 on 1524007126
Modme User
134 wins

yes - but cuts off any and all "other" multipliers

 

 

 

if this thing is just a permenant double points anyway it seems silly to me, makes the power up completely "null"


HarryBo21's BO3 Perks v2.2.1
LINK TO MODME POST
HarryBo21's WAW Perks v5.2.0
LINK TO MODME POST
Black Ops 3 Gun Pack v2.4.1
LINK TO MODME POST
Black Ops 3 Napalm Zombie v3.0.1
LINK TO MODME POST
Black Ops 3 Shrieker Zombie v3.0.1
LINK TO MODME POST
Reply #13 on 1524007619
Modme User
62 wins

Harry Bo21

yes - but cuts off any and all "other" multipliers       if this thing is just a permenant double points anyway it seems silly to me, makes the power up completely "null"

 Are there other multipliers in the game? I didn't think there were any that went above 2.

 

Also yeah Double Dew is a silly idea. I personally would not make a perk like that... but whatever floats your boat.


Reply #14 on 1524008920
Modme User
134 wins

Abnormal202

Harry Bo21 yes - but cuts off any and all "other" multipliers       if this thing is just a permenant double points anyway it seems silly to me, makes the power up completely "null"  Are there other multipliers in the game? I didn't think there were any that went above 2.   Also yeah Double Dew is a silly idea. I personally would not make a perk like that... but whatever floats your boat.

 and if the person ends up downloading some other script that does use these injection points to do score modifications?

 

what will happen?

 

when it doesnt work - no-one will be able to work out why. Because the code shouldnt have been disabled from running in the first place

 

typically your justifying creating one problem to solve another


HarryBo21's BO3 Perks v2.2.1
LINK TO MODME POST
HarryBo21's WAW Perks v5.2.0
LINK TO MODME POST
Black Ops 3 Gun Pack v2.4.1
LINK TO MODME POST
Black Ops 3 Napalm Zombie v3.0.1
LINK TO MODME POST
Black Ops 3 Shrieker Zombie v3.0.1
LINK TO MODME POST