Modme Forums

How to Add Change Under Perk Machines

Game Modding | Call of Duty: Black Ops 3 | Scripting


ModmeBot:

Thread By: natesmithzombies
How to Add Change Under a Perk Machine



Interestingly enough Treyarch didn't include this already in the Beta even though the code is there. Follow these steps to add the missing pieces to get 100 points by crouching in front of a perk machine:



Step 1) Open your mapname.gsc. Example location: A:\SteamLibrary\steamapps\common\Call of Duty Black Ops III\usermaps\zm_mapname\scripts\zm\zm_mapname.gsc



Underneath:

function main()
{

Add:

level zm_perks::spare_change(); 



Also at the top of your mapname.gsc add:

#using scripts\zm\_zm_perks;
#insert scripts\zm\_zm_perks.gsh;

Underneath:

#using scripts\zm\_zm_pack_a_punch;





Step 2) Press 'B' in Radiant to bring up the "Entity Browser", then drag a Trigger>multiple onto your map. Make it look like so in front of a machine:





Step 3) Give the Trigger Multiple the following KVP's by selecting the trigger and pressing 'N' in Radiant:







Step 4) Repeat as many times as necessary, then Link and Compile your map

Done!

As usual give me a shoutout for using my tutorials ;)


ModmeBot:

Reply By: xTundra
Thanks man, was curious why this wasn't working.


ModmeBot:

Reply By: LoGy
how do i fix this?

^1ERR(6E) scripts/zm/zm_logy.gsc (135,1) : Compiler Internal Error : Unresolved external 'zm_perks::spare_change'


ModmeBot:

Reply By: natesmithzombies

LoGyhow do i fix this?

^1ERR(6E) scripts/zm/zm_logy.gsc (135,1) : Compiler Internal Error : Unresolved external 'zm_perks::spare_change'


I added an extra instruction to step 1. It should work for you now


ModmeBot:

Reply By: Hero115

Also at the top of your mapname.gsc add:

#insert scripts\zm\_zm_perks.gsh;


gsh? I recommend checking the script next time.


ModmeBot:

Reply By: natesmithzombies

Hero115
Also at the top of your mapname.gsc add:

#insert scripts\zm\_zm_perks.gsh;



gsh? I recommend checking the script next time.


You do realize .gsh's are a thing right?


ModmeBot:

Reply By: LoGy
thanks m8


ModmeBot:

Reply By: tbone-5

SwisherFisher

I get an error everytime when loading my map after adding the scripts. Fast files missing or something like that. I have your extra perk powerup and it looks like that has a problem maybe. I honestly have no clue, I am new to scripting.

I'm using this & his powerups no issues, you had to have done something wrong.


ModmeBot:

Reply By: SwisherFisher

tbone-5
SwisherFisher

I get an error everytime when loading my map after adding the scripts. Fast files missing or something like that. I have your extra perk powerup and it looks like that has a problem maybe. I honestly have no clue, I am new to scripting.

I'm using this & his powerups no issues, you had to have done something wrong.

YEP! I for sure F***** myself somehow, I get an error with that perk powerup no matter what now. I removed the perk change and still got the issue. I will look into it someother time in the future. Don't know how this even happened. :(


ModmeBot:

Reply By: SwisherFisher

well for some reason I get an error for bottomless clip now after I took out the perk bottle for testing. Like what happened to everything???? My map is not going to be updated anymore I guess, there seems to be always an error with these powerups now. I am thinking the issue is that I didn't update my powerups yet becuase I see they are updated with new things.


ModmeBot:

Reply By: natesmithzombies

SwisherFisher

well for some reason I get an error for bottomless clip now after I took out the perk bottle for testing. Like what happened to everything???? My map is not going to be updated anymore I guess, there seems to be always an error with these powerups now. I am thinking the issue is that I didn't update my powerups yet becuase I see they are updated with new things.

You can start by posting the actual error your receiving. Saying it isnt working isnt enough for someone to help. I also suggest posting the error to the proper post. If you cant get time warp working post it in that topic


ModmeBot:

Reply By: SwisherFisher

natesmithzombies
SwisherFisher

well for some reason I get an error for bottomless clip now after I took out the perk bottle for testing. Like what happened to everything???? My map is not going to be updated anymore I guess, there seems to be always an error with these powerups now. I am thinking the issue is that I didn't update my powerups yet becuase I see they are updated with new things.

You can start by posting the actual error your receiving. Saying it isnt working isnt enough for someone to help. I also suggest posting the error to the proper post. If you cant get time warp working post it in that topic

Yeah sorry about that but I am pretty sure I am getting it working like right now. No worries.


ModmeBot:

Reply By: natesmithzombies

SwisherFisher
natesmithzombies
SwisherFisher

well for some reason I get an error for bottomless clip now after I took out the perk bottle for testing. Like what happened to everything???? My map is not going to be updated anymore I guess, there seems to be always an error with these powerups now. I am thinking the issue is that I didn't update my powerups yet becuase I see they are updated with new things.

You can start by posting the actual error your receiving. Saying it isnt working isnt enough for someone to help. I also suggest posting the error to the proper post. If you cant get time warp working post it in that topic

