UGX-Mods

Call of Duty 5: World at War => Help Desk => Scripting => Topic started by: sal24r on August 25, 2014, 06:12:55 pm

Title: Distance HUD Element help
Post by: sal24r on August 25, 2014, 06:12:55 pm
(https://www.ugx-mods.com/forum/proxy.php?request=http%3A%2F%2Fi.imgur.com%2FOUVpt0E.jpg&hash=50859139e6f70c3c5fe8ba25dc9ca2befa157822)

Hi, is there a way to increase this distance?
Title: Re: Distance HUD Element help
Post by: JadenSzewczak on August 25, 2014, 06:35:33 pm
I've always wanted to do the console style Safe Area... :'(
Title: Re: Distance HUD Element help
Post by: johndoe on August 25, 2014, 06:38:31 pm
as far as i know, that distance is depends on the resolution which means you can't change it :|
Title: Re: Distance HUD Element help
Post by: DidUknowiPwn on August 25, 2014, 10:40:05 pm
Would have to modify all "rect" properties in hud.menu, which is not favorable....
Title: Re: Distance HUD Element help
Post by: sal24r on August 25, 2014, 11:12:05 pm
the file "safearea.menu" might be of help?
Title: Re: Distance HUD Element help
Post by: JustForFun119 on September 02, 2014, 10:43:12 am
There's a way of doing and it should be easy :)

Round Indicator (Chalk Drawings)

Copy _zombiemode.gsc from the raw/maps folder to your mod folder, if you didn't have one.

In the _zombiemode.gsc, there is a 'round_start' function, and you should see two lines:
Code Snippet
Plaintext
level.chalk_hud1 = create_chalk_hud();
level.chalk_hud2 = create_chalk_hud( 64 );
the function - create_chalk_hud actually creates the round indicator HUD at the bottom right of the screen.
The value inside the brackets are the horizontal distance from the edge of the screen.
Therefore, 'chalk_hud1' in created on the very edge of the screen, while 'chalk_hud2' in created 64 (pixels?) from the edge.
*'chalk_hud1' is actually the first 5 chalks drawings; 'chalk_hud2' is the second 5 chalks, which all makes up to 10 chalk drawings.

If you're trying to move the chalk hud further away from the edge, just change the values inside the brackets.
e.g. I want the chalk hud to be 20 pixels further, then you'll have to change the lines of code to:
Code Snippet
Plaintext
level.chalk_hud1 = create_chalk_hud( 20 );
level.chalk_hud2 = create_chalk_hud( 84 );
Just remember to have the second chalk hud 64 pixels away from the first one; of course you change it on your own to your liking :)

IMPORTANT NOTE:
Be careful when modifying the chalk hud because there are many function within _zombiemode.gsc that dealt with the chalk hud. Find the keyword 'chalk' in the script and modify the distance, x/y-offsets, and shader sizes; to ensure that the chalk hud looks fine in-game. Test it in-game to see if something is messed up; look into the codes to understand how it works. There are more than just 2 lines of code that handle the chalk hud.

Perks Icons (Shaders)

For the perks icons, you'll have to do similar adjustment, to the perk script.
Again, copy _zombiemode_perks.gsc to your mod folder if you didn't have one.

Find the function 'perk_hud_create', and there should be a line:
Code Snippet
Plaintext
hud.x = self.perk_hud.size * 30; 
This essentially aligns all perks horizontally by setting the icons to be apart, multiplying the perk's count by 30.
So, if the player buys the third perk, the icon will be created 90 pixels away from the edge of the screen.

Let's say you'd like to space out the perks as well for 20 pixels away from the edge, you can do this:
Code Snippet
Plaintext
hud.x = (self.perk_hud.size * 30) + 20; 
So that all of the perks' icons will be 20 pixels away as well.
*The number '30' is NOT the distance between the icons because the x-position is only a point on the screen. The shaders are actually 24x24 pixels large so the perks' icons are effectively 6 pixels apart.

Looking into other lines in that function; you can modify anything about the perks' shaders.
You can change it's y-position, alpha, even shader size, that is just mentioned. Be careful while modifying the shader' size because it correlates with the distance between icons, so you'll have to adjust 2 values.



Looking into _zombiemode.gsc and _zombiemode_perks.gsc gives you a lot of idea, of how the game works :D
Hope this works.
Title: Re: Distance HUD Element help
Post by: DidUknowiPwn on September 02, 2014, 02:17:34 pm
There's a way of doing and it should be easy :)

Round Indicator (Chalk Drawings)

Copy _zombiemode.gsc from the raw/maps folder to your mod folder, if you didn't have one.

In the _zombiemode.gsc, there is a 'round_start' function, and you should see two lines:
Code Snippet
Plaintext
level.chalk_hud1 = create_chalk_hud();
level.chalk_hud2 = create_chalk_hud( 64 );
the function - create_chalk_hud actually creates the round indicator HUD at the bottom right of the screen.
The value inside the brackets are the horizontal distance from the edge of the screen.
Therefore, 'chalk_hud1' in created on the very edge of the screen, while 'chalk_hud2' in created 64 (pixels?) from the edge.
*'chalk_hud1' is actually the first 5 chalks drawings; 'chalk_hud2' is the second 5 chalks, which all makes up to 10 chalk drawings.

If you're trying to move the chalk hud further away from the edge, just change the values inside the brackets.
e.g. I want the chalk hud to be 20 pixels further, then you'll have to change the lines of code to:
Code Snippet
Plaintext
level.chalk_hud1 = create_chalk_hud( 20 );
level.chalk_hud2 = create_chalk_hud( 84 );
Just remember to have the second chalk hud 64 pixels away from the first one; of course you change it on your own to your liking :)

