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

xSanchez78's Hintstrings

broken avatar :(
Created 9 years ago
by alaurenc9
0 Members and 1 Guest are viewing this topic.
5,308 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 small but good
for you. This is my custom hintstring setup.
The purpose of this is to be able to have a hint
string that won't stop updating after 48 different
hinstrings have been set. This is kind of like
treminaor's hintstring fix, but it has a little
bit more, to make it more like the real hintstrings.

JUST SO YOU KNOW

yes this originally is from trem's hintstrings, but has a re-written
menufile and script to include more, which is why i claim it to be
a different topic. Don't care what you say about that tho.

xSanchez78's Hintstrings

Let's Get Started!

First open your hud.menu in root/mods/modname/ui.
If you dont have it in that folder, copy it from
root/raw/ui into there. Then open it. Find and
replace this

Code Snippet
Plaintext
	// Cursor hints
menuDef
{
name "Cursorhints"
rect 0 70 40 40 HORIZONTAL_ALIGN_CENTER VERTICAL_ALIGN_CENTER
fullScreen 0
visible when ( CHAPLIN_CHEAT_OFF && ( dvarString( mapname ) != "credits" ) );
 
itemDef
{
name "chRect"
rect 0 0 40 40 // 64x64
textscale TEXTSIZE_SMALL
textstyle ITEM_TEXTSTYLE_SHADOWED
ownerdraw CG_CURSORHINT
visible 1
decoration
}
}


with this

Code Snippet
Plaintext
	// Cursor hints
menuDef
{
name "Cursorhints"
rect 0 70 40 40 HORIZONTAL_ALIGN_CENTER VERTICAL_ALIGN_CENTER
fullScreen 0
visible when ( CHAPLIN_CHEAT_OFF && ( dvarString( mapname ) != "credits" ) );
 
itemDef
{
name "chRect"
rect 0 0 40 40 // 64x64
textscale TEXTSIZE_SMALL
textstyle ITEM_TEXTSTYLE_SHADOWED
ownerdraw CG_CURSORHINT
visible 1
decoration
}
 
itemDef
{
name "xS78_hintstring_use"
rect 0 0 0 0
textscale TEXTSIZE_SMALL
textstyle ITEM_TEXTSTYLE_SHADOWED
textalign ITEM_ALIGN_CENTER
exp text ( dvarString( "xS78_hintstring_text_left" ) + KeyBinding( "+activate" ) + dvarString( "xS78_hintstring_text_right" ) )
visible when( dvarInt( "xS78_hintstring_use_vis" ) == 1 )
decoration
}
 
itemDef
{
name "xS78_hintstring_nouse"
rect 0 0 0 0
textscale TEXTSIZE_SMALL
textstyle ITEM_TEXTSTYLE_SHADOWED
textalign ITEM_ALIGN_CENTER
exp text dvarString( "xS78_hintstring_text_nouse" )
visible when( dvarInt( "xS78_hintstring_nouse_vis" ) == 1 )
decoration
}
}


Save it and close. Make sure in mod.csv
you call this:

Code Snippet
Plaintext
menufile,ui/hud.menu


Now open up _zombiemode_utility.gsc. At the top
put this in.

Code Snippet
Plaintext
//xSanchez78's Hintstrings
_setHintString( hint, radius )
{
self thread maps\_xS78_hintstrings::xS78_SetHintString( hint, radius );
}

_setVisibleToPlayer( player )
{
self maps\_xS78_hintstrings::xS78_setVisibleToPlayer( player );
}

_setVisibleToAll()
{
self maps\_xS78_hintstrings::xS78_setVisibleToAll();
}

_setInvisibleToPlayer( player, show )
{
self maps\_xS78_hintstrings::xS78_setInvisibleToPlayer( player, show );
}
//xSanchez78's Hintstrings


Now make a new file called _xS78_hintstrings.gsc.
Place this into it:

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

xS78_SetHintString( string, radius )
{
if( !isDefined( string ) )
{
return;
}
self notify( "new_hintstring" );
self endon( "new_hintstring" );
self SetHintString( "" );
self SetCursorHint( "HINT_NOICON" );
flag_wait( "all_players_connected" );
if( !isDefined( self.PlayersVisibleTo ) )
{
self.PlayersVisibleTo = [];
players = get_players();
for( i = 0; i < players.size; i++ )
{
self.PlayersVisibleTo[ self.PlayersVisibleTo.size ] = players[i];
}
}
while( isDefined( self ) )
{
players = get_players();
for( i = 0; i < players.size; i++ )
{
if( players[i] TrigIsVisibleTo( self ) && ( ( !isDefined( radius ) && players[i] istouching( self ) ) || ( isDefined( radius ) && distance( players[i].origin, self.origin ) < radius ) ) )
{
players[i].hintstring_to_show = string;
players[i] thread setHintString_show( self, string, radius );
}
}
wait 0.1;
}
}

TrigIsVisibleTo( trig )
{
if( !isDefined( trig.PlayersVisibleTo ) )
{
return true;
}
for( i = 0; i < trig.PlayersVisibleTo.size; i++ )
{
if( trig.PlayersVisibleTo[i] == self )
{
return true;
}
}
return false;
}

setHintString_show( trig, string, radius )
{
if( isDefined( self.lookingattrig ) && self.lookingattrig == trig )
{
return;
}
while( isDefined( trig ) && isDefined( self.hintstring_to_show ) && self.hintstring_to_show == string && ( ( !isDefined( radius ) && self istouching( trig ) ) || ( isDefined( radius ) && distance( self.origin, trig.origin ) < radius ) ) && self TrigIsVisibleTo( trig ) )
{
self.lookingattrig = trig;
self hintstring_update( string, true );
wait 0.001;
}
self.lookingattrig = undefined;
self hintstring_update( string, false );
}

hintstring_update( line, show )
{
if( !show )
{
self SetClientDvar( "xS78_hintstring_text_left", "" );
self SetClientDvar( "xS78_hintstring_text_right", "" );
self SetClientDvar( "xS78_hintstring_use_vis", 0 );
self SetClientDvar( "xS78_hintstring_text_nouse", "" );
self SetClientDvar( "xS78_hintstring_nouse_vis", 0 );
return;
}
index = 0;
has_use = false;
for( i = 0; i < line.size; i ++ )
{
if( line[ i ] == "&" && line[ i + 1 ] == "&" && line[ i + 2 ] == "1" )
{
index = i;
has_use = true;
}
}
if( !has_use )
{
self SetClientDvar( "xS78_hintstring_text_left", "" );
self SetClientDvar( "xS78_hintstring_text_right", "" );
self SetClientDvar( "xS78_hintstring_use_vis", 0 );
self SetClientDvar( "xS78_hintstring_text_nouse", string( line ) );
self SetClientDvar( "xS78_hintstring_nouse_vis", 1 );
return;
}
left = getSubStr( line, 0, index );
right = getSubStr( line, index + 3, line.size );
self SetClientDvar( "xS78_hintstring_text_left", string( left ) );
self SetClientDvar( "xS78_hintstring_text_right", string( right ) );
self SetClientDvar( "xS78_hintstring_use_vis", 1 );
self SetClientDvar( "xS78_hintstring_text_nouse", "" );
self SetClientDvar( "xS78_hintstring_nouse_vis", 0 );
}

xS78_setVisibleToPlayer( player )
{
self.PlayersVisibleTo = [];
self.PlayersVisibleTo[0] = player;
self setVisibleToPlayer( player );
}

xS78_setVisibleToAll()
{
self.PlayersVisibleTo = [];
players = get_players();
for( k = 0; k < players.size; k++ )
{
self.PlayersVisibleTo[ self.PlayersVisibleTo.size ] = players[k];
}
self setVisibleToAll();
}

xS78_setInvisibleToPlayer( player, show )
{
if( !isDefined( self.PlayersVisibleTo ) )
{
self.PlayersVisibleTo = [];
}
if( !isDefined( show ) )
{
newarray = [];
for( i = 0; i < self.PlayersVisibleTo.size; i++ )
{
if( self.PlayersVisibleTo[i] != player )
{
newarray[ newarray.size ] = self.PlayersVisibleTo[i];
}
}
self.PlayersVisibleTo = newarray;
self setInvisibleToPlayer( player );
}
else
{
if( show )
{
newarray = [];
for( i = 0; i < self.PlayersVisibleTo.size; i++ )
{
if( self.PlayersVisibleTo[i] != player )
{
newarray[ newarray.size ] = self.PlayersVisibleTo[i];
}
}
self.PlayersVisibleTo = newarray;
self setInvisibleToPlayer( player, true );
}
else
{
already_visible = false;
for( i = 0; i < self.PlayersVisibleTo.size; i++ )
{
if( self.PlayersVisibleTo[i] == player )
{
already_visible = true;
}
}
if( !already_visible )
{
self.PlayersVisibleTo[ self.PlayersVisibleTo.size ] = player;
}
self setInvisibleToPlayer( player, false );
}
}
}


Now to apply the hintstring setup,
first make sure that each script you
use this in has this at the top

Code Snippet
Plaintext
#include maps\_zombiemode_utility;


Most zombiemode scripts have that
at the top already. Now all you have
to do is go into each script and find
these for functions:

Code Snippet
Plaintext
SetHintString()
SetInvisibleToPlayer()
SetVisibleToPlayer()
SetVisibleToAll()


and replace them with this:

Code Snippet
Plaintext
_SetHintString()
_SetInvisibleToPlayer()
_SetVisibleToPlayer()
_SetVisibleToAll()


Very simple. You don't have to change the
arguments in them or anything, just simply
add an underscore in front of the function.

NOTES:

   - UseTriggerRequireLookAt() will not make the
     hintstrings dissapear when you look away. They
     will always show as long as you are touching the trigger.

   - This is scripted checking systems, not run by the
     engine. That means that sometimes your trigger may
     just in a wierd place or wierd shape and the hintstring
     may not show up because even though you can use the
     trigger and the default string would show, doesn't mean
     that the function "istouching()" will return true. I have
     made a way for you to add a radius for your trigger though.
     Instead of using just "_SetHintString( string );", for the
     triggers that don't seem to work, just add this:
     "_SetHintString( string, radius );". The radius can be
     set to anything and then it will check if you are close
     enough based on the radius to see the trigger. Experiment
     and see which radiuses work best for your trigger!

   - Localized strings do NOT work! If you put in a localized
     string it most likely wont show up ( idk what happens
     its been a while since i tried ) but it most likely wont
     work so dont even try. Things like &"ZOMBIE_FLAMES_UNAVAILABLE"
     have to be replaced with a normal string like: "The power must be activated first"

That's all guys, hope you enjoy. By the way for those
wondering: some people might not trust this since my
last tutorial was released un-tested. Well trust me, this
HAS been tested. I made this during christmas break ( 5 months
ago ) and it was worked every since, so dont worry. Thanks,
remember to credit me, and peace out.
Last Edit: June 20, 2015, 11:41:59 pm by alaurenc9
broken avatar :(
×
broken avatar :(
Location: gbNewport
Date Registered: 2 November 2014
Last active: 2 years ago
Posts
1,265
Respect
Forum Rank
Zombie Colossus
Primary Group
Member
My Contact & Social Links
More
Personal Quote
Embrace the Darkness
×
Tim Smith's Groups
Tim Smith's Contact & Social Linkstimsmith90THEREALBaDBoY17TimSmithMy clan Website
Wow nice one dude thx :)
broken avatar :(
×
broken avatar :(
Location: gbComing up in the world
Date Registered: 26 November 2013
Last active: 9 years ago
Posts
325
Respect
Forum Rank
Perk Hacker
Primary Group
Community Scripter Elite
My Groups
More
My Contact & Social Links
More
Personal Quote
I own the hat!
×
DuaLVII's Groups
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.
DuaLVII's Contact & Social Linksthomas.gascoigne.7DuaLVIIDuaLVIITheProlonger
This just looks like a modified version of Trem's hint string on http://ugx-mods.com/wiki/index.php?title=Hintstrings_not_updating

And by having a quick look through the code, whats stopping the hint string showing if the map is restarted while a hint string is shown.

dvars are stored through-out the session (which includes on a restart) and the hintstring will continue too show when the player goes back too spawn.
broken avatar :(
×
broken avatar :(
Location: gbNewport
Date Registered: 2 November 2014
Last active: 2 years ago
Posts
1,265
Respect
Forum Rank
Zombie Colossus
Primary Group
Member
My Contact & Social Links
More
Personal Quote
Embrace the Darkness
×
Tim Smith's Groups
Tim Smith's Contact & Social Linkstimsmith90THEREALBaDBoY17TimSmithMy clan Website
i added this to my map and i can't see the triggers :/ well still looks cool :)
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
This just looks like a modified version of Trem's hint string on http://ugx-mods.com/wiki/index.php?title=Hintstrings_not_updating

And by having a quick look through the code, whats stopping the hint string showing if the map is restarted while a hint string is shown.

dvars are stored through-out the session (which includes on a restart) and the hintstring will continue too show when the player goes back too spawn.

you think i should have an onPlayerConnect function to set all the dvars blank at the start of the game? I can do that. Yes i know i am a noob and used trem's hintstrings for the base code, but modified the menufile setup to be a bit better and also added the setvisibletoplayer crap to it as well. If people want to say i stole stuff again now is the time to do it.  ;)
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
then why isnt Trem credited...
broken avatar :(
  • steviewonder87
  • Deleted Member
×
broken avatar :(
steviewonder87
This user is deleted :(
If people want to say i stole stuff again now is the time to do it.  ;)
You stole stuff.
broken avatar :(
×
broken avatar :(
The Last of Us
Location: scotland
Date Registered: 28 September 2013
Last active: 3 weeks ago
Posts
1,463
Respect
Forum Rank
Zombie Colossus
Primary Group
UGX V.I.P.
My Groups
More
My Contact & Social Links
More
Personal Quote
ฏ๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎
Signature
×
smasher248'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
smasher248's Contact & Social Linkssmasher248smasher248
broken avatar :(
×
broken avatar :(
Purple Square Worshipper
Location: us
Date Registered: 30 January 2014
Last active: 1 year ago
Posts
679
Respect
Forum Rank
Zombie Enslaver
Primary Group
Famous User
My Groups
More
My Contact & Social Links
More
Personal Quote
Purple Square Worshiper
Signature

donate to purplemanwomen www.paypal.me/bwc66930
×
Bwc66930's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Famous User
Famous User
Bwc66930's Contact & Social Linksbwc66930bwc66930bwc66930bwc66931dkwithawbwc66930
stolen :P
broken avatar :(
×
broken avatar :(
The Last of Us
Location: scotland
Date Registered: 28 September 2013
Last active: 3 weeks ago
Posts
1,463
Respect
Forum Rank
Zombie Colossus
Primary Group
UGX V.I.P.
My Groups
More
My Contact & Social Links
More
Personal Quote
ฏ๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎
×
smasher248'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
smasher248's Contact & Social Linkssmasher248smasher248
Don't care what you say about that tho.

cool, theif

 
Loading ...