Modme Forums
Menu:

Brew Perk (Buildable Random Perk)

Game Asset Reversing | Releases


ModmeBot:

Thread By: Idogftw
Idogftw Brew Perk Script

Download Prefab


Step 1: Copy code below


function perk_ee()
{
	level.ingr = 0;
	level.ingrNeed = 3;
	station = GetEnt( "perk_potion", "targetname" );
	bottles_trig = GetEntArray("potion_trig", "targetname");

	station SetHintString("Ingredients Required!");
	station SetCursorHint("HINT_NOICON");
	station UseTriggerRequireLookAt();

	for(i = 0; i < bottles_trig.size; i++)
	{
		bottles_trig[i] thread perk_ee_trig();
		bottles_trig[i] SetHintString("Hold ^3[^1&&1^3] ^7to acquire Ingredient");
		bottles_trig[i] SetCursorHint("HINT_NOICON");
		bottles_trig[i] UseTriggerRequireLookAt();
	}

	thread perk_ee_logic(station);
}

function perk_ee_trig()
{
	self waittill("trigger", player);
	model = GetEnt(self.target, "targetname");
	model Delete();
	self Delete();
	level.ingr++;
}

function perk_ee_logic(station)
{
	while(1)
	{
		if(level.ingr >= level.ingrNeed)
		{
			station SetHintString("Hold ^3[^1&&1^3] ^7to Mix Ingredients");
			station waittill("trigger", player);
			loc = struct::get("perk_drop", "targetname");
			thread zm_powerups::specific_powerup_drop("free_perk", loc.origin);
			station Delete();
			break;	
		}
		wait 0.05;
	}
}

Paste code in mapname.gsc under


function custom_add_weapons()
{
	zm_weapons::load_weapon_spec_from_table("gamedata/weapons/zm/zm_levelcommon_weapons.csv", 1);
}

Step 2: Copy


thread perk_ee();

and Paste Under


level thread zm_zonemgr::manage_zones( init_zones );

Should look like this:


//Setup the levels Zombie Zone Volumes
level.zones = [];
level.zone_manager_init_func =&usermap_test_zone_init;
init_zones[0] = "start_zone";
level thread zm_zonemgr::manage_zones( init_zones );

thread perk_ee();


NOTE: IF YOU DOWNLOADED THE PREFAB ABOVE IGNORE THIS LAST STEP



Step 3: "Radiant"


Create 3 trigger_use (Entity Browser) w/ kvps targetname - potion_trig


Create 3 script_models (Entity Browser) (Recommend being some type of bottle(s))


Target each trigger to a model by clicking the trigger then the model and clicking 'W' should look like a red line connecting them like below.



Next create a script_struct (Entity Browser) and place it where you want the perk to spawn and give the kvps targetname - perk_drop



Lastly, create a new trigger_use (Entity Browser) and give it kvps targetname - perk_potion


This trigger will be where you "Brew" your free random perk.



And then Compile & Link your map and it should be loaded and work like in the video below.






EDIT: If you would like to make it give a specific perk replace perk_ee_logic with this new one:



Replace INSERT_PERK_NAME with a perk name below.
specialty_armorvest - Jug
specialty_quickrevive - Quick Revive
specialty_fastreload - Speed Cola
specialty_doubletap2 - Double Tap 2
specialty_marathon - Stamin Up
specialty_ads - DeadShot
specialty_grenadepulldeath - Electric Cherry
specialty_extraprimaryweapon - Mule Kick
specialty_widows_wine - Widows Wine



function perk_ee_logic(station)
{
	while(1)
	{
		if(level.ingr >= level.ingrNeed)
		{
			station SetHintString("Hold ^3[^1&&1^3] ^7to Mix Ingredients");
			station waittill("trigger", player);
			thread zm_perks::give_perk("INSERT_PERK_NAME" 1);
			station Delete();
			break;	
		}
		wait 0.05;
	}
}


ModmeBot:

Reply By: durtybrown94

thanks!


ModmeBot:

Reply By: Cowman

Works great


ModmeBot:

Reply By: mathfag
Nice.


ModmeBot:

Reply By: XxFluFFyGoaT
Is it possible to make it drop a specific perk? (eg. only makes Jugg)


ModmeBot:

Reply By: durtybrown94

XxFluFFyGoaT
Is it possible to make it drop a specific perk? (eg. only makes Jugg)

I don't think you can with this script, its for "powerup drops" you can change "free_perk" to other drops like "full_ammo" and things like that. I did try to change the code to:

player zm_perks::give_perk( PERK_ADDITIONAL_PRIMARY_WEAPON, loc.origin);

UNRECOVERABLE ERROR:
^1SCRIPT ERROR: No generated data for 'scripts/zm/zm_test.gsc'
ERR(6E) scripts/zm/zm_test.gsc (218,1) : Compiler Internal Error : Uninitialized local variable 'perk_additional_primary_weapon'

and got this error



Linker will now terminate.
********************************************************************************

==================================================
Linker summary:

There were no errors or warnings.

==================================================

^1}
^1^
^1ERR(6E) scripts/zm/zm_test.gsc (218,1) : Compiler Internal Error : Uninitialized local variable 'perk_additional_primary_weapon'


I think i'm on the right track but i am very new to all of this.


ModmeBot:

Reply By: Idogftw

If you would like to make it give a specific perk replace perk_ee_logic with this new one:



Replace INSERT_PERK_NAME with a perk name below.
specialty_armorvest - Jug
specialty_quickrevive - Quick Revive
specialty_fastreload - Speed Cola
specialty_doubletap2 - Double Tap 2
specialty_marathon - Stamin Up
specialty_ads - DeadShot
specialty_grenadepulldeath - Electric Cherry
specialty_extraprimaryweapon - Mule Kick
specialty_widows_wine - Widows Wine



function perk_ee_logic(station)
{
	while(1)
	{
		if(level.ingr >= level.ingrNeed)
		{
			station SetHintString("Hold ^3[^1&&1^3] ^7to Mix Ingredients");
			station waittill("trigger", player);
			thread zm_perks::give_perk("INSERT_PERK_NAME" 1);
			station Delete();
			break;	
		}
		wait 0.05;
	}
}


ModmeBot:

Reply By: Zynx
so dank. thx fam.


mrlednor:

is there a way to make this give all perks "perkaholic"