--- orig/rpggame/rpg.cpp
+++ mod/rpggame/rpg.cpp
@@ -135,7 +135,7 @@
     {
         glLoadIdentity();
         glOrtho(0, w*2, h*2, 0, -1, 1);
-        draw_textf("using: %s", 636*2, h*2-256+149, os.playerobj->selected ? os.playerobj->selected->name : "(none)");       // temp
+        draw_textf("using: %s", 636*2, h*2-256+149, os.playerobj->selected ? os.playerobj->selected->dispname : "(none)");       // temp
 
         glLoadIdentity();
         glOrtho(0, w, h, 0, -1, 1);


--- orig/rpggame/rpgobj.h
+++ mod/rpggame/rpgobj.h
@@ -42,6 +42,7 @@
     rpgent *ent;        // representation in the world, if top level
 
     const char *name;   // name it was spawned as
+    const char *dispname;// name to display
     const char *model;  // what to display it as
 
     enum
@@ -78,7 +79,7 @@
     #define loopinventory() for(rpgobj *o = inventory; o; o = o->sibling)
     #define loopinventorytype(T) loopinventory() if(o->itemflags&(T))
 
-    rpgobj(const char *_name, rpgobjset &_os) : parent(NULL), inventory(NULL), sibling(NULL), selected(NULL), ent(NULL), name(_name), model(NULL), itemflags(IF_INVENTORY),
+    rpgobj(const char *_name, rpgobjset &_os) : parent(NULL), inventory(NULL), sibling(NULL), selected(NULL), ent(NULL), name(_name), dispname(_name), model(NULL), itemflags(IF_INVENTORY),
         actions(NULL), abovetext(NULL), menutime(0), menutab(1), menuwhich(MENU_DEFAULT), os(_os) {}
 
     ~rpgobj()
@@ -191,7 +192,7 @@
     {
         for(rpgaction *a = actions; a; a = a->next) if(strcmp(a->initiate, initiate)==0) return;
         actions = new rpgaction(initiate, script, actions);
-        if(startquest) os.addquest(actions, abovetext, name);
+        if(startquest) os.addquest(actions, abovetext, dispname);
     }
 
     void delaction(char *initiate)
@@ -277,7 +278,7 @@
             ent->attacking = false;
             ent->lastaction = os.cl.lastmillis;
             menutime = 0;
-            conoutf("%s killed: %s", attacker.name, name);
+            conoutf("%s killed: %s", attacker.dispname, dispname);
             droploot();
         }
     }
@@ -310,7 +311,7 @@
 
         if(s_usetype)
         {
-            if (target==os.playerobj) conoutf("\f2using: %s", name);
+            if (target==os.playerobj) conoutf("\f2using: %s", dispname);
             target->selected = this;
         }
         else if (s_ai & AI_CHAR)
