HUD Elements [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
JoshuaTedder
Private
Posts: 35
Joined: Wed Oct 28, 2015 5:37 pm
Projects :: Different random projects.
Games I'm Playing :: Battlefront II
xbox live or psn: No gamertag set

HUD Elements [Solved]

Post by JoshuaTedder »

I have a very interesting idea, and a few questions.
Is there anything in the Battlefront II files that determines the default locations for the on-screen cursor after buttons have been selected and executed?
Such as after you hit the button to start a match and when the match loads the cursor automatically locates itself near the bottom of your screen,
or after you hit the button to change classes at the cp and the cursor locates itself near the center of your screen, or after you hit the Escape button, etc.
Those are a couple of examples.
Or maybe, could it be possible to change the input field of a button to fill up a larger space without actually making the button picture larger?
Also, is there any other way to execute a button besides right click or pressing Enter, or perhaps could there be a way to link a certain action with a shortcut (like the Respawn function which kills your current character so you can select another)?
I am searching to speed up the process of character selection and other utilities when speed matters most.
I know these are a lot of questions, I was half thinking out loud. :)
Thanks!
User avatar
AnthonyBF2
Sith
Sith
Posts: 1255
Joined: Wed Aug 21, 2013 3:55 pm
Projects :: PS2+PSP Overhaul

Re: HUD Elements

Post by AnthonyBF2 »

Most of the spawn screen elements are linked to code that's compiled in the game executable which of course is not changeable. I really wanted to get the PS2-like rotating character selection but each game's spawn screen setup is linked to it's game engine file which has code that cannot be accessed. The only thing I was ever able to do is move the spawn button and that I forgot plus I didn't save the source file I edited.
Samee3
First Lance Corporal
First Lance Corporal
Posts: 123
Joined: Sun Jul 05, 2015 5:07 pm
Projects :: BF2 Refresh Mod
Games I'm Playing :: Empire at War
xbox live or psn: VaporousFern310
Location: California, USA

Re: HUD Elements

Post by Samee3 »

Hmmm, sounds like a lot of hard-coded stuff to me. Sorry

However, if you haven't already checked these out:
How to Modify the HUD:
http://www.gametoast.com/viewtopic.php?f=27&t=14579
How to Fully Customize the HUD:
http://www.gametoast.com/viewtopic.php?f=27&t=29836
Custom Loading Screens:
http://www.gametoast.com/viewtopic.php?f=27&t=6020
User avatar
AnthonyBF2
Sith
Sith
Posts: 1255
Joined: Wed Aug 21, 2013 3:55 pm
Projects :: PS2+PSP Overhaul

Re: HUD Elements

Post by AnthonyBF2 »

Samee3 wrote:Hmmm, sounds like a lot of hard-coded stuff to me. Sorry

However, if you haven't already checked these out:
How to Modify the HUD:
http://www.gametoast.com/viewtopic.php?f=27&t=14579
How to Fully Customize the HUD:
http://www.gametoast.com/viewtopic.php?f=27&t=29836
Custom Loading Screens:
http://www.gametoast.com/viewtopic.php?f=27&t=6020
All the HUD does it display things that come from the game exe like the character selection layout. Nothing you can change in the HUD can actually change something in game play. Load screens are completely unrelated as well, it's just a picture the game slaps up while a map loads.
Samee3
First Lance Corporal
First Lance Corporal
Posts: 123
Joined: Sun Jul 05, 2015 5:07 pm
Projects :: BF2 Refresh Mod
Games I'm Playing :: Empire at War
xbox live or psn: VaporousFern310
Location: California, USA

Re: HUD Elements

Post by Samee3 »

Good points Anthony, though the links were simply semi-related material.

In any case, like I said, most of the stuff is hard-coded.
JoshuaTedder
Private
Posts: 35
Joined: Wed Oct 28, 2015 5:37 pm
Projects :: Different random projects.
Games I'm Playing :: Battlefront II
xbox live or psn: No gamertag set

Re: HUD Elements

Post by JoshuaTedder »

AnthonyBF2 wrote:Most of the spawn screen elements are linked to code that's compiled in the game executable which of course is not changeable. I really wanted to get the PS2-like rotating character selection but each game's spawn screen setup is linked to it's game engine file which has code that cannot be accessed. The only thing I was ever able to do is move the spawn button and that I forgot plus I didn't save the source file I edited.
Thanks for the info! It's a real bummer that more HUD things cannot be modified. :( But even modifying buttons would be awesome! I could just move around all the buttons where the cursor appears, and that should work. I found a couple of files in the mod tools that sound interesting, 1player.hud and ifs.pc.spawnselect.lua, and a lot of the other luas look interesting as well. I pretty much have no idea how to begin though. Do you have an idea of what files I should start in and what files they are compiled into once everything is munged?


EDIT
AnthonyBF2 wrote:
Samee3 wrote:Hmmm, sounds like a lot of hard-coded stuff to me. Sorry

