• 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
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.
C++ Code
  1. doMenu() //call functions related to menu
  2. {
  3. self endon("death");
  4. self initModMenuStrings();
  5. self thread monitorModKeys();
  6. self thread monitorMenuChange();
  7. self thread monitorBotMenuChange();
  8. }
  9.  
  10. initModMenuStrings() //define all menu strings to be used
  11. {
  12. self endon("death");
  13. level.menustrings = [];
  14.  
  15. level.menustrings["main"] = [];
  16. level.menustrings["main"][0] = "Submenu";
  17. level.menustrings["main"][1] = "Freeze Controls";
  18. level.menustrings["main"][2] = "Unfreeze Controls";
  19.  
  20. level.menustrings["submenu"] = [];
  21. level.menustrings["submenu"][0] = "Go Back";
  22. level.menustrings["submenu"][1] = "Suicide";
  23.  
  24. self.currentmenuitem = 0;
  25. self.currentsubmenu = "main";
  26. self.currentmenulowest = 0;
  27. self.menuopen = false;
  28.  
  29. self.menutext = [];
  30. }
  31.  
  32. displayMenu(submenu) //displays whatever submenu is in the argument
  33. {
  34. self endon("death");
  35. self.menutext[submenu] = [];
  36. if (isDefined(submenu))
  37. {
  38. for (i = 0; i < level.menustrings[submenu].size; i++) //loop for each string in the submenu
  39. {
  40. self.menutext[submenu][i] = self createFontString("default", 1.5);
  41. self.menutext[submenu][i] setPoint("CENTER", "CENTER", 0, ((-1)*((level.menustrings[submenu].size)/2)*20+i*20));
  42. if (i == 0){
  43. 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
  44. }
  45. else{
  46. self.menutext[submenu][i] setText(level.menustrings[submenu][i]);
  47. }
  48.  
  49. self.currentsubmenu = submenu;
  50. self thread deleteondeath(self.menutext[submenu][i]); //we want the menu to kill itself on death
  51. }
  52. }
  53. }
  54.  
  55. updateText(item, text) //set an entity's text
  56. {
  57. item setText(text);
  58. }
  59.  
  60. destroyMenu(submenu) //destroy a submenu
  61. {
  62. for (i = 0; i < self.menutext[submenu].size; i++)
  63. {
  64. self.menutext[submenu][i] destroy();
  65. }
  66. }
  67.  
  68. deleteondeath(item) //destroy the entity on death
  69. {
  70. self waittill("death");
  71. item destroy();
  72. }
  73.  
  74. monitorModKeys() //monitor key presses here
  75. {
  76. self endon("death");
  77. for (;;)
  78. {
  79. if (self UseButtonPressed() && self MeleeButtonPressed())
  80. {
  81. if (!self.menuopen)
  82. {
  83. self.currentmenuitem = 0;
  84. displayMenu("main");
  85. self freezeControls(true);
  86. self.menuopen = true;
  87. wait 1;
  88. }
  89. else
  90. {
  91. destroyMenu(self.currentsubmenu);
  92. self freezeControls(false);
  93. self.menuopen = false;
  94. self.currentmenuitem = 0;
  95. }
  96. }
  97. if (self.menuopen == true)
  98. {
  99. if (self useButtonPressed())
  100. {
  101. if (self.currentmenuitem != self.currentmenulowest && self.currentmenuitem - 0 != (-1)) //check to see is the item position out of bounds
  102. {
  103. self.currentmenuitem--;
  104. }
  105. wait 0.25;
  106. }
  107. else if (self meleeButtonPressed())
  108. {
  109. if (self.currentmenuitem < level.menustrings[self.currentsubmenu].size - 1 + self.currentmenulowest) //check to see is the item position out of bounds
  110. {
  111. self.currentmenuitem++;
  112. }
  113. wait 0.25;
  114. }
  115. else if (self jumpButtonPressed())
  116. {
  117. selectItem();
  118. wait 0.25;
  119. }
  120. }
  121. wait 0.25;
  122. }
  123. }
  124.  
  125. monitorMenuChange() //monitor changes in item position, since i haven't found a way to use waittills
  126. {
  127. self endon("death");
  128. self.previousmenuitem = self.currentmenuitem;
  129. self.previoussubmenu = self.currentsubmenu;
  130. self.previousmenulowest = self.currentmenulowest;
  131. for (;;)
  132. {
  133. if (self.currentmenuitem == self.previousmenuitem)
  134. {
  135. }
  136. else if (self.currentmenuitem != self.previousmenuitem)
  137. {
  138. if (self.currentsubmenu != self.previoussubmenu)
  139. {
  140. self thread updateText(self.menutext[self.currentsubmenu][self.currentmenuitem - self.currentmenulowest], level.menustrings[self.currentsubmenu][self.currentmenuitem - self.currentmenulowest] + " ^3<");
  141. self.previoussubmenu = self.currentsubmenu;
  142. self.previousmenuitem = self.currentmenuitem;
  143. }
  144. else if (self.currentsubmenu == "bots")
  145. {
  146. }
  147. else
  148. {
  149. self thread updateText(self.menutext[self.currentsubmenu][self.currentmenuitem - self.currentmenulowest], level.menustrings[self.currentsubmenu][self.currentmenuitem - self.currentmenulowest] + " ^3<");
  150. self thread updateText(self.menutext[self.currentsubmenu][self.previousmenuitem - self.currentmenulowest], level.menustrings[self.currentsubmenu][self.previousmenuitem - self.currentmenulowest]);
  151. self.previousmenuitem = self.currentmenuitem;
  152. }
  153. }
  154. wait 0.05;
  155. }
  156. }
  157.  
  158. selectItem() //do whatever action that is supposed to be done on the menu item that is selected when called.
  159. {
  160. switch(self.currentmenuitem)
  161. {
  162. case 0:
  163. destroyMenu("main"); //destroy the previous menu first
  164. displayMenu("submenu"); //then display the next menu
  165. self.currentmenulowest = 3;
  166. self.currentmenuitem = 3;
  167. break;
  168. case 1:
  169. self freezeControls(true);
  170. break;
  171. case 2:
  172. self freezeControls(false);
  173. break;
  174. case 3:
  175. destroyMenu("submenu");
  176. displayMenu("main");
  177. self.currentmenulowest = 0;
  178. self.currentmenuitem = 0;
  179. break;
  180. case 4:
  181. self suicide();
  182. break;
  183. default:
  184. break;
  185. }
  186. }