@@ -338,7 +339,7 @@
         {
             case MENU_DEFAULT:
             {
-                g.tab(name, 0xFFFFFF);
+                g.tab(dispname, 0xFFFFFF);
                 if(abovetext) g.text(abovetext, 0xDDFFDD);
 
                 guiaction(g, actions);
@@ -359,7 +360,7 @@
                     g.text(wtext, 0xAAAAAA, "coins");
                     if(g.button("take", 0xFFFFFF, "hand")&G3D_UP)
                     {
-                        conoutf("\f2you take a %s (worth %d gold)", name, s_worth);
+                        conoutf("\f2you take a %s (worth %d gold)", dispname, s_worth);
                         os.take(this, os.playerobj);
                     }
                     if(!s_usetype && g.button("use", 0xFFFFFF, "hand")&G3D_UP)
@@ -372,18 +373,18 @@
 
             case MENU_BUY:
             {
-                s_sprintfd(info)("buying from: %s", name);
+                s_sprintfd(info)("buying from: %s", dispname);
                 g.tab(info, 0xFFFFFF);
                 loopinventorytype(IF_TRADE)
                 {
                     int price = o->s_worth;
-                    s_sprintfd(info)("%s (%d)", o->name, price);
+                    s_sprintfd(info)("%s (%d)", o->dispname, price);
                     int ret = g.button(info, 0xFFFFFF, "coins");
                     if(ret&G3D_UP)
                     {
                         if(os.playerobj->s_gold>=price)
                         {
-                            conoutf("\f2you bought %s for %d gold", o->name, price);
+                            conoutf("\f2you bought %s for %d gold", o->dispname, price);
                             os.playerobj->s_gold -= price;
                             s_gold += price;
                             o->decontain();
@@ -403,7 +404,7 @@
 
             case MENU_SELL:
             {
-                s_sprintfd(info)("selling to: %s", name);
+                s_sprintfd(info)("selling to: %s", dispname);
                 g.tab(info, 0xFFFFFF);
                 os.playerobj->invgui(g, this);
                 if(g.button("done selling", 0xFFFFFF, "coins")&G3D_UP) menuwhich = MENU_DEFAULT;
@@ -418,7 +419,7 @@
         loopinventorytype(IF_TRADE|IF_INVENTORY)
         {
             int price = o->s_worth/2;
-            s_sprintfd(info)("%s (%d)", o->name, price);
+            s_sprintfd(info)("%s (%d)", o->dispname, price);
             int ret = g.button(info, 0xFFFFFF, "coins");
             if(ret&G3D_UP)
             {
@@ -426,13 +427,13 @@
                 {
                     if(price>buyer->s_gold)
                     {
-                        conoutf("\f2%s cannot afford to buy %s from you!", buyer->name, o->name);
+                        conoutf("\f2%s cannot afford to buy %s from you!", buyer->dispname, o->dispname);
                     }
                     else
                     {
                         if(price)
                         {
-                            conoutf("\f2you sold %s for %d gold", o->name, price);
+                            conoutf("\f2you sold %s for %d gold", o->dispname, price);
                             s_gold += price;
                             buyer->s_gold -= price;
                             o->decontain();
@@ -440,7 +441,7 @@
                         }
                         else
                         {
-                            conoutf("\f2you cannot sell %s", o->name);
+                            conoutf("\f2you cannot sell %s", o->dispname);
                         }
                     }
                 }


--- orig/rpggame/rpgobjset.h
+++ mod/rpggame/rpgobjset.h
@@ -89,6 +89,8 @@
         CCOMMAND(r_npcstate,    "i",   (rpgobjset *self, int *d), { if (self->stack[0]->ent) self->stack[0]->ent->npcstate = *d; });
         CCOMMAND(r_get_npcstate,"",    (rpgobjset *self), { if (self->stack[0]->ent) intret(self->stack[0]->ent->npcstate); });
         CCOMMAND(r_dist,        "",    (rpgobjset *self), { if (self->stack[0]->ent && self->stack[1]->ent) floatret(self->stack[1]->ent->r_dist(*self->stack[0]->ent)); });
+        CCOMMAND(r_get_dispname,"",    (rpgobjset *self), { if (self->stack[0]->dispname) result(self->stack[0]->dispname); });
+        CCOMMAND(r_dispname,    "s",   (rpgobjset *self, char *name), { self->stack[0]->dispname = self->stringpool(name); });
         clearworld();
     }
 
@@ -195,7 +197,7 @@
         if(o)
         {
             stack[0]->add(o, o->IF_INVENTORY);
-            conoutf("\f2you hand over a %s", o->name);
+            conoutf("\f2you hand over a %s", o->dispname);
             if(currentquest)
             {
                 if (!silent) conoutf("\f2you finish a quest for %s", currentquest->npc);
@@ -210,7 +212,7 @@
         rpgobj *o = stack[0]->take(name);
         if(o)
         {
-            if (!silent) conoutf("\f2you receive a %s", o->name);
+            if (!silent) conoutf("\f2you receive a %s", o->dispname);
             playerobj->add(o, o->IF_INVENTORY);
         }
     }