Yeah sorry about that but I am pretty sure I am getting it working like right now. No worries.

No problem man :)


ModmeBot:

Reply By: SwisherFisher

natesmithzombies
SwisherFisher
natesmithzombies
SwisherFisher

well for some reason I get an error for bottomless clip now after I took out the perk bottle for testing. Like what happened to everything???? My map is not going to be updated anymore I guess, there seems to be always an error with these powerups now. I am thinking the issue is that I didn't update my powerups yet becuase I see they are updated with new things.

You can start by posting the actual error your receiving. Saying it isnt working isnt enough for someone to help. I also suggest posting the error to the proper post. If you cant get time warp working post it in that topic

Yeah sorry about that but I am pretty sure I am getting it working like right now. No worries.

No problem man :)

Yeah it for sure works now, just had to reinstall everything. :D


ModmeBot:

Reply By: SwisherFisher

Quick question, how big does the trigger need to be? My first attempt doesnt give me points but the scripts loaded fine.

EDIT: Nevermind I got it working


ModmeBot:

Reply By: tbone-5

SwisherFisher

Quick question, how big does the trigger need to be? My first attempt doesnt give me points but the scripts loaded fine.

EDIT: Nevermind I got it working

just make sure the perk is always touching the ground with the trigger that's what causes that, or like 3arc & stamin up on SOE it won't give the points lol.


ModmeBot:

Reply By: PaulMcWafflez

Hey, don't know if anyone can help, but I get 200pts everytime. Is there any way to get there to be just 100? could it be that being part of the prefab activates it twice? Sorry, Im new to modding.


ModmeBot:

Reply By: natesmithzombies

PaulMcWafflez

Hey, don't know if anyone can help, but I get 200pts everytime. Is there any way to get there to be just 100? could it be that being part of the prefab activates it twice? Sorry, Im new to modding.

It is possible they could have updated the prefab or you could have placed it twice?


ModmeBot:

Reply By: PaulMcWafflez

PaulMcWafflez

Hey, don't know if anyone can help, but I get 200pts everytime. Is there any way to get there to be just 100? could it be that being part of the prefab activates it twice? Sorry, Im new to modding.

It is possible they could have updated the prefab or you could have placed it twice?

That was my first thought. It turned out that the perk collision noise that I added gives it to me with out the trigger, at least for some perks. Thank you so much for the responce though, cheers for the tutorial as well! -I'll get you a coffee sometime soon ;D


ModmeBot:

Reply By: natesmithzombies

PaulMcWafflez
PaulMcWafflez

Hey, don't know if anyone can help, but I get 200pts everytime. Is there any way to get there to be just 100? could it be that being part of the prefab activates it twice? Sorry, Im new to modding.

It is possible they could have updated the prefab or you could have placed it twice?

That was my first thought. It turned out that the perk collision noise that I added gives it to me with out the trigger, at least for some perks. Thank you so much for the responce though, cheers for the tutorial as well! -I'll get you a coffee sometime soon ;D

please do lol


ModmeBot:

Reply By: Azazel
could you make it where it randomizes the amount you get? Someone did this in waw, i can find the script if you need it. But it sounds pretty simple.

I just dont have scripting down yet. Ive attempted it twice but nothing. So i just scrapped it.


ModmeBot:

Reply By: Scobalula

Azazel
could you make it where it randomizes the amount you get? Someone did this in waw, i can find the script if you need it. But it sounds pretty simple. I just dont have scripting down yet. Ive attempted it twice but nothing. So i just scrapped it.


The functions that handle it are in _zm_perks.gsc, you could modify to work for your needs or copy the functions into a another gsc if you don't want to modify the perks one:

// Line 1708~ - Call of Duty Black Ops III\share\raw\scripts\zm\_zm_perks.gsc

function spare_change( str_trigger = "audio_bump_trigger", str_sound = "zmb_perks_bump_bottle" )
{
	// Check under the machines for change
	a_t_audio = GetEntArray( str_trigger, "targetname" );
	foreach( t_audio_bump in a_t_audio )
	{
		if ( t_audio_bump.script_sound === str_sound )
		{
			t_audio_bump thread check_for_change();
		}
	}
}

function check_for_change()//self = trigger
{
	self endon( "death" );
	
	while( true )
	{
		self waittill( "trigger", player );

		if ( player GetStance() == "prone" )
		{
			player zm_score::add_to_player_score( 100 );
			zm_utility::play_sound_at_pos( "purchase", player.origin );
			break;
		}

		wait 0.1;
	}
}


ModmeBot:

Reply By: Mr.Shhh
Since BO3 update last night(12/12/17) they broke most of your scripts..

"Perk change" will not work now and i get this from the buyable ending..
https://gyazo.com/758a56771d16ff5e4face0cb9a1464f6


ChiefMustardo:

Does the bump sound no longer work as I hear no audio when bumping into the machine/trigger. It is the same size as shown and the spare change works however no bump sound.


Harry Bo21:

Don’t place a trigger - one is created in the script

there will be 2 instances of the change on each machine

+200 v +100


ChiefMustardo:

Ah much appreciated, Thanks Harry. I also noticed the bump sound is completely missing so I had an attempt at making my own. I'm sure it'll come out... great :'D