IMPORTANT NOTE:
Be careful when modifying the chalk hud because there are many function within _zombiemode.gsc that dealt with the chalk hud. Find the keyword 'chalk' in the script and modify the distance, x/y-offsets, and shader sizes; to ensure that the chalk hud looks fine in-game. Test it in-game to see if something is messed up; look into the codes to understand how it works. There are more than just 2 lines of code that handle the chalk hud.

Perks Icons (Shaders)

For the perks icons, you'll have to do similar adjustment, to the perk script.
Again, copy _zombiemode_perks.gsc to your mod folder if you didn't have one.

Find the function 'perk_hud_create', and there should be a line:
Code Snippet
Plaintext
hud.x = self.perk_hud.size * 30; 
This essentially aligns all perks horizontally by setting the icons to be apart, multiplying the perk's count by 30.
So, if the player buys the third perk, the icon will be created 90 pixels away from the edge of the screen.

Let's say you'd like to space out the perks as well for 20 pixels away from the edge, you can do this:
Code Snippet
Plaintext
hud.x = (self.perk_hud.size * 30) + 20; 
So that all of the perks' icons will be 20 pixels away as well.
*The number '30' is NOT the distance between the icons because the x-position is only a point on the screen. The shaders are actually 24x24 pixels large so the perks' icons are effectively 6 pixels apart.

Looking into other lines in that function; you can modify anything about the perks' shaders.
You can change it's y-position, alpha, even shader size, that is just mentioned. Be careful while modifying the shader' size because it correlates with the distance between icons, so you'll have to adjust 2 values.



Looking into _zombiemode.gsc and _zombiemode_perks.gsc gives you a lot of idea, of how the game works :D
Hope this works.
He'd also have to modify hud.menu in order to get the right side of the hud to match with the left side.
Title: Re: Distance HUD Element help
Post by: JustForFun119 on September 03, 2014, 04:07:35 am
He'd also have to modify hud.menu in order to get the right side of the hud to match with the left side.
Yeah, that is still true... I'm just explaining how to modify the left side as he asked.
Title: Re: Distance HUD Element help
Post by: pashan on September 03, 2014, 04:11:10 am
idk if ya'll know this, but i believe that image is from bo2 (i may be wrong) 8)
Title: Re: Distance HUD Element help
Post by: JR-Imagine on September 03, 2014, 03:23:04 pm
idk if ya'll know this, but i believe that image is from bo2 (i may be wrong) 8)
(https://www.ugx-mods.com/forum/proxy.php?request=http%3A%2F%2Fimg3.wikia.nocookie.net%2F__cb20140820213305%2Fsailormoon%2Fimages%2Fe%2Fe0%2FYou_don%27t_say-.jpg&hash=d7b5e07e68f0ac5632031b84232f1b48d451d480)

Sorry, had to. :please: