Perk list
EDIT: Since word wrapping screws up the list, heres the raw link : http://pastebin.com/raw.php?i=E23eeMVV
And if you want the raw data I got, http://bo.pastebin.com/DeV55t97
Menu
AFAIK, this code is extremely crap compared to other menus, it scales terribly, and its hard to understand. Commented as much as I can.
Setting Killstreaks
Killstreaks in BO are defined as so:
Replace *** with any of these :
Detecting Key Press
Put them in a while loop like this:
Please note that if you use freezeControls, the ActionSlot*ButtonPressed will not work.
Giving equipment
Giving camouflages, lens reticles and lens colour
http://bo.pastebin.com/sgsYmwnq < Thanks to Hopee for the list.
Setting facepaint
Set spread
Set sprint duration
I'll be adding to this as I go along modding.
EDIT: Since word wrapping screws up the list, heres the raw link : http://pastebin.com/raw.php?i=E23eeMVV
And if you want the raw data I got, http://bo.pastebin.com/DeV55t97
Menu
AFAIK, this code is extremely crap compared to other menus, it scales terribly, and its hard to understand. Commented as much as I can.
Code:
doMenu() //call functions related to menu
{
self endon("death");
self initModMenuStrings();
self thread monitorModKeys();
self thread monitorMenuChange();
self thread monitorBotMenuChange();
}
initModMenuStrings() //define all menu strings to be used
{
self endon("death");
level.menustrings = [];
level.menustrings["main"] = [];
level.menustrings["main"][0] = "Submenu";
level.menustrings["main"][1] = "Freeze Controls";
level.menustrings["main"][2] = "Unfreeze Controls";
level.menustrings["submenu"] = [];
level.menustrings["submenu"][0] = "Go Back";
level.menustrings["submenu"][1] = "Suicide";
self.currentmenuitem = 0;
self.currentsubmenu = "main";
self.currentmenulowest = 0;
self.menuopen = false;
self.menutext = [];
}
displayMenu(submenu) //displays whatever submenu is in the argument
{
self endon("death");
self.menutext[submenu] = [];
if (isDefined(submenu))
{
for (i = 0; i < level.menustrings[submenu].size; i++) //loop for each string in the submenu
{
self.menutext[submenu][i] = self createFontString("default", 1.5);
self.menutext[submenu][i] setPoint("CENTER", "CENTER", 0, ((-1)*((level.menustrings[submenu].size)/2)*20+i*20));
if (i == 0){
self.menutext[submenu][i] setText(level.menustrings[submenu][i] + " ^3<"); //Fixes the issue where there isn't a cursor until it goes to the next one
}
else{
self.menutext[submenu][i] setText(level.menustrings[submenu][i]);
}
self.currentsubmenu = submenu;
self thread deleteondeath(self.menutext[submenu][i]); //we want the menu to kill itself on death
}
}
}
updateText(item, text) //set an entity's text
{
item setText(text);
}
destroyMenu(submenu) //destroy a submenu
{
for (i = 0; i < self.menutext[submenu].size; i++)
{
self.menutext[submenu][i] destroy();
}
}
deleteondeath(item) //destroy the entity on death
{
self waittill("death");
item destroy();
}
monitorModKeys() //monitor key presses here
{
self endon("death");
for (;;)
{
if (self UseButtonPressed() && self MeleeButtonPressed())
{
if (!self.menuopen)
{
self.currentmenuitem = 0;
displayMenu("main");
self freezeControls(true);
self.menuopen = true;
wait 1;
}
else
{
destroyMenu(self.currentsubmenu);
self freezeControls(false);
self.menuopen = false;
self.currentmenuitem = 0;
}
}
if (self.menuopen == true)
{
if (self useButtonPressed())
{
if (self.currentmenuitem != self.currentmenulowest && self.currentmenuitem - 0 != (-1)) //check to see is the item position out of bounds
{
self.currentmenuitem--;
}
wait 0.25;
}
else if (self meleeButtonPressed())
{
if (self.currentmenuitem < level.menustrings[self.currentsubmenu].size - 1 + self.currentmenulowest) //check to see is the item position out of bounds
{
self.currentmenuitem++;
}
wait 0.25;
}
else if (self jumpButtonPressed())
{
selectItem();
wait 0.25;
}
}
wait 0.25;
}
}
monitorMenuChange() //monitor changes in item position, since i haven't found a way to use waittills
{
self endon("death");
self.previousmenuitem = self.currentmenuitem;
self.previoussubmenu = self.currentsubmenu;
self.previousmenulowest = self.currentmenulowest;
for (;;)
{
if (self.currentmenuitem == self.previousmenuitem)
{
}
else if (self.currentmenuitem != self.previousmenuitem)
{
if (self.currentsubmenu != self.previoussubmenu)
{
self thread updateText(self.menutext[self.currentsubmenu][self.currentmenuitem - self.currentmenulowest], level.menustrings[self.currentsubmenu][self.currentmenuitem - self.currentmenulowest] + " ^3<");
self.previoussubmenu = self.currentsubmenu;
self.previousmenuitem = self.currentmenuitem;
}
else if (self.currentsubmenu == "bots")
{
}
else
{
self thread updateText(self.menutext[self.currentsubmenu][self.currentmenuitem - self.currentmenulowest], level.menustrings[self.currentsubmenu][self.currentmenuitem - self.currentmenulowest] + " ^3<");
self thread updateText(self.menutext[self.currentsubmenu][self.previousmenuitem - self.currentmenulowest], level.menustrings[self.currentsubmenu][self.previousmenuitem - self.currentmenulowest]);
self.previousmenuitem = self.currentmenuitem;
}
}
wait 0.05;
}
}
selectItem() //do whatever action that is supposed to be done on the menu item that is selected when called.
{
switch(self.currentmenuitem)
{
case 0:
destroyMenu("main"); //destroy the previous menu first
displayMenu("submenu"); //then display the next menu
self.currentmenulowest = 3;
self.currentmenuitem = 3;
break;
case 1:
self freezeControls(true);
break;
case 2:
self freezeControls(false);
break;
case 3:
destroyMenu("submenu");
displayMenu("main");
self.currentmenulowest = 0;
self.currentmenuitem = 0;
break;
case 4:
self suicide();
break;
default:
break;
}
}Setting Killstreaks
Killstreaks in BO are defined as so:
Code:
self.killstreak[0] = "killstreak_***"
self.killstreak[1] = "killstreak_***"
self.killstreak[2] = "killstreak_***"onikrulz Wrote:Code:3 Kills Spy Plane [killstreak_spyplane] 3 Kills RC-XD (RC bomb) [killstreak_rcbomb] 4 Kills Counter Spy Plane [killstreak_counteruav] 4 Kills SAM Turret [killstreak_tow_turret_drop] 5 Kills Care Package [killstreak_supply_drop] 5 Kills Napalm Strike [killstreak_napalm] 6 Kills Sentry Gun [killstreak_auto_turret_drop] 6 Kills Mortar Team [killstreak_mortar] 7 Kills Attack Helicopter [killstreak_helicopter_comlink] 7 Kills Valkyrie Rockets [killstreak_m220_tow_drop] 8 Kills Blackbird [killstreak_spyplane_direction] 8 Kills Rolling Thunder [killstreak_airstrike] 9 Kills Chopper Gunner [killstreak_helicopter_gunner] 11 Kills Attack Dogs [killstreak_dogs] 11 Kills Gunship [killstreak_helicopter_player_firstperson]
Detecting Key Press
Code:
AdsButtonPressed()
AttackButtonPressed()
MeleeButtonPressed()
UseButtonPressed()
ActionSlotOneButtonPressed()
ActionSlotTwoButtonPressed()
ActionSlotThreeButtonPressed()
ActionSlotFourButtonPressed()
ThrowButtonPressed()
changeSeatButtonPressed()
jumpButtonPressed()
fragButtonPressed()
secondaryOffhandButtonPressed()Code:
while(1)
{
if (self AdsButtonPressed())
{
//do stuff here
}
else
{
wait 0.5;
}
}Giving equipment
Code:
self GiveWeapon(equipment);
self setActionSlot(1, "weapon", equipment);Giving camouflages, lens reticles and lens colour
Code:
weaponOptions = self calcWeaponOptions ( <camo> <lens> <reticle> <tag> <emblem> );
giveWeapon(gun, 0, int(weaponOptions));Setting facepaint
Code:
playerRenderOptions = self calcPlayerOptions( <facepaintPattern> <facepaintColor> );
self SetPlayerRenderOptions( int( playerRenderOptions ) );Set spread
Code:
self setspreadoverride( <spread> );Set sprint duration
Code:
setsprintduration( <duration> );
