Modme Forums

Placing Perks on a BO3 Base Map (MOD)

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


Sample Text:

Hey All,
I'm currently trying to figure out how to place perks around a BO3 base map. For example, placing Pack-a-Punch in the power room on Verrückt. Does anyone have any input on how to implement something like the example?
Thanks.


zenandpimpy:

I would also like to know how to do this.


Spiki:

open harrys perks and see what he did
any perk gsc


FrostIceforge:

Looking at Harry's PhD script for instance, I see he did this in phdflopper_main:

if ( level.script == "zm_zod" )
        zm_perk_utility::place_perk_machine( ( 3059, -5478, 128 ), ( 0, 90, 0 ), PHDFLOPPER_PERK, PHDFLOPPER_MACHINE_DISABLED_MODEL );
    else if ( level.script == "zm_factory" )
        zm_perk_utility::place_perk_machine( ( -732, -40, 70 ), ( 0, 0, 0 ), PHDFLOPPER_PERK, PHDFLOPPER_MACHINE_DISABLED_MODEL );
//...

In zm_perk_utility, the place_perk_machine function is implemented like this:

function place_perk_machine( origin, angles, perk, model )
{
    t_use = spawn( "trigger_radius_use", origin + ( 0, 0, 60 ), 0, 40, 80 );
    t_use.targetname = "zombie_vending";           
    t_use.script_noteworthy = perk;   
    t_use TriggerIgnoreTeam();
    
    perk_machine = spawn( "script_model", origin );
    if ( !isDefined( angles ) )
        angles = ( 0, 0, 0 );
    
    perk_machine.angles = angles;
    perk_machine setModel( model );
    bump_trigger = spawn( "trigger_radius", origin + ( 0, 0, 30 ), 0, 40, 80 );
    bump_trigger.script_activated = 1;
    bump_trigger.script_sound = "zmb_perks_bump_bottle";
    bump_trigger.targetname = "audio_bump_trigger";
    
    collision = spawn( "script_model", origin, 1 );
    collision.angles = angles;
    collision setModel( "zm_collision_perks1" );
    collision.script_noteworthy = "clip";
    collision disconnectPaths();
    
    t_use.clip = collision;
    t_use.machine = perk_machine;
    t_use.bump = bump_trigger;
    
    [[ level._custom_perks[ perk ].perk_machine_set_kvps ]]( t_use, perk_machine, bump_trigger, collision );
}

Okay, fair enough, but my question to anyone who knows is: how to you get custom scripts like this to run on base maps?


Sample Text:

Looking at Harry's PhD script for instance, I see he did this in phdflopper_main:

if ( level.script == "zm_zod" )
        zm_perk_utility::place_perk_machine( ( 3059, -5478, 128 ), ( 0, 90, 0 ), PHDFLOPPER_PERK, PHDFLOPPER_MACHINE_DISABLED_MODEL );
    else if ( level.script == "zm_factory" )
        zm_perk_utility::place_perk_machine( ( -732, -40, 70 ), ( 0, 0, 0 ), PHDFLOPPER_PERK, PHDFLOPPER_MACHINE_DISABLED_MODEL );
//...

In zm_perk_utility, the place_perk_machine function is implemented like this:

function place_perk_machine( origin, angles, perk, model )
{
    t_use = spawn( "trigger_radius_use", origin + ( 0, 0, 60 ), 0, 40, 80 );
    t_use.targetname = "zombie_vending";          
    t_use.script_noteworthy = perk;  
    t_use TriggerIgnoreTeam();
   
    perk_machine = spawn( "script_model", origin );
    if ( !isDefined( angles ) )
        angles = ( 0, 0, 0 );
   
    perk_machine.angles = angles;
    perk_machine setModel( model );
    bump_trigger = spawn( "trigger_radius", origin + ( 0, 0, 30 ), 0, 40, 80 );
    bump_trigger.script_activated = 1;
    bump_trigger.script_sound = "zmb_perks_bump_bottle";
    bump_trigger.targetname = "audio_bump_trigger";
   
    collision = spawn( "script_model", origin, 1 );
    collision.angles = angles;
    collision setModel( "zm_collision_perks1" );
    collision.script_noteworthy = "clip";
    collision disconnectPaths();
   
    t_use.clip = collision;
    t_use.machine = perk_machine;
    t_use.bump = bump_trigger;
   
    [[ level._custom_perks[ perk ].perk_machine_set_kvps ]]( t_use, perk_machine, bump_trigger, collision );
}

Okay, fair enough, but my question to anyone who knows is: how to you get custom scripts like this to run on base maps?

Hi,
You would just need to add that PHD script to your perk gsc and call it to the zone. The second script for placing the perk would go into a gsc already being used in a map (EX: _zm_powerup_insta_kill.gsc)


Sample Text:

Guys,

I was able to get the perks to work, however, not pack-a-punch. Pack-a-Punch seems to have a different style of implementing. The script noteworthy for harry's script is pack_a_punch, but I cannot find the model to put into his script (His script overall seems to be just for perks, not pap, unless I'm wrong). Does anyone know how to place Pack-a-Punch on a map with origin and angles?

Thanks!


Sample Text:

Here is my attempt in _zm_pack_a_punch.gsc

if ( level.script == "zm_asylum" )
        zm_perks::place_perk_machine( ( 851, 994, 1 ), ( 0, 0, 0 ), pack_a_punch, "I DONT KNOW WHAT MODEL ASSET TO PUT HERE");

The place_perk_machine function is used from Frost's post above

Still cannot get pap to work, it definitely has a different way of scripting things so any help is appreicitated!
Thanks again