Game Development Community

[Resolved] setShapeName Fail and Workaround

by Steve Acaster · in Torque 3D Professional · 07/17/2009 (7:11 pm) · 7 replies

SetShapeName appears not to set the shape's name anymore.
%player.setShapeName(hero); will do nothing (core/scripts/client/spawn.cs), nor will it function in-game through the console when called on a playerID.
3455.setshapename(hero);
//fail

SetName does work however, both in the spawnscript and in the calling of the playerID.
3455.setname(hero);
//win


Resolved, no issue in the first place.

#1
07/18/2009 (6:48 am)
Strange. It (setShapeName) is working for me...
#2
07/18/2009 (7:14 am)
Really? Are using FPSkit?

Just tried an "unmolested" NewProject, from the console 2769.setShapeName(bob);

Console says it's mapping it to a string but neither player's data in editor pane nor player object 2769:(null); updates.

2769.setname(bob); updates both selectd player object info in world and in the name field of player data in editor.
#3
07/18/2009 (8:14 am)
Ahh! They're two different things, setName() and setShapeName() -- I should have remembered that before.
  • setName is the object Name -- a usable identifier -- that's what you see in the object info and the name field in the editor. You can use this name to access a named object, just like you can with the objID.
  • setShapeName is a "dynamic" (too inebriated to think of a more proper word here) name and doesn't really do anything useful -- it's a nametag on a shirt -- which is why it get's passed the client's "Name" (from the "Join Server" screen). It's not meant to be actively accessed, but can be used to show names/description for objects while in gameplay.

  • setShapeName() also requires that the GuiShapeNameHud be active in your playGui, and it isn't in the Template -- thus it doesn't do anything useful there. The FPSkit is my "template" (how'd you guess? ;D), GuiShapeNameHud is used, that's why it works for me.
    #4
    07/18/2009 (8:50 am)
    Disregard.

    My previsou comments in the spawn script explain this to me, I didn't see them when porting.

    Doh!

    (I blame last night's unnatural sobriety...)
    #5
    08/01/2009 (1:24 pm)
    What's the console method for showing the player/object's name above it's shape? I thought it used to be NickName.... but can't seem to find it anywhere.
    #6
    08/01/2009 (1:35 pm)
    Technically/Historically:
    %player.setShapeName(%name);
    but I'm not sure it's auto hooked up to display anymore.
    #7
    08/02/2009 (12:19 pm)
    setShapeName() will work. But in order to see it displayed on the screen you need to have a GuiShapeNameHud ctrl attached to your playGui -- in Torque3D only the FPS Genre Kit has a GuiShapeNameHud.