HeroEngine Forums
Welcome, Guest. Please login or Register for HeroCloud Account.

Author Topic: nameplates  (Read 937 times)

Thazager

  • General Accounts
  • *
  • Posts: 1129
  • Never stop learning
    • View Profile
    • Heroes and Villains MMORPG
nameplates
« on: May 01, 15, 09:14:28 PM »

I noticed the player character name plates are on the same _GUILayer as the NPCs. This means the last made NPC in the view area will have its nameplate set on top of the player's nameplate. A new spawn always has the last made nameplate. In order for the character's name to always be on top, I am setting them in the default _GUILayer. This however can cause problems, as the method _getNameplateLayer() does not have input parameters and the override will not accept them either.

Code: [Select]
method _getNameplateLayer() as NodeRef of Class _GUILayer
  if hasmethod(me, "HE_getNameplateLayer")
    return me.HE_getNameplateLayer()
  .
  return findGUIControlByName(0, "nameplates")
.

so trying to set something like this up is not really possible:

Code: [Select]
// get the base nameplates layer for a game
method HE_getNameplateLayer() as NodeRef of Class _GUILayer
  win as NodeRef of Class _GUILayer

  // player or NPC
  if(me.checkIfPlayer(character) == true)
    win = findGUIControlByName(None, "default")
  else
    win = findGUIControlByName(None, "nameplates")
  .
  return win
.

method checkIfPlayer(n as NodeRef) as Boolean
  if n is kindof _PlayerAccount
    return true //has account is player
  else
    return false
  .
.

I don't want to modify the base code. So ... Would it be possible to either accept an input noderef to check (in method _getNameplateLayer() ) or have some way of setting more than 1 layer for the output (without modifying the base code)?

Or does someone have another way of setting 2 different layers, so the player always has their name on top?
Logged

Thazager

  • General Accounts
  • *
  • Posts: 1129
  • Never stop learning
    • View Profile
    • Heroes and Villains MMORPG
Re: nameplates
« Reply #1 on: May 01, 15, 09:25:22 PM »

Ok, I guess I will just intercept it before it reaches that method. The method that calls it has info needed.

add:
while playing SWtor, I noticed they had player names that were behind mobs that were in the distance. Guess they missed that one.
« Last Edit: May 04, 15, 10:30:47 AM by Thazager »
Logged