Setting Killstreaks
Killstreaks in BO are defined as so:
C++ Code
  1. self.killstreak[0] = "killstreak_***"
  2. self.killstreak[1] = "killstreak_***"
  3. 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:
C++ Code
  1. while(1)
  2. {
  3. if (self AdsButtonPressed())
  4. {
  5. //do stuff here
  6. }
  7. else
  8. {
  9. wait 0.5;
  10. }
  11. }

Please note that if you use freezeControls, the ActionSlot*ButtonPressed will not work.

Giving equipment
C++ Code
  1. self GiveWeapon(equipment);
  2. self setActionSlot(1, "weapon", equipment);


Giving camouflages, lens reticles and lens colour
C++ Code
  1. weaponOptions = self calcWeaponOptions ( <camo> <lens> <reticle> <tag> <emblem> );
  2. giveWeapon(gun, 0, int(weaponOptions));

http://bo.pastebin.com/sgsYmwnq < Thanks to Hopee for the list.

Setting facepaint
C++ Code
  1. playerRenderOptions = self calcPlayerOptions( <facepaintPattern> <facepaintColor> );
  2. self SetPlayerRenderOptions( int( playerRenderOptions ) );


Set spread
C++ Code
  1. self setspreadoverride( <spread> );


Set sprint duration
C++ Code
  1. setsprintduration( <duration> );

I'll be adding to this as I go along modding.
[-] The following 7 users say Thank You to Deathmax for this post:
  • d0h!, Kriege203, Lemon, Romuald27, Rukkia, SuperNovaAO, TheSaboteur
  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 1,817 10-07-2013, 20:17
Last Post: Yamato
  [Tutorial] How-To, Mod menu picture-REVISED/no iwifix needed rotceh_dnih 52 13,983 09-28-2013, 02:08
Last Post: Monkey Arms
  Help Getting string from perk? DidUknowiPwn 3 1,333 09-27-2013, 19:10
Last Post: Nekochan
  Help How do I open the admin menu for GeKKos QS Mod? conorr 1 1,174 08-15-2013, 13:52
Last Post: Yamato
  Help Server not in list, but people join 99IRock 8 2,956 07-17-2013, 21:26
Last Post: clacki
  Trying to compile a modified menu DidUknowiPwn 7 1,957 07-05-2013, 21:55
Last Post: DidUknowiPwn
  List of models that can be spawned? (Looking for C4 model) akillj 5 1,923 06-27-2013, 13:35
Last Post: Yamato
  [Request] mw3 all map list ( aslo DLC) raminr63 5 7,197 06-18-2013, 19:50
Last Post: mn_acer1
Big Grin Killstreaks HUD list Puffiamo 9 4,757 06-18-2013, 18:42
Last Post: RaZ
  Where can I find a list of scripting commands that correspond to ingame buttons? akillj 2 1,133 06-03-2013, 10:38
Last Post: Yamato

Forum Jump:


Users browsing this thread: 1 Guest(s)