Adding text to the HUD? [Solved]

In this forum you will find and post information regarding the modding of Star Wars Battlefront 2. DO NOT POST MOD IDEAS/REQUESTS.

Moderator: Moderators

Post Reply
CdtFox
2nd Lieutenant
2nd Lieutenant
Posts: 379
Joined: Wed Feb 17, 2016 8:51 am
Projects :: BUC and Designated Days
Games I'm Playing :: SWBF2+EAW+Subnautica
xbox live or psn: No gamertag set
Location: France
Contact:

Adding text to the HUD? [Solved]

Post by CdtFox »

Hey guys,

Quick question how can i add new text to the HUD?; in the HUD file itself all my new parameters are ok (positions, Text, event enable). My new text is fully localized.

I created one more Text line like this: Text("player1weapon1ammo") and i'm pretty sure this is where the problem is. Everything is under the Group("player1reticule").

Can we create custom entry? I wasn't able to find something about ("player1weapon1overheat") in the modtool for exemple.

I also tried some hit maker text, it's isn't working too:
Hidden/Spoiler:
[code]
}[/code]
Thanks for reading :D
Last edited by CdtFox on Wed Sep 27, 2017 1:29 am, edited 1 time in total.
User avatar
Anakin
Master of the Force
Master of the Force
Posts: 4817
Joined: Sat Sep 19, 2009 11:37 am
Projects :: RC Side Mod - Remastered - SWBF3 Legacy
Location: Mos Espa (germany)

Re: Adding text to the HUD?

Post by Anakin »

of course you can create your own entry.
First of all you should try to get something on the screen. So don't care about the text or when it does appear.

Start with something simple such as

Code: Select all

Text("test")
{
    TextBreak("Word")
    TextStyle("Shadow")
    Text("Hello World")
    TextAlignment("Center", "Top")
    TextFont("gamefont_medium")
    Position(0.500000, 0.750000, 0.000000, "Viewport")
    ZOrder(5)
    Color(230, 70, 0)
}
If you see it on the screen, you should move it somewhere you can see it very good (middle of the screen) and don't make it too tiny. Make it a Hugh size, so you can still see it even when it moves out of the window.

next try to get you event enable working,

and then you can move it to your group you want it to be. Remember that you always inherit the position and offset things from your parent. So if your object is at the position 0,0 and your parent you move it to has something like 5,5 make sure you change the value of your own object to -5,-5.

After all that is working continue with the text itself and fill it with something you really wanna display

Now is the time to resize the text and move it to it's final position

And Now you can do some fancy effects such as the Color, fading,...

Good luck
CdtFox
2nd Lieutenant
2nd Lieutenant
Posts: 379
Joined: Wed Feb 17, 2016 8:51 am
Projects :: BUC and Designated Days
Games I'm Playing :: SWBF2+EAW+Subnautica
xbox live or psn: No gamertag set
Location: France
Contact:

Re: Adding text to the HUD?

Post by CdtFox »

Yep thanks for the answer, i'v done step by step like you said and now everything is working perfectly :D
User avatar
Anakin
Master of the Force
Master of the Force
Posts: 4817
Joined: Sat Sep 19, 2009 11:37 am
Projects :: RC Side Mod - Remastered - SWBF3 Legacy
Location: Mos Espa (germany)

Re: Adding text to the HUD? [Solved]

Post by Anakin »

:thumbs: it's a general mistake. Everyone has great ideas but never did something like that. So you should always concentrate on the basics first (functionality) and go over to advanced things and decorations later (content and design)
Post Reply