UGX-Mods Login

or login with an authentication provider below
Sign In with Google
Sign In with Twitter
Sign In with Discord
Sign In with Steam
Sign In with Facebook
Sign In with Twitch

Scrolling Fullscreen Overlay Hud

broken avatar :(
Created 9 years ago
by alaurenc9
0 Members and 1 Guest are viewing this topic.
6,095 views
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 30 December 2012
Last active: 9 months ago
Posts
577
Respect
Forum Rank
Zombie Enslaver
Primary Group
Community Scripter
My Groups
More
My Contact & Social Links
More
Signature
My preferred name is "xSanchez78".
Check me out here: www.steamcommunity.com/id/xSanchez78
×
alaurenc9's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Community Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
alaurenc9's Contact & Social LinksxSanchez78xSanchez78xSanchez78xSanchez78xSanchez78xSanchez78
Hey guys, today I have something I guess is cool
and worth posting. This is something I needed for my
mod so I spent like 3 hours scripting and testing it,
and since it's not a big deal I might as well show
people because I find it to have benefits, even though
alot of people are probably not gonna give two shits
about this post. Anyway here it is,

Fullscreen Overlay HUD

Basically this allows you to have an overlay on your screen,
scrolling up or down it at a speed you choose. I needed this
especially for Vulture Aid, and I thought I could release it
and see what other people could use it for.

Copy this code and call it _xS78_overlay.gsc:

Code Snippet
Plaintext
#include maps\_utility;
#include common_scripts\utility;
#include maps\_zombiemode_utility;

apply_scrolling_overlay( shader, priority, scroll_time, alpha, direction )
{
self endon( "disconnect" );
if( !IsDefined( self.scrolling_overlay_list ) )
{
self.scrolling_overlay_list = [];
}
already_in_array = false;
for( i = 0; i < self.scrolling_overlay_list.size; i++ )
{
if( self.scrolling_overlay_list[i].shader == shader )
{
already_in_array = true;
self.scrolling_overlay_list[i].priority = priority;
self.scrolling_overlay_list[i].scroll_time = scroll_time;
self.scrolling_overlay_list[i].alpha = alpha;
self.scrolling_overlay_list[i].direction = direction;
break;
}
}
if( !already_in_array )
{
temp_struct = spawnStruct();
temp_struct.shader = shader;
temp_struct.priority = priority;
temp_struct.scroll_time = scroll_time;
temp_struct.alpha = alpha;
temp_struct.direction = direction;
self.scrolling_overlay_list = array_add( self.scrolling_overlay_list, temp_struct );
}
self set_highest_overlay();
}

remove_scrolling_overlay( shader )
{
self endon( "disconnect" );
if( !IsDefined( self.scrolling_overlay_list ) )
{
self.scrolling_overlay_list = [];
}
temp_struct = undefined;
for( i = 0; i < self.scrolling_overlay_list.size; i ++ )
{
if( self.scrolling_overlay_list[i].shader == shader )
{
temp_struct = self.scrolling_overlay_list[i];
}
}
if( IsDefined( temp_struct ) )
{
self.scrolling_overlay_list = array_remove( self.scrolling_overlay_list, temp_struct );
}
self set_highest_overlay();
}

set_highest_overlay()
{
overlay = self get_highest_overlay();
if( IsDefined( self.current_overlay ) && ( !IsDefined( overlay ) || self.current_overlay.overlay != overlay ) )
{
self overlay_destroy();
}
if( !IsDefined( self.current_overlay ) && IsDefined( overlay ) )
{
self thread overlay_create( overlay );
}
}

get_highest_overlay()
{
if( !IsDefined( self.scrolling_overlay_list ) )
{
return undefined;
}
if( self.scrolling_overlay_list.size <= 0 )
{
return undefined;
}
highest_score_overlay = self.scrolling_overlay_list[0];
for( i = 1; i < self.scrolling_overlay_list.size; i ++ )
{
if( self.scrolling_overlay_list[i].priority > highest_score_overlay.priority )
{
highest_score_overlay = self.scrolling_overlay_list[i];
}
}
return highest_score_overlay;
}

overlay_create( overlay )
{
struct = spawnStruct();
struct endon( "overlay_over" );
self endon( "disconnect" );
self.current_overlay = struct;
struct.overlay = overlay;
scroll_percent = 0;
last_direction = overlay.direction;
while( true )
{
struct.hud = self create_overlay_hud( overlay.shader, overlay.alpha, scroll_percent, overlay.direction, last_direction );
struct.hud thread scroll_hud( overlay.scroll_time, self, struct, scroll_percent, overlay.direction, last_direction );
struct.hud thread set_hud_alpha( self, overlay );
current_scroll_time = overlay.scroll_time;
current_direction = overlay.direction;
while( true )
{
if( overlay.scroll_time != current_scroll_time )
{
break;
}
if( overlay.direction != current_direction )
{
break;
}
wait 0.01;
}
scroll_percent = 0;
if( IsDefined( struct.last_scroll_start_time ) )
{
elapsed_time = ( GetTime() - struct.last_scroll_start_time ) * 0.001;
scroll_percent = elapsed_time / current_scroll_time;
}
last_direction = current_direction;
struct.hud notify( "hud_destroy" );
struct.hud.second_hud Destroy();
struct.hud Destroy();
struct.hud = undefined;
}
}

overlay_destroy()
{
if( IsDefined( self.current_overlay ) )
{
if( IsDefined( self.current_overlay.hud ) )
{
self.current_overlay.hud notify( "hud_destroy" );
self.current_overlay.hud.second_hud Destroy();
self.current_overlay.hud Destroy();
}
self.current_overlay notify( "overlay_over" );
self.current_overlay = undefined;
}
}

create_overlay_hud( shader, alpha, scroll_percent, cur_direction, prev_direction )
{
hud_elem = NewClientHudElem( self );
hud_elem.x = 0;
hud_elem.y = 0;
hud_elem.hidewheninmenu = false;
hud_elem.horzAlign = "fullscreen";
hud_elem.vertAlign = "fullscreen";
hud_elem.foreground = false;
hud_elem SetShader( shader, 640, 480 );
hud_elem.alpha = alpha;
hud_elem.second_hud = NewClientHudElem( self );
hud_elem.second_hud.x = 0;
hud_elem.second_hud.y = -480;
hud_elem.second_hud.hidewheninmenu = false;
hud_elem.second_hud.horzAlign = "fullscreen";
hud_elem.second_hud.vertAlign = "fullscreen";
hud_elem.second_hud.foreground = false;
hud_elem.second_hud SetShader( shader, 640, 480 );
hud_elem.second_hud.alpha = alpha;
if( cur_direction == "down" )
{
hud_elem.y = 0;
hud_elem.second_hud.y = -480;
}
else
{
hud_elem.y = 480;
hud_elem.second_hud.y = 0;
}
if( scroll_percent > 0 )
{
if( cur_direction == "down" )
{
if( prev_direction == "down" )
{
scroll_percent_offset = scroll_percent * 480;
}
else
{
scroll_percent_offset = ( 1 - scroll_percent ) * 480;
}
hud_elem.y += scroll_percent_offset;
hud_elem.second_hud.y += scroll_percent_offset;
}
else
{
if( prev_direction != "down" )
{
scroll_percent_offset = scroll_percent * 480;
}
else
{
scroll_percent_offset = ( 1 - scroll_percent ) * 480;
}
hud_elem.y -= scroll_percent_offset;
hud_elem.second_hud.y -= scroll_percent_offset;
}
}
return hud_elem;
}

set_hud_alpha( player, overlay )
{
self endon( "hud_destroy" );
player endon( "disconnect" );
while( true )
{
self.alpha = overlay.alpha;
self.second_hud.alpha = overlay.alpha;
wait 0.01;
}
}

scroll_hud( scroll_time, player, struct, scroll_percent, cur_direction, prev_direction )
{
self endon( "hud_destroy" );
player endon( "disconnect" );
if( scroll_percent > 0 )
{
if( cur_direction == "down" )
{
if( prev_direction == "down" )
{
finish_scroll = ( 1 - scroll_percent ) * scroll_time;
}
else
{
finish_scroll = scroll_percent * scroll_time;
}
}
else
{
if( prev_direction != "down" )
{
finish_scroll = ( 1 - scroll_percent ) * scroll_time;
}
else
{
finish_scroll = scroll_percent * scroll_time;
}
}
self MoveOverTime( finish_scroll );
self.second_hud MoveOverTime( finish_scroll );
if( cur_direction == "down" )
{
self.y = 480;
self.second_hud.y = 0;
}
else
{
self.y = 0;
self.second_hud.y = -480;
}
struct.last_scroll_start_time = GetTime() - ( ( scroll_time - finish_scroll ) * 1000 );
wait( finish_scroll + 0.001 );
}
while( true )
{
if( cur_direction == "down" )
{
self.y = 0;
self.second_hud.y = -480;
}
else
{
self.y = 480;
self.second_hud.y = 0;
}
self MoveOverTime( scroll_time );
self.second_hud MoveOverTime( scroll_time );
if( cur_direction == "down" )
{
self.y = 480;
self.second_hud.y = 0;
}
else
{
self.y = 0;
self.second_hud.y = -480;
}
struct.last_scroll_start_time = GetTime();
wait( scroll_time + 0.001 );
}
}


There is no init or anything to call, this script can just remain
idle until you are ready to use it.

How To Use This:

Setting Up The Shader - First you need to get your overlay shader, any
shader works, but obviously use one that is meant for being displayed fullscreen,
with a pattern and nothing specific ( thats what this whole thing is for,
fullscreen overlays ). The material settings need to be the same as a normal
on screen shader ( like perk hud or something ), and they are not precached
in this script, you need to precace it seperately in the script yourself.

Using This In Script - Using this in script has been made really simple,
all you do is say weather to apply or remove the overlay shader.
To apply a shader, call this in your script where ever:
Code Snippet
Plaintext
self maps\_xS78_overlay::apply_scrolling_overlay( shader, priority, scroll_time, alpha, direction );

Now lets look at the arguments passed in:

   Shader - the name of the material you want to use as the overlay, also
   what is used to sort the overlays seperately, like a way to specify a single
   overlay

   Priority - The priority of this overlay showing up over the others. Basically
   you are able to apply multiple overlay's at once, and basically it only shows
   the overlay with the highest priority.

   Scroll Time - The time it takes for the hud to completely move down or up
   your screen in one cycle, basically increases\decreases the speed of the overlay.

   Alpha - The alpha ( visibility ) of the overlay ( i think we all know what this means ).

   Direction - The direction the overlay scrolls ( you can only put one of two things:
   "up" or "down", and the overlay will move in that direction.

You can re-apply the settings, basically meaning you can call that function again with
the same shader, and you can add new settings to the overlay. Each setting has been scripted
to update properly while its scrolling ( which was the hardest thing to do honestly ).

When it's time do be done with the overlay, you can easily remove it.
basically just call this:
Code Snippet
Plaintext
self maps\_xS78_overlay::remove_scrolling_overlay( shader );

Just call this with the shader you want to be removed, and it will remove. Once removed,
it will apply the overlay with the next highest priority number ( if the one you removed
had the highest priority number ). If you don't have any overlay's applied, no overlays
will show up ( duh ).

And thats pretty much it, I hope this becomes useful to some people :P

One note that people should know: this does use two HUD elems to properly
display the scrolling overlay, keep that in mind if you have a setup that
is on the verge of hitting the HUD limit.
broken avatar :(
×
broken avatar :(
[UGX] Documentation Writer & Programmer
Location: usLos Angeles, CA
Date Registered: 23 August 2013
Last active: 6 months ago
Posts
1,322
Respect
Forum Rank
Zombie Colossus
Primary Group
UGX Team Member
My Groups
More
My Contact & Social Links
More
Personal Quote
(ง º ω º )ง u wont sum m8y?
Signature
Do not take life too seriously. You will never get out of it alive.
×
DidUknowiPwn's Groups
UGX Team Member
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Community Scripter Elite Has shown excellence and experience in the area of custom scripting in the UGX-Mods community.
BO3 Modtools Alpha
BO3 Modtools Alpha
This user has access to the Black Ops 3 Modtools Alpha
This would be so much easier in menu file ._.
broken avatar :(
×
broken avatar :(
Location: usWisconsin
Date Registered: 5 September 2013
Last active: 4 years ago
Posts
70
Respect
Forum Rank
Rotting Walker
Primary Group
Donator ♥
My Groups
More
My Contact & Social Links
More
Personal Quote
Just Having Fun.
Signature

Released Maps:
TRAPPED
LSD
24h Labs
LegoLand
Poseidome

[Coming Soon]
Downtown Bikini Bottom
×
ibounce's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
ibounce's Contact & Social LinksiBounceyiBounceun1tedbouncersibouncey
Any chance you could post some images or a video?
broken avatar :(
×
broken avatar :(
Location: gbMilton Keynes
Date Registered: 17 January 2014
Last active: 4 years ago
Posts
6,877
Respect
1,004Add +1
Forum Rank
Immortal
Primary Group
Community Scripter
My Groups
More
My Contact & Social Links
More
Signature
If you want scripts / features made for you, then contact me by PM or email / skype etc
it will cost you tho so if you have no intention of reciprocating don't even waste my time ;)
×
Harry Bo21's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Community Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
Harry Bo21's Contact & Social Links[email protected]HarryBo21HarryBo000
Any chance you could post some images or a video?
its literally a full screen size hud elem moving of the screen in a certain direction if im reading this right

Imagine the lightning you get on your screen when you teleport in Der Reise, but imagine it moving upwards or sideways or something, I think thats what this is basically. Not sure though, havent read it fully
broken avatar :(
×
broken avatar :(
Location: usWisconsin
Date Registered: 5 September 2013
Last active: 4 years ago
Posts
70
Respect
Forum Rank
Rotting Walker
Primary Group
Donator ♥
My Groups
More
My Contact & Social Links
More
Personal Quote
Just Having Fun.
×
ibounce's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
ibounce's Contact & Social LinksiBounceyiBounceun1tedbouncersibouncey
its literally a full screen size hud elem moving of the screen in a certain direction if im reading this right

Imagine the lightning you get on your screen when you teleport in Der Reise, but imagine it moving upwards or sideways or something, I think thats what this is basically. Not sure though, havent read it fully

Ahhh, gotcha. It's credits.  :troll:
broken avatar :(
×
broken avatar :(
Location: gbMilton Keynes
Date Registered: 17 January 2014
Last active: 4 years ago
Posts
6,877
Respect
1,004Add +1
Forum Rank
Immortal
Primary Group
Community Scripter
My Groups
More
My Contact & Social Links
More
×
Harry Bo21's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Community Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
Harry Bo21's Contact & Social Links[email protected]HarryBo21HarryBo000
Ahhh, gotcha. It's credits.  :troll:
lol well, I guess you could use it for credits ;)
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 30 December 2012
Last active: 9 months ago
Posts
577
Respect
Forum Rank
Zombie Enslaver
Primary Group
Community Scripter
My Groups
More
My Contact & Social Links
More
×
alaurenc9's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Community Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
alaurenc9's Contact & Social LinksxSanchez78xSanchez78xSanchez78xSanchez78xSanchez78xSanchez78
its literally a full screen size hud elem moving of the screen in a certain direction if im reading this right

Imagine the lightning you get on your screen when you teleport in Der Reise, but imagine it moving upwards or sideways or something, I think thats what this is basically. Not sure though, havent read it fully

it looks like the vulture aid green overlay thing that scrolls up your screen basically, except this comes with more: u can add different speeds, different directions, differenct alpha, especially how you can change those settings while its active and it updates without notice. And also you can apply multiple ones at one time, and use the highest priority thing. Its really good for if you don't want to end up with two overlays at once and you want one that dominates the others.

Ahhh, gotcha. It's credits.  :troll:

I mean I guess but the thing is it keeps like scrolling the same pic so you would see the same text over and over and over, so no don't do that.

This would be so much easier in menu file ._.

menu files don't offer this much without any script, so yea
Last Edit: July 27, 2015, 03:23:55 am by alaurenc9
broken avatar :(
×
broken avatar :(
[UGX] Documentation Writer & Programmer
Location: usLos Angeles, CA
Date Registered: 23 August 2013
Last active: 6 months ago
Posts
1,322
Respect
Forum Rank
Zombie Colossus
Primary Group
UGX Team Member
My Groups
More
My Contact & Social Links
More
Personal Quote
(ง º ω º )ง u wont sum m8y?
×
DidUknowiPwn's Groups
UGX Team Member
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Community Scripter Elite Has shown excellence and experience in the area of custom scripting in the UGX-Mods community.
BO3 Modtools Alpha
BO3 Modtools Alpha
This user has access to the Black Ops 3 Modtools Alpha
it looks like the vulture aid green overlay thing that scrolls up your screen basically, except this comes with more: u can add different speeds, different directions, differenct alpha, especially how you can change those settings while its active and it updates without notice. And also you can apply multiple ones at one time, and use the highest priority thing. Its really good for if you don't want to end up with two overlays at once and you want one that dominates the others.
 
I mean I guess but the thing is it keeps like scrolling the same pic so you would see the same text over and over and over, so no don't do that.

menu files don't offer this much without any script, so yea
Code Snippet
Plaintext
exp				rect X((-107) - ((float(milliseconds() % FOG_SCROLL_TIME) / FOG_SCROLL_TIME) * (854)))
broken avatar :(
×
broken avatar :(
Location: gbMilton Keynes
Date Registered: 17 January 2014
Last active: 4 years ago
Posts
6,877
Respect
1,004Add +1
Forum Rank
Immortal
Primary Group
Community Scripter
My Groups
More
My Contact & Social Links
More
×
Harry Bo21's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Community Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
Harry Bo21's Contact & Social Links[email protected]HarryBo21HarryBo000
Code Snippet
Plaintext
exp				rect X((-107) - ((float(milliseconds() % FOG_SCROLL_TIME) / FOG_SCROLL_TIME) * (854)))
lets be fair man, you are astonishingly good with menu files, but the rest of us hardly understand them, so just go around them lol
Last Edit: July 27, 2015, 04:09:50 am by Harry Bo21
broken avatar :(
×
broken avatar :(
Location: fi
Date Registered: 25 June 2013
Last active: 9 months ago
Posts
3,997
Respect
1,024Add +1
Forum Rank
Eviscerator
Primary Group
UGX V.I.P.
My Groups
More
My Contact & Social Links
More
×
HitmanVere's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
UGX V.I.P.
UGX V.I.P.
Community Mapper Has released one or more maps to the UGX-Mods community which have been added to the UGX Map Manager.
BO3 Modtools Alpha
BO3 Modtools Alpha
This user has access to the Black Ops 3 Modtools Alpha
lets be fair man, you are astonishingly good with menu files, but the rest of us hardly understand them, so just go around them lol

If you take time reading stock menufiles, you can understand very easily ;)
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 30 December 2012
Last active: 9 months ago
Posts
577
Respect
Forum Rank
Zombie Enslaver
Primary Group
Community Scripter
My Groups
More
My Contact & Social Links
More
×
alaurenc9's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Community Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
alaurenc9's Contact & Social LinksxSanchez78xSanchez78xSanchez78xSanchez78xSanchez78xSanchez78
Code Snippet
Plaintext
exp				rect X((-107) - ((float(milliseconds() % FOG_SCROLL_TIME) / FOG_SCROLL_TIME) * (854)))

No I understand you can make a fullscreen scrolling overlay, but this does more, im talking about how this script is able to handle the entire overlay system, all the settings and all the things it does. Menufile just creates the hud, and then you have to manage showing it and setting it up which would be harder than this is.

 
Loading ...