Advertisement
Guest User

volt

a guest
Oct 18th, 2008
1,084
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 16.58 KB | None | 0 0
  1. [quote author=ACKMAN link=topic=9351.msg143983#msg143983 date=1224166071]
  2. BTW do you have more tutorials? i'm trying to make a hud but i need more info :D
  3. [/quote]
  4. [quote author=apollo link=topic=9351.msg143617#msg143617 date=1223753702]
  5. I've always wanted to, but somehow never get to. Probably cause I don't know how.
  6. I'm on a Mac by the way
  7. So heres my question (to all HUD-Makers)- [b]how DOES one make an HUD?[/b]
  8. If you have an answer, please do share it. If you don't- go to another topic please :-)
  9. :granger: :dragoon: :dragoon: :dragoon: :dragoon: :dragoon:
  10. [/quote]
  11.  
  12. [b]"Kk lets get started the short and simple way to making a Heads up display for tremulous"[/b]
  13.  
  14. [b][u]Step 1[/u][/b]
  15. [i]Getting a kickass Text editor[/i]
  16. [b][u]Windows[/u][/b] [url=http://networkofdoom.net/~bishop3space/Tremulous/Projects/Hud/Notepadpro++/Notepad++.zip]Notepad++[/url] [i]FullVersion[/i]
  17. [b][u]Mac[/u][/b] [url=http://macromates.com/]Textmate[/url] [i]Trial Version[/i]
  18. [b][u]Multi Platform[/u][/b] [url=http://www.jedit.org/index.php?page=download]JEdit[/url] [i]Free/Opensource[/i]
  19.  
  20.  
  21. [b][u]Step 2[/u][/b] [i]Creating a Project Folder[/i]
  22. "Bassically what you want to do is create a folder named "ui", or "W/e name you want" and place it in the right location [i][b](Tremulous Base)[/b][/i] so you're able to build a hud."
  23.  
  24. [b][u]Windows 2000[/u][/b] [code]C:/Program Files/Tremulous/Base/
  25. [/code]
  26.  
  27. [b][u]Windows xp service pack 1&2[/u][/b][code]C:/Documents and Settings/Your Login Name/Application Data/Tremulous/base/[/code]
  28.  
  29. [b][u]Windows Vista[/u][/b] [code]c:/ProgramData/Microsoft/Windows/Start Menu/Programs/Tremulous/base/
  30. [/code]
  31.  
  32. [b][u]Mac[/u][/b] [code]~/Library/Application Support/Tremulous/base/[/code]
  33.  
  34. [b][u]Linux[/u][/b] [code]~/.tremulous/base/ [/code]
  35.  
  36. [b][u]Step 3[/u][/b] [i]Gathering Files to base a hud on (Refrence Huds)[/i]
  37. [url=http://networkofdoom.net/~bishop3space/Tremulous/Projects/Hud/Backup%20huds/]Hud's On my Web Folder[/url]
  38. [url=hudcatalog http://tremulous.net/forum/index.php?topic=5481.0]Hud Catalog[/url]
  39.  
  40. [i]Recommended huds to look for for reference[/i]
  41. [url=http://networkofdoom.net/~bishop3space/Tremulous/Projects/Hud/Volt_hud/Release/Volthud1.8/Volthud1.8.zip]Volt Hud 1.8[/url] [i]bias :P[/i]
  42. [url=http://interpsy.com/nt/oticz/current/oticz_v2.2.zip]K-Otic&Exclamation hud[/url] [i]Very well put togehter, they've set the standards of tremulous Huds[/i]
  43.  
  44. Additionally you can just start from scratch, and use the tremulous default hud as your base.
  45.  
  46. [b][u]Step 3.a[/u][/b] [i]Getting tremulous Defualt hud files[/i]
  47.  
  48. In your base folder there is a file named [b][i]data-1.1.0.pk3[/i][/b] You need to [b]copy[/b] that and [b]paste[/b] it in a safe location(DO NOT REMOVE OR MODIFY THE ORIGINAL data-1.1.0.pk3), Then rename the filetype of data-1.1.0.pk3 to data-1.1.0.zip then proceed to extract it. This might take some time after it is done extracting you'll have a folder named data-1.1.0 open it up and navigate to the Ui folder, use anything from this directory to build your hud.
  49.  
  50. I've taken into consideration that some might not be able to do the above steps so i've extracted that folder from the data-1.1.0.pk3 for you [url=data-1.1.0.pk3]Ui.zip[/url]
  51.  
  52. [b][u]Step 4[/u][/b] [i]Creating a well orginized hud [b]using Oticz amazing hud orginazation format[/b][/i]
  53. This format is [url=http://www.urbandictionary.com/define.php?term=catagorising]catagorising[/url]-not real word, everything into more specific groups.
  54. [tr]Main[/tr]-Then subgroups[table]assets,hud,Menu[/table]
  55.  
  56. In the [b]Hud[/b]-Directory you place everything that effects the hud.
  57. in the [b]Menu[/b] -Directory you place everything that effects the menus.
  58. In the [b]Assets[/b]- Directory you place things you want to use in your project, raw media formats.
  59. Some huds that use this format are [url=http://networkofdoom.net/~bishop3space/Tremulous/Projects/Hud/Volt_hud/Release/Volthud1.8/Volthud1.8.zip]VoltHud1.8[/url][b]/[/b] [url=http://interpsy.com/nt/oticz/current/oticz_v2.2.zip]k-otichud2.2[/url] [b]/[/b][url=http://networkofdoom.net/~bishop3space/Tremulous/Projects/Hud/Backup%20huds/AdjustableHUD1.3-Mox.zip]MoxHud1.3[/url]
  60.  
  61. [b][u]step 4.a[/u][/b] [i]making a well orginized project folder[/i]
  62. Inside your allready created project folder create these directories(Folders) hud,menu,assets.
  63. [b]Hud[/b]-inside this folder should be 3 folders,default,common,yourhud.
  64. [b]menu[/b]-nothing fancy in here just place all your menu files in here
  65. [b]assets[/b]-this directory should have 4folders.
  66. 1. [b]menu[/b]-where you place your menu gfx,2.[b]neutral[/b]-neutral images go here,like a logo, 3.[b]sounds[/b]-intromusic, or menu button sounds should go here, and last 4.[b]thumbs[/b]-this is for thumbnail views of hudstyles or menu, bassically anything you want to thumbnail,those imagines would fall under this directory.
  67.  
  68. [u][b]step 4.a.1[/b] [/u] [i]i took into consideration that some might not want to go through all that so i've put together a sample project folder, including the industry standard features [url=http://rapidshare.com/files/155284923/sampleProjectFolder.zip.html]sampleprojectfolder.zip[/url][/i] Great template for anyone instrested in making a well built hud.(skip to step 5 if you have chosen to use template)
  69.  
  70. [b][u]step 4.b[/u][/b]
  71. If you didnt use the template above you're going to need to create a install.cfg,uninstall.cfg,and a menu.cfg.
  72. [b]Install.cfg[/b]-is a cfg file that tells tremulous what to set cvars to make sure to save this in the main part of your project folder ([b]optional[/b] as install.cfg),example [code]//cvar switches for your hud or any other settings
  73. seta cg_hudfiles "ui/hud/test/hud.cfg"
  74. seta ui_menufiles "ui/menus.cfg"
  75. vid_restart
  76. [/code]
  77. [b][u]Uninstall.cfg[/u][/b]- is a cfg file that is used to reset the cvars that were set in the install.cfg, bassically undo the changes done in the install.cfg,make sure to save this in the main part of your project folder([b]optional[/b] as kill.cfg)
  78. [code]// unstaller yourhud (place in reset commands to reset cvars in your huds uninstallation)
  79. reset cg_hudfiles
  80. reset ui_menuFiles
  81. vid_restart
  82. [/code]
  83.  
  84. [b][u]menus.cfg[/u][/b]-this is where you list all the locations of all the .menu files you wish to use in your project(excluding anything that is ingame like human hud,alien hud). save this in the main part of your project folder. [code]// menu defs
  85. //
  86. {
  87. loadMenu { "ui/menu/main.menu" }
  88. loadMenu { "ui/menu/joinserver.menu" }
  89. loadMenu { "ui/menu/punkbuster.menu" }
  90. loadMenu { "ui/menu/createserver.menu" }
  91. loadMenu { "ui/menu/mod.menu" }
  92. loadMenu { "ui/menu/credit.menu" }
  93. loadMenu { "ui/menu/connect.menu" }
  94. loadMenu { "ui/menu/password.menu" }
  95. loadMenu { "ui/menu/quit.menu" }
  96. loadMenu { "ui/menu/addfilter.menu" }
  97. loadMenu { "ui/menu/error.menu" }
  98. loadMenu { "ui/menu/serverinfo.menu" }
  99. loadMenu { "ui/menu/findplayer.menu" }
  100. loadMenu { "ui/menu/quitcredit.menu" }
  101. loadMenu { "ui/menu/createfavorite.menu" }
  102. }
  103. [/code]
  104. [i]If you make some new menu, example a hud options menu you'll need to include its location in that file.[/i]
  105.  
  106. [b][u]4.c[/u][/b] [i]Making a folder for a hud[/i]
  107. ([b]Optional But recommened[/b] The folder has to be in this directory ui>hud>HERE!)
  108. so in the hud directory create a folder for a hudstyle, example create a folder named "[b]center[/b]".
  109. example: ui>hud>center
  110.  
  111. [b][u]4.c.1[/u][/b]
  112. You should now be in ui>hud>Yourhud
  113. in this directory you'll need to create 5 files.
  114.  
  115. [b][i]alien_builder_hud.menu[/i][/b]-this is where you edit the alien builder hud a.k.a fatty granger hud,make sure to save this file under ui>hud>yourhud,([b]Optional but recommened[/b] as alien_builder_hud.menu) example [code]#include "ui/menudef.h"
  116.  
  117. // Volt
  118. //this file links to the stuff in alien_common_hud.cfg
  119.  
  120. {
  121. menuDef
  122. {
  123. name "alien_builder_hud"
  124. fullScreen MENU_FALSE
  125. visible MENU_TRUE
  126. rect 0 0 640 480
  127.  
  128. #include "ui/hud/center/alien_common_hud.cfg"
  129. }
  130. }[/code]
  131.  
  132. [b][u]alien_general_hud.menu[/u][/b]-this hud is for any class excluding the builder(granger fatty!)make sure to save this file under ui>hud>yourhud,([b]Optional but recommened[/b] as alien_general_hud.menu) example [code]#include "ui/menudef.h"
  133.  
  134. // Volt
  135. {
  136. menuDef
  137. {
  138. name "alien_general_hud"
  139. fullScreen MENU_FALSE
  140. visible MENU_TRUE
  141. rect 0 0 640 480
  142.  
  143.  
  144. #include "ui/hud/center/alien_common_hud.cfg"
  145. //edit from here down this includes everything in alien_common_hud.cfg, and adds goon barbs
  146.  
  147.  
  148. //BLOB
  149. itemDef
  150. {
  151. name "blob"
  152. rect 311 250 18 60
  153. visible 1
  154. forecolor 1 .677638 .345144 .8
  155. background "ui/assets/alien/tremublob.tga"
  156. ownerdraw CG_PLAYER_POISON_BARBS
  157. //Volt
  158. }
  159. }
  160. }[/code]
  161.  
  162. [b][u]alien_common_hud.cfg[/u][/b]-this is using a common file so you can just link to it, example in alien_builder,and alien_general we link to this common cfg,bassically place anything thats common between the alien_builder.menu,and alien_general.menu in here. somethings that would be included here would be backdrops and stage indicators.(You dont need a menudef for this file just list itemdef's. make sure to save this file under ui>hud>yourhud,([b]Optional but recommened[/b] as alien_common_hud.cfg) [code]// Volt
  163. //edit this to change alien hud
  164.  
  165. #include "ui/hud/common/alien.cfg"
  166. #include "ui/hud/common/chatmenu_alien.cfg"
  167. //edit from here down
  168.  
  169. //Stage Display
  170. itemDef
  171. {
  172. name "stageDisplay"
  173. align ITEM_ALIGN_CENTER
  174. textscale .3
  175. textstyle ITEM_TEXTSTYLE_SHADOWED
  176. rect 280 470 100 23
  177. forecolor 1 .677638 .345144 .7
  178. decoration
  179. visible 1
  180. ownerdraw CG_STAGE_REPORT_TEXT
  181. //Volt
  182. }
  183. [/code]
  184.  
  185. [b][u]human_hud.menu[/u][/b]-unlike the alien hud, the human hud requires only a single file for all its itemdefs,so place all itemdefs for the human hud in here. Make sure to save this file under ui>hud>yourhud ([b]Optional but recommened[/b] as human_hud.menu.) example [code]#include "ui/menudef.h"
  186.  
  187. {
  188. menuDef
  189. {
  190. name "human_hud"
  191. fullScreen MENU_FALSE
  192. visible MENU_TRUE
  193. rect 0 0 640 480
  194.  
  195. #include "ui/hud/common/human.cfg"
  196. #include "ui/hud/common/chatmenu_human.cfg"
  197. //edit from here down
  198.  
  199.  
  200.  
  201.  
  202. }
  203. }
  204. }
  205.  
  206. [/code]
  207.  
  208.  
  209. [b][i]files that do not directly pertain to the hud directory but are required.[/i][/b]
  210.  
  211. [b][u]spectator_hud.menu[/u][/b]-this is a very common file especially if you have more than one hudstyle,this just list the itemdefs for the spectator hud,bassically what you can place in here is watermarks,your name or anything else. Make sure to save this file under ui>hud>common ([b]Optional but recommened[/b] as spectator_hud.menu) example [code]#include "ui/menudef.h"
  212.  
  213. // volt
  214.  
  215. {
  216. menuDef
  217. {
  218. name "default_hud"
  219. fullScreen MENU_FALSE
  220. visible MENU_TRUE
  221. rect 0 0 640 480
  222.  
  223. #include "ui/hud/common/chatmenu_spec.cfg"
  224. //edit from here down, just paste itemdefs or use the standardhuds spectatorhud as a template.
  225.  
  226.  
  227. }
  228. }
  229. }
  230. [/code]
  231.  
  232. [b][u]Teamscore.menu[/u][/b]-this is that menu that appears when you press tab, or any key binded to +scores. Make sure to save this file under ui>hud>common ([b]Optional but recommened[/b] as teamscore.menu) example [code]#include "ui/menudef.h"
  233.  
  234. {
  235. \\ score_menu \\
  236.  
  237. menuDef
  238. {
  239. name "teamscore_menu"
  240. visible 0
  241. fullscreen 0
  242. rect 0 0 640 480
  243. focusColor 1 .75 0 1
  244. style 0
  245. border 1
  246. //edit from here down,use someone else hud's
  247. //teamscore as teamplate or use the standard and edit it.
  248.  
  249.  
  250.  
  251. }
  252. }
  253. }
  254. [/code]
  255.  
  256. [b][u]loading.menu[/u][/b]-this is that menu that appears when you join a server and see the bars, Make sure to save this file under ui>hud>common ([b]Optional but recommened[/b] as loading.menu) example [code]#include "ui/menudef.h"
  257.  
  258. {
  259. assetGlobalDef
  260. {
  261. cursor "ui/assets/3_cursor3" // cursor
  262. gradientBar "ui/assets/gradientbar2.tga" // gradient bar
  263. fadeClamp 1.0 // sets the fadeup alpha
  264. fadeCycle 1 // how often fade happens in milliseconds
  265. fadeAmount 0.1 // amount to adjust alpha per cycle
  266.  
  267. shadowX 5 // x amount for shadow offset
  268. shadowY 5 // y amount for shadow offset
  269. shadowColor 0.1 0.1 0.1 0.25 // shadow color
  270.  
  271. font "fonts/font" 26 // font
  272. smallFont "fonts/smallfont" 20 // font
  273. bigFont "fonts/bigfont" 34 // font
  274. }
  275.  
  276. menuDef
  277. {
  278. name "Loading"
  279. rect 0 0 640 480
  280. fullScreen MENU_TRUE
  281. //edit from here down,use someone else hud's loading as template
  282. //or edit original tremulous loading.
  283.  
  284.  
  285. }
  286. }
  287. }
  288. [/code]
  289.  
  290. [b][u]hud.cfg[/u][/b]-this is where you list the locations of all the files that will be used in your hudstyle,list the locations of the human_hud.menu,alien_builder_hud.menu,alien_general_hud.menu,spectator_hud.menu,teamscore.menu,and loading.menu.Make sure to save this file under ui>hud>yourhud ([b]Optional but recommened[/b] as hud.cfg) [code]// hud menu defs
  291. //
  292. {
  293. loadMenu { "ui/hud/center/human_hud.menu" }
  294. loadMenu { "ui/hud/center/alien_builder_hud.menu" }
  295. loadMenu { "ui/hud/center/alien_general_hud.menu" }
  296. loadMenu { "ui/hud/common/spectator_hud.menu"}
  297. loadMenu { "ui/hud/common/teamscore.menu" }
  298. loadMenu { "ui/hud/common/loading.menu" }
  299. }
  300. [/code]
  301.  
  302.  
  303. [b][u]Step 5[/u][/b] [i]Actually coding the hud and testing it![/i]
  304. [b][i]Working Enviroment[/i][/b]
  305. [i][u]The working environment[/u][/i]-you want to have as much free ram as possible, so close them applications.
  306. After you've done that open your text editor (Hopefully tab supported) and then minimize it, open tremulous get it into halfscreen.
  307.  
  308. [b][u]Half screen[/u][/b]
  309.  
  310. [b][u]windows[/u][/b]-press [b]alt[/b]+[b]enter[/b] to enter halfscreen mode.
  311. [b][u]mac[/u][/b]- press [b]apple[/b]+[b]enter[/b] to enter halfscreen mode.
  312. [b][u]linux[/u][/b]-volt needs help ;D
  313.  
  314.  
  315. [b][u]step 5.a[/u][/b] [i]installing your test hud[/i]
  316. bring up up tremulous and install your test hud,this is bassically calling on your install.cfg in the main part of the project folder, additionally you can just manually set the commands in console[code] /seta cg_hudfiles "ui/hud/"[/code]the location of your hud.cfg in your hudstyle folder.
  317. seta [code]/ui_menufiles "ui/menus.cfg"[/code] the location of the menus.cfg in the main part of your project folder. then for the changes to take effect you need to type in [code]/vid_restart[/code]
  318.  
  319. [b][u]Step 5.a[/u][/b] [i]Working on menus[/i]
  320. In your text editor open up a menu you wish to change, for learning purposes were going to tag up the mainmenu. So open up main.menu in your text editor the files location should be ui>menu>main.menu
  321. ok after you've opened it up we're going to edit some code,frist line is going to be line 128 [code]text "Tremulous (C) 2005-2006 darklegion development"[/code] change that to [code]text "YOUR NAME i am HUD CODDER WOOT!"[/code] then scroll down to line 130 [code]textstyle ITEM_TEXTSTYLE_NORMAL[/code] and change that to [code]textstyle ITEM_TEXTSTYLE_NEON[/code] after you've done this make sure to save, usually shortcut key for save is [b]ctrl[/b]+[b]s[/b], after you have saved minimize your texteditor and open up tremulous, in tremulous open console by pressing [code]~[/code] aka tilde and type [code]/vid_restart[/code] when tremulous reloads look to the very bottom you should see a shinny piece of text that says what you inputed. If you have done this right congratulations you're ready to begin coding a hud, if you have failed at this no worries try try agian, took me forever to learn this so dont feel disencouraged.
  322.  
  323. [i][b][u]This tutorial is very basic it only aims to get the subject ready to code a hud,it does not aim to make one proliferate at making a hud, but to help one get to know the process. I will make a second tutorial in the very near future with more advance proccesses, that include making cvars limited to itemdefs,and explations of very common ownerdraws,flags,purecheck limitations,building pk3's,common.cfg files,documintations+publishing ,and ancor tequines.[/u][/b][/i]
  324.  
  325. [b]Some very very useful sites to look at for reference[/b]
  326. [url=http://linux.ucla.edu/~phaethon/q3tamenu/q3tamenu.html#toc16]Q3 TA Menu Def[/url] [i]Description of the Quake III: Team Arena menu scripting language in its role as general menuing and as HUD. [/i]
  327. [url=rfactory.org]The Reaction Factory[/url] [i]Site filled with tutuorials on how to build huds for the engine that tremulous runs on.[/i]
  328.  
  329. hopefully this qualifies as a sticky,if not i am curently in the process of adding more detailed explations,and more steps.
  330.  
  331. [i][u]Void of deity we aim to help the tremulous player ;D[/u][/i]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement