playMaker

Author Topic: Best Practices for Name Tags on Players  (Read 2449 times)

Fletch

  • Junior Playmaker
  • **
  • Posts: 66
    • SneakOnTheLot.com
Best Practices for Name Tags on Players
« on: July 09, 2013, 04:16:04 PM »
I'm making a photon networked game and would like each character to have a name tag above their character.  What is the best method for doing this in Playmaker?

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Best Practices for Name Tags on Players
« Reply #1 on: July 10, 2013, 05:33:31 AM »
Hi,

 plenty of solutions. Either you use some systems already done, like ngui HUD text,

http://hutonggames.com/playmakerforum/index.php?topic=3611.msg17088#msg17088

 or you can use a custom system made in playmaker like:

http://hutonggames.com/playmakerforum/index.php?topic=2405.msg10758#msg10758

bye,

Jean


Fletch

  • Junior Playmaker
  • **
  • Posts: 66
    • SneakOnTheLot.com
Re: Best Practices for Name Tags on Players
« Reply #2 on: July 10, 2013, 07:58:54 PM »
Great info!

Let me tell you how I have this working and you can point me in the right direction.

1) I begin with a start state with a Photon View Get Is Mine action.

2) If Yes then it moves to Get Name state where a Photon View Get Owner Property action pulls the name and assigns it to var NameTag.

3) Then I set the name tag in the next state, which has a Photon Network Set Player Custom Property in it, which sets the Custom Property Key and then places it in a GUI label that is held onto the player by a GUILayout Begin Area Follow Object.

It's all working very nicely except I can only see the name of the character I instantiated.  All the other players are blank... which is exactly the opposite of what I'm looking for.

Overall I'm having a really hard time wrapping my head around the multi-player game vs. single player.  It was simple to create a system that tracks gold, stats and such for the single player but when I switched to multi-player it sorta spun my head around and I haven't been able to get back on track.

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Best Practices for Name Tags on Players
« Reply #3 on: July 11, 2013, 06:45:39 AM »
Hi,

 Yes, multi player games require a solid understand and a lot of trial/error/stree/confusion/frustration otherwise :) so take the time to properly study what is required, read materials, and documentation on photon site.

you need to show for everyone, so you don't really need to check "is mine", since you want to label all players anyway. If the player doesn't see himself in the game, then yes you need to use it, and not show it "IF" is it mine.

you simply need to invert your logic here,

yes?

bye,

 Jean