Author Topic: Permanent Placeable Name Changes.  (Read 310 times)

Legacy_Kingdom_Of_Hearts

  • Full Member
  • ***
  • Posts: 142
  • Karma: +0/-0
Permanent Placeable Name Changes.
« on: September 15, 2012, 10:07:31 pm »


               Currently through a conversation we have the option to change the name of a placeable you are conversing with. We find that the name changes after we shut down the server, is there any way to make it last over server shut downs? Also have the same question about a horse NPC over resets. Aswell as a way to get around it changing the name of itself after being ridden, when it goes to "Charactername's Horse"
               
               

               
            

Legacy_henesua

  • Hero Member
  • *****
  • Posts: 6519
  • Karma: +0/-0
Permanent Placeable Name Changes.
« Reply #1 on: September 16, 2012, 12:09:42 am »


               If the placeable is spawned by script, you could make the name persistent.

The trick is to store the name in a database, and associate it with the placeable. In the same script that spawns the placeable, you would look up the name for the placeable in the database and then set the placeable's name after it is created.

Also, when the PC is changing the name for the placeable in your conversation, update the name in your database.

--

I did a similar thing with NESS for my module. You can specify spawn scripts when you use NESS, and so I was using those on placeables to change their name immediately after spawn. This is necessary because placeables do not have a built in OnSpawn event like creatures do.
               
               

               
            

Legacy_Kingdom_Of_Hearts

  • Full Member
  • ***
  • Posts: 142
  • Karma: +0/-0
Permanent Placeable Name Changes.
« Reply #2 on: September 16, 2012, 12:48:12 am »


               They aren't spawned by a script. They are put in the module before hand. They are signs to player ownable homes. I'm not sure how to script the name storing in a database or any of that, if somebody could assist me, that would be fantastic.
               
               

               
            

Legacy_Lightfoot8

  • Hero Member
  • *****
  • Posts: 4797
  • Karma: +0/-0
Permanent Placeable Name Changes.
« Reply #3 on: September 16, 2012, 12:56:52 am »


               You do not really need a OnSpawn script. You can use the HB script on the instance of the object to:

1) create a new instance of the object at the same location. ( basicly the same object without the HB )

2) Change the name of the new instance to the name stored in the DB.

3) Destroy Self. ( The instance with the HB)

EDIT:  There is a thread in here some that covers just about the topic.  Let me see if I can find it.

I just bumped it.  Persistant placeables 
               
               

               


                     Modifié par Lightfoot8, 16 septembre 2012 - 12:08 .
                     
                  


            

Legacy_Kingdom_Of_Hearts

  • Full Member
  • ***
  • Posts: 142
  • Karma: +0/-0
Permanent Placeable Name Changes.
« Reply #4 on: September 16, 2012, 01:39:35 am »


               Thanks!