View Full Version : OSMAdventure HUD
kyp123
12-22-2008, 12:19 AM
Hi everyone, I'm currently working on a mod of UT2004 and need to create a new HUD. it's and OSMT Adventure mod and I was wondering if anyone knows how to create a custom HUD for this type of mod. I had a look at some tutorials and examples online and found that I need a new game type class to create a new HUD, is this correct? also if its a OSMAdventure what class do I have to extend in order to create a custom game type class( at the moment I have:
class myGameType extends Deathmatch;
I wan to know what I replace "Deathmatch" with for OSMAdVenture.
If anyone can help it would be appreciated.
SuperApe
12-22-2008, 08:33 AM
Hi, welcome to UP.
Yes, to make a new HUD, the gametype will have to be new. There is a default property that calls up the appropriate HUD class, so you'll also need a new HUD class.
Just replacing "Deathmatch" with "OSM Adventure" is not proper coding when you want to extend a class (make a subclass). (First, "OSM Adventure" is the friendly name for the gametype class, "OSMGame".) If you're unsure how to properly subclass, you should research that first. UnrealWiki (legacy stuff) can help with some of that, this is not for the faint of heart. I can give you a quick head start on your gametype subclass and HUD subclass later, when I'm at home.
Hope that helps.
kyp123
12-22-2008, 08:07 PM
First off thanks for your response I appreciate you taking time to reply.
I have already tried extending OSMGame but I get the following error:
Superclass OSMGame of class myGameType not found
History: UMakeCommandlet::Main
Exiting due to error
It seems that the OSMT files can not be found. Is there a special way of accessing them? I put the .u and .ucl files in the Systems folder and the .utx in the Textures folder. Also about the subclass I assumed that it would be done the same way as in c++ or Java, is there a special way of doing this in UT? I have subclassed a weapon and that seemed to work.
You also mentioned that you could give me a head start on the gametype class and the HUD class, if you could that would be appreciated.
Regards,
kyp123
share_the_pain
12-22-2008, 08:56 PM
First off thanks for your response I appreciate you taking time to reply.
I have already tried extending OSMGame but I get the following error:
Superclass OSMGame of class myGameType not found
History: UMakeCommandlet::Main
Exiting due to error
It seems that the OSMT files can not be found. Is there a special way of accessing them? I put the .u and .ucl files in the Systems folder and the .utx in the Textures folder. Also about the subclass I assumed that it would be done the same way as in c++ or Java, is there a special way of doing this in UT? I have subclassed a weapon and that seemed to work.
You also mentioned that you could give me a head start on the gametype class and the HUD class, if you could that would be appreciated.
Regards,
kyp123
Have you added OSMT to the EditPackages list in ut2004.ini?
kyp123
12-22-2008, 09:31 PM
No but I created a package of my own which has OSMT files in it(System folder etc). Do I still need to add the OSMT package to the UT2004.ini?
share_the_pain
12-22-2008, 10:21 PM
No but I created a package of my own which has OSMT files in it(System folder etc). Do I still need to add the OSMT package to the UT2004.ini?
I'm not exactly sure what you mean by the first part, but yes, you do have to add OSMT to the EditPackages list in UT2004.ini.
Basically, when you extend the OSMGame class and try to compile, UT2004 looks through the packages in the EditPackages list and can't find the OSMGame class anywhere in there. By adding OSMT to the EditPackages list, you are telling UT2004 to include all of the classes involved with OSMT.u and to look through those classes whenever you make a reference to a class outside of your package.
You have to add any package to the EditPackages list that you reference in your code so a proper build can occur.
kyp123
12-23-2008, 12:15 AM
I tried adding the OSMT.u in the ut2004.ini file and I'm still getting the same error, this is how I added it
EditPackages=OSMT
is this correct??
I added it to the ut2004.ini file that is located in the UT2004 system directory and also tried adding it to the .ini file in my packages system directory, doesn't work either way. When I compile it seems to not see the OSMT package because as you probably already know the packages that get compiled get listed on the cmd prompt.
Any suggestions?
kyp123
12-23-2008, 12:25 AM
Scratch my last comment I got it to compile error free. thanks for your help share_the_pain.
SuperApe if you could still send the gametype class and the HUD class to help me ge started it would be appreciated.
thanks
SuperApe
12-23-2008, 08:56 AM
Hey, thanks for helping share_the_pain. :claps: I have been working all too much lately.
Glad you got that to compile, kyp. Just to put my mind at ease, I need to ask you: you *are* simply extending osmt, right? You're not actually taking bits and pieces of osmt (effectively taking it apart) and sticking it in your own mod, right? While I grant free use of osmt to anyone who wants to extend the entire add-on for non-commercial purposes, I cannot give permission to just copy parts of osmt and integrate anything but the full add-on I provide. IOW, osmt + your work (in separate packages) = ok; but osmt - (some stuff ) + your work (to make one single package) = not ok. (Just had to get that out of the way. This is all about compatibility and retaining integrity of my mod.)
I apologize for not getting back to you on this yesterday. Somewhere between work, BabyApe and utter exhaustion, I failed. A HUD element is one of the easier things to work with, as much as the GUI system *can* be "easy". We should be able to get it working for you shortly. I will do my best to get back to you tonight.
kyp123
12-24-2008, 01:25 AM
Yeah I'm just extending OSMT, I'm not taking it apart and only using the parts I need. I'll be waiting for your response. Thanks again.
SuperApe
12-24-2008, 10:58 AM
Okay, quick look finds: HUDType="XInterface.HudCDeathMatch"in the default Deathmatch gametype, which OSMGame is inheriting. This actor is not place-able. It is found at Object -> Actor -> HUD -> HUDBase -> HudCDeathmatch. You could specify any HUD subclass here in the default properties of your custom gametype. If you look through the code of the HUD subclasses, you'll notice all the current HUD elements (timer, ammo count, health) are all defined. If you subclass HudCDeathmatch, you can simply add to the current HUD elements. (that might be the easiest to start out with)
So, your new game class might look like:class MyGame extends OSMGame;
defaultproperties
{
HUDType="MyPackage.MyHud"
}
Also remember to check all the (legacy) UnrealWiki pages on the HUD class and its subclasses. There's not a lot there, but it should help explain what's available to you.
Hope that helps.
kyp123
12-28-2008, 09:06 PM
Thanks for that, but I'm still having a bit of trouble changing the HUD. For the time being all I'm trying to do is remove the timer just for testing to see if it works but it doesn't seem to work.
this is what I have so far:
class myGameType extends OSMGame;
DefaultProperties
{
HUDType="myPackage.myHUD"
}
class myHUD extends HudCDeathMatch;
DefaultProperties
{
bDrawTimer=false
}
to me that looks like it should remove the timer but it doesn't, can you see what im doing wrong?
Also do i need to create a custom mutator class and an Interaction class to alter the HUD? If so, how should It be done? and do I need to edit the .ini file in anyway?
Thanks
vBulletin® v3.7.2, Copyright ©2000-2013, Jelsoft Enterprises Ltd.