August 17, 2018, 10:23:42 PM

Author Topic: Font Tut?  (Read 4442 times)

BM231

  • Recently Bitten
  • **
  • Posts: 40
  • Karma: 0
    • View Profile
Font Tut?
« on: July 24, 2015, 05:57:38 PM »
Is there any tutorial on how to change the font of a map or on how to add the name of the player on the hud?

M.A.K.E C E N T S

  • Infected
  • ***
  • Posts: 84
  • Karma: 5
  • Take a deep breath. . . . . . . . Now get it done.
    • View Profile
    • M.A.K.E C E N T S GAMING
Re: Font Tut?
« Reply #1 on: July 24, 2015, 07:13:39 PM »
Is there any tutorial on how to change the font of a map or on how to add the name of the player on the hud?


You'll find some stuff from Dukip over here, for fonts:
http://ugx-mods.com/forum/index.php/topic,4912.0.html

and the name for the player I believe is hud.menu, search for "playername". It may be commented out, and should be in the "weaponinfo" menu. You can use a clientdvar to modify for the actual player name.

BM231

  • Recently Bitten
  • **
  • Posts: 40
  • Karma: 0
    • View Profile
Re: Font Tut?
« Reply #2 on: July 25, 2015, 02:58:01 AM »
Quote
You can use a clientdvar to modify for the actual player name.
Yeah, you might have to insert a code, I suck at scripting. :-[

Megadeth9811

  • Infected
  • ***
  • Posts: 67
  • Karma: 1
    • View Profile
Re: Font Tut?
« Reply #3 on: August 08, 2015, 08:42:52 PM »
Quote
You can use a clientdvar to modify for the actual player name.
Yeah, you might have to insert a code, I suck at scripting. :-[
Yes, please give us a code for player names, Tom. I need this as well.  ;)
Keep it metal! \m/

M.A.K.E C E N T S

  • Infected
  • ***
  • Posts: 84
  • Karma: 5
  • Take a deep breath. . . . . . . . Now get it done.
    • View Profile
    • M.A.K.E C E N T S GAMING
Re: Font Tut?
« Reply #4 on: August 19, 2015, 01:22:17 PM »
In hud.menu in raw/ui/, you should find an itemDef under weaponinfo, that may be commented out. Uncomment it if it is and change it to this: (I just changed the exp text line)

Code: [Select]
itemDef
{
name "playername"
rect -60 6 60 40
textscale TEXTSIZE_SMALL
textstyle ITEM_TEXTSTYLE_SHADOWED
textfont UI_FONT_OBJECTIVE
textalign ITEM_ALIGN_RIGHT
forecolor 1 1 1 1
exp text (dvarString("myplayername"))
visible 1
decoration
}

We will set the myplayername dvar in gsc. Save and close the menu file.

In gsc thread a function that sets this dvar per player similar to this:
Code: [Select]
//thread playerdvar();//thread this up in main in your mapname.gsc
playerdvar(){
flag_wait("all_players_connected");
players = get_players();
for(i=0;i<players.size;i++){
players[i] SetClientDvar("myplayername",players[i].playername);
}
}

Save the mapnane gsc and build your mod.
« Last Edit: August 19, 2015, 01:25:24 PM by M.A.K.E C E N T S »