Game Development Community

Setting Shape Name

by Spencer Strombotne · in Technical Issues · 07/14/2008 (1:45 pm) · 4 replies

Is there anyway to set the shapename of an object somewhere in it's datablock instead of using the setShapeName when it's spawned?

#1
07/14/2008 (2:32 pm)
Some datablock fun-facts:
* the information in a datablock is static; it can't be changed once the program has started
* the information in a datablock is applied to all objects which use that datablock

these two together imply that you couldn't use datablocks to set the shape name of particular objects.

what's wrong with setShapeName() ? you can call that any time you like, not just when the object is spawned.
are you trying to avoid calling setShapeName() at all ?
try giving a name to the object in the mission file, like:
new Player("My Player Name") {
  blah blah blah;
};
#2
07/15/2008 (7:49 am)
Where would I use setShapeName() if not when the object is spawned? It is an npc that just needs to stand there to be clicked on.
#3
07/15/2008 (8:44 am)
Spencer, i'm not sure what you're trying to achieve,
but if all you want is the easiest way to have a particular name show up above the head of an NPC,
just edit the mission file with a text editor and make your NPC look like this:
new AIPlayer(IkeThePoolGuy) {             // <------------- put the name you want in there.
         position = <whatever>;
         rotation = <whatever>;
         scale = <whatever>;
         dataBlock = <whatever>;
      };
#4
03/07/2009 (11:21 am)
Does anybody know how to respawn an object when a trigger is trip