However, if you haven't already checked these out:
How to Modify the HUD:
http://www.gametoast.com/viewtopic.php?f=27&t=14579
How to Fully Customize the HUD:
http://www.gametoast.com/viewtopic.php?f=27&t=29836
Custom Loading Screens:
http://www.gametoast.com/viewtopic.php?f=27&t=6020
All the HUD does it display things that come from the game exe like the character selection layout. Nothing you can change in the HUD can actually change something in game play. Load screens are completely unrelated as well, it's just a picture the game slaps up while a map loads.
I've been researching this for a while, and I think I've found something pertaining to the screen cursors (it's from BFI, but it's still LUA). Can you make any sense of this:

---- Enhanced ifs_teamstats.LUA by Phobos
-- Multiplayer game name screen.
-- Helper function. Given a layout (x,y,width, height), returns a
-- fully-built item.
function Teamstats_Listbox_CreateItem(layout)

local insidewidth = layout.width - 10;
-- Make a coordinate system pegged to the top-left of where the cursor would go.
local Temp = NewIFContainer {
x = layout.x - 0.5 * insidewidth, y=layout.y,
bInertPos = 1,

Here is the full page where I got this from:

http://www.swbfgamers.com/index.php?act ... s;start=15

If you search for the word "cursor" a lot of related code is there I think.


EDIT2
AnthonyBF2 wrote:Most of the spawn screen elements are linked to code that's compiled in the game executable which of course is not changeable. I really wanted to get the PS2-like rotating character selection but each game's spawn screen setup is linked to it's game engine file which has code that cannot be accessed. The only thing I was ever able to do is move the spawn button and that I forgot plus I didn't save the source file I edited.
I was looking through ifs_pc_spawnselect.lua, which is quite confusing, and I think I've found the button you're talking about, not sure though.

........--Make two buttons for the Accept & Cancel button..--And the text that goes in them...local okYPos = h - 0.1*h...this.Info.Ok = NewPCIFButton...{....x = w/2,....y = okYPos,......btnw = okcancelw, ....btnh = okcancelh,....font = "gamefont_large", ....bg_width = okcancelw,....string = "ifs.SpawnDisplay.Spawn",...}.....

Could you please help me interpret all this? Thanks!

Here's something else, but I think this is for selecting the unit class.

..--Make two buttons for the two sides, (a frame and an bitmap for each)...--These are the frames......Icon0PosX = w/2 -- - sidew/2...Icon1PosX = w/2 -- + sidew/2......this.Info.SideIcon0 = NewBorderRect ...{.....ZPos = 190, -- behind most.....x = w/2, .....y = SideYOffest,.....width = sidew*2,.....height = sideh,.....alpha = 0,.-- invisible hotspot, here we come....}...this.Info.SideIcon1 = NewBorderRect ...{.....ZPos = 190, -- behind most.....x = w/2, .....y = SideYOffest,.....width = sidew * 2,.....height = sideh,.....alpha = 0,...}.....--The two models...this.Info.SideModel0 = NewIFModel {....x = 0.0, y = 0.0,..--..x = Icon0PosX, y = SideYOffest,....scale = 1.0,....OmegaY = -0.3,....lighting = 1,....ColorR = 76, ColorG = 180, ColorB = 255,...}...this.Info.SideModel1 = NewIFModel {....x = 0.0, y = 0.0,..--..x = Icon1PosX, y = SideYOffest,....scale = 1.0,....OmegaY = -0.3,....lighting = 1,....ColorR = 76, ColorG = 180, ColorB = 255,...}......

Edit: I haven't found the things for the other screens yet, and I'm not sure if this is the proper file for the spawn screen (but I'm pretty sure). Maybe someone could give me some direction?

I know these things can be changed, because there are lots of mods that create custom screens like this.
Last edited by JoshuaTedder on Tue Jun 21, 2016 11:13 am, edited 1 time in total.
User avatar
Teancum
Jedi Admin
Jedi Admin
Posts: 11080
Joined: Wed Sep 07, 2005 11:42 pm
Projects :: No Mod project currently.
Games I'm Playing :: Destiny
xbox live or psn: No gamertag set
Location: Indiana

Re: HUD Elements

Post by Teancum »

No need to bump. You were like the fourth post on the page. Typically if someone knows the answer or what direction to point you in they do so withing 2-3 days. If you don't hear much by then you'll probably have to start exploring through it solo.
JoshuaTedder
Private
Posts: 35
Joined: Wed Oct 28, 2015 5:37 pm
Projects :: Different random projects.
Games I'm Playing :: Battlefront II
xbox live or psn: No gamertag set

Re: HUD Elements

Post by JoshuaTedder »

Teancum wrote:No need to bump. You were like the fourth post on the page. Typically if someone knows the answer or what direction to point you in they do so withing 2-3 days. If you don't hear much by then you'll probably have to start exploring through it solo.
Ok, got it.

Edit: Yay! I finally figured it all out, most of the buttons are re-programmable and working!
Post Reply