Modme Forums
Menu:

Randomize Start Weapon/Points/Perk Limit

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


ModmeBot:

Thread By: TCM
I have not seen this around so I thought I would post it as I was working on my map earlier testing and thought this would be cool to add, Thanks!
If it is posted somewhere else sorry I did not know.


First Open Your mapname.GSC file (Located in usermaps/MAPNAME/scripts/zm/MAPNAME.gsc

Find

zm_usermap::main();

Right below that add this

//Randomize Start Items
thread randomizestartstuff();

Along with this

startingWeapon = array::randomize(level.custom_start_weapon_random)[0];
	weapon = getWeapon(startingWeapon);
	level.start_weapon = (weapon);

Then at the very bottom (Or wherever you like as long as the format is correct)

Place this


function randomizestartstuff()
{
    //Change Perk Limit
    level.PerkLimit = randomIntRange(4,15);
    level.perk_purchase_limit = level.PerkLimit;

    //Change Starting Points
    level.StartPoints = randomIntRange(0,2500);
    level.player_starting_points = level.StartPoints;

     

    //Custom Start Weapon
    level.custom_start_weapon_random = array( "WEAPONNAME", "WEAPONNAME", "WEAPONNAME", "WEAPONNAME", "WEAPONNAME", "WEAPONNAME", "WEAPONNAME" ); 
}



To change the perk limit change this line

level.PerkLimit = randomIntRange(4,15);

Change 4 to the minimum you would like it to be and 15 to the max (Randomizes.)


For start points change

level.StartPoints = randomIntRange(0,2500);

Change 0 to min and 2500 to max points

For weapons change

level.custom_start_weapon_random = array( "WEAPONNAME", "WEAPONNAME", "WEAPONNAME", "WEAPONNAME", "WEAPONNAME", "WEAPONNAME", "WEAPONNAME" ); 

Change weaponname to your name of the weapon you want to use.


ModmeBot:

Reply By: Abnormal202
Would you mind putting your code in code tags?

helps the old eyes.


ModmeBot:

Reply By: TCM

Abnormal202
Would you mind putting your code in code tags? helps the old eyes.



Yes I am sorry I apologize about that.


ModmeBot:

Reply By: TCM

Abnormal202
Would you mind putting your code in code tags? helps the old eyes.

Does that look a bit better?


ModmeBot:

Reply By: Scobalula

TCM
Abnormal202 Would you mind putting your code in code tags? helps the old eyes. Does that look a bit better?


I edited it for you, in future just click the button Abnormal showed, it will bring up a dialogue to paste code into then just press OK.


ModmeBot:

Reply By: TCM

Scobalula
TCM Abnormal202 Would you mind putting your code in code tags? helps the old eyes. Does that look a bit better? I edited it for you, in future just click the button Abnormal showed, it will bring up a dialogue to paste code into then just press OK.


Ok thank you sorry, Is it possible to delete the post that are not nessisary, I also wanted to do the Tutorial TAG but was not sure how.