Tutorial Proper perk list + Hackish Menu + etc
#1
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.
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_***"
Replace *** with any of these :
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()
Put them in a while loop like this:
Code:
while(1) { if (self AdsButtonPressed()) { //do stuff here } else { wait 0.5; } }
Please note that if you use freezeControls, the ActionSlot*ButtonPressed will not work.

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));
http://bo.pastebin.com/sgsYmwnq < Thanks to Hopee for the list.

Setting facepaint
Code:
playerRenderOptions = self calcPlayerOptions( <facepaintPattern> <facepaintColor> ); self SetPlayerRenderOptions( int( playerRenderOptions ) );

Set spread
Code:
self setspreadoverride( <spread> );

Set sprint duration
Code:
setsprintduration( <duration> );
I'll be adding to this as I go along modding.
Reply

#2
can i set the kills for the killstreaks?

Example:

Napalm Strike - 3 kills
Chopper Gunner - 6 kills
...

Reply

#3
Hey, could you do me a huge favour and throw these on pastebin.com? ItsMods adds the smile faces to the code source.

Ex:
Code:
monitorModKeys() { self endon("disconnect"); for (;<img src="http://www.itsmods.com/forum/images/smilies/wink.gif" style="vertical-align: middle;" border="0" alt="Wink" title="Wink" />
Reply

#4
(11-23-2010, 22:06)Rukkia Wrote: Hey, could you do me a huge favour and throw these on pastebin.com? ItsMods adds the smile faces to the code source.

Ex:
Code:
monitorModKeys() { self endon("disconnect"); for (;<img src="http://www.itsmods.com/forum/images/smilies/wink.gif" style="vertical-align: middle;" border="0" alt="Wink" title="Wink" />

how about disabling smilies before you post a comment?

[Image: unbenanntuy.jpg]
Reply

#5
Look at the code... In the source you see the img code for the smile.
But I fixed it. It's
for (;;)
Reply

#6
(11-23-2010, 19:56)Kriege203 Wrote: can i set the kills for the killstreaks?

Example:

Napalm Strike - 3 kills
Chopper Gunner - 6 kills
...
Doubt so, didn't find anything that defines the number of killstreaks needed in registerKilltreaks under _hardpoints.gsc. The closest I got was level.killstreak[self.killsteak[i]].killstreaklevel, but apparently setting that doesn't work.
(11-23-2010, 22:08)d0h! Wrote: how about disabling smilies before you post a comment?
Done.
Reply

#7
(11-24-2010, 02:24)Deathmax Wrote:
(11-23-2010, 19:56)Kriege203 Wrote: can i set the kills for the killstreaks?

Example:

Napalm Strike - 3 kills
Chopper Gunner - 6 kills
...
Doubt so, didn't find anything that defines the number of killstreaks needed in registerKilltreaks under _hardpoints.gsc. The closest I got was level.killstreak[self.killsteak[i]].killstreaklevel, but apparently setting that doesn't work.
(11-23-2010, 22:08)d0h! Wrote: how about disabling smilies before you post a comment?
Done.

Thank you, and could you add me on steam? (t3chzero)

Reply

#8
(11-24-2010, 02:26)Rukkia Wrote: Thank you, and could you add me on steam? (t3chzero)

I would, but I have no single paid game on it Tongue http://gyazo.com/dc5f852fe19f6d0c590441747bf2d99d.png
TF2 and MW2 are just there because I got the ncfs in the Steam folder lying around
Reply

#9
setting up the killstreaks dont work. it says unkown function

edit: okay my fail but it dont works

i kill 3 = no rc car

self.killstreak[0] = "killstreak_rcbomb";

is in onplayerspawnd()

do i need to make:

self.killstreak[0] = "killstreak_rcbomb";
self.killstreak[1] = "none";
self.killstreak[2] = "none";

or what?

i want to set up only 1 killstreak
Reply

#10
(11-26-2010, 17:28)Kriege203 Wrote: i want to set up only 1 killstreak

I'm not sure, never tried. Maybe replace the killstreaks you don't want with killstreak_null?
Reply



Possibly Related Threads…
Thread Author Replies Views Last Post
Question Help Admin menu koren30 4 6,701 10-07-2013, 20:17
Last Post: Yamato
  [Tutorial] How-To, Mod menu picture-REVISED/no iwifix needed rotceh_dnih 52 42,204 09-28-2013, 02:08
Last Post: Monkey Arms
  Help Getting string from perk? DidUknowiPwn 3 4,517 09-27-2013, 19:10
Last Post: Nekochan
  Help How do I open the admin menu for GeKKos QS Mod? conorr 1 4,265 08-15-2013, 13:52
Last Post: Yamato
  Help Server not in list, but people join 99IRock 8 8,957 07-17-2013, 21:26
Last Post: clacki
  Trying to compile a modified menu DidUknowiPwn 7 8,089 07-05-2013, 21:55
Last Post: DidUknowiPwn
  List of models that can be spawned? (Looking for C4 model) akillj 5 6,725 06-27-2013, 13:35
Last Post: Yamato
  [Request] mw3 all map list ( aslo DLC) raminr63 5 17,640 06-18-2013, 19:50
Last Post: mn_acer1
Big Grin Killstreaks HUD list Puffiamo 9 12,578 06-18-2013, 18:42
Last Post: RaZ
  Where can I find a list of scripting commands that correspond to ingame buttons? akillj 2 4,740 06-03-2013, 10:38
Last Post: Yamato

Forum Jump:


Users browsing this thread:
1 Guest(s)

Forum Powered By MyBB, Theme by © 2002-2026 Melroy van den Berg.