Database strings

07/17/2011 10:55 Ranma014#1
I got a question about strings stored in the database. I was trying to insert new places into the teleport npcs and also tried to correct those "empty string" shop npcs, that are in the latest server release.
First lets start off with the teleporter.
I edited "NPC Teleport Town (2455194ffb3cb3515526cb9e195a8371).lua"
and inserted new location in the Asura Katan teleporter. I tried these 4:

Code:
 dlg_menu( "@90700000", 'RunTeleport( 100000 , 219257 , 15681 )' ) --Lost Mine 1
      dlg_menu( "@90700001", 'RunTeleport( 100000 , 219257 , 112449 )' ) --Lost Mine 2
      dlg_menu( "Crytal Valley 1", 'RunTeleport( 200000 , 218806 , 56778 )' ) --Crystal Valley 1
      dlg_menu( "@90200505", 'RunTeleport( 200000 , 218806 , 89034 )' ) --Crystal Valley 2
The last one is a string that is already present: "Deva Laksy - 500R". The second to last is just a direkt string input. The other two are similar to the rest of the entries, which specify a string in the database. So I searched inside SringResources for another already present string and found 3 entries. Similar to these I added my own strings into an empty space that I specified above in the script. I used these commands:

Code:
INSERT INTO [Arcadia].[dbo].[StringResource]
(name, group_id, code, value) 
VALUES ('script_string_10017', 0, 90700000, 'Lost Mine 1 - 100000R')

INSERT INTO [Arcadia].[dbo].[StringResource]
(name, group_id, code, value) 
VALUES ('script_string_90700000', 0, 90700000, 'Lost Mine 1 - 100000R')

INSERT INTO [Arcadia].[dbo].[StringResource]
(name, group_id, code, value) 
VALUES ('script_string_10017', 0, 90700000, 'Lost Mine 1 - 100000R')
If I check these entries they look identical to those for all the working locations, but when I enter the game it still says "empty string" for those which I linked to the database. I searched for hours in the db if I missed anything, but I couldnt find another entry.

Now for my second problem, the npc names. I searched inside the NPCResources table for other working npc and took a look at how its working. All in all I found 4 places where the names are stored. First we got a string title, which I added exactly like those already present, with:

Code:
INSERT INTO [Arcadia].[dbo].[StringResource]
(name, group_id, code, value) 
VALUES ('npc_title_10015', 0, 100011010, 'GM Shop -')

INSERT INTO [Arcadia].[dbo].[StringResource]
(name, group_id, code, value) 
VALUES ('npc_title_100011010', 0, 100011010, 'GM Shop -')

INSERT INTO [Arcadia].[dbo].[StringResource]
(name, group_id, code, value) 
VALUES ('npc_title_10015', 0, 100011010, 'GM Shop -')
Second one is a name:

Code:
INSERT INTO [Arcadia].[dbo].[StringResource]
(name, group_id, code, value) 
VALUES ('npc_name_10016', 0, 105011010, 'Creature Cards')

INSERT INTO [Arcadia].[dbo].[StringResource]
(name, group_id, code, value) 
VALUES ('npc_name_105011010', 0, 105011010, 'Creature Cards')

INSERT INTO [Arcadia].[dbo].[StringResource]
(name, group_id, code, value) 
VALUES ('npc_name_10016', 0, 105011010, 'Creature Cards')
Now those values above are those displayed by the game above the NPC, which are "empty string:100011010" and "empty string:105011010".
Since it didnt work (just like with the teleporter script) I searched around the shop script. Inside "NPC Merchant_Etc (e711e712dccb2680b678e4496717677d) .lua" I found the script for the creature card seller:
Code:
   --============================================================
   --             <<<<<< Å©¸®ÃÄ Ä«µåÆÇ¸Å  NPC >>>>>>
   --============================================================
function NPC_Merchant_Creature_card_init()
	
	set_npc_name(  "@90100800"  )
end
 

function NPC_Merchant_Creature_card_contact()
cprint( "Creature Card Trader" )
 
	-- ´ÙÀ̾ó·Î±× Ãâ·Â
	dlg_title( "@90996973" )
	dlg_text( "@90996974" )

	-- game.cash_usable_server ? 1: ½ÃÅ©·çÆ® °ü·Ã ³»¿ë »ç¿ë ¼*¹ö  /  0: »ç¿ë ¾È ÇÏ´Â ¼*¹ö
	if get_env("game.cash_usable_server") == 1 then
		dlg_menu( "@90996975", "open_market( 'flat_sum_Creature_card'  )" )		--Á¤¾×Á¦ ¼*¹ö
	else
		dlg_menu( "@90996975", "open_market( 'Creature_card' )" )				--ºÎºÐÀ¯·áÈ* ¼*¹ö 
	end
	dlg_menu( "@90010002", '' )
 
	dlg_show()
 
end
I took a look at a working shop, like the devian etc shop. Inside its script it says "set_npc_name( "@90100700" )",which links to the database string "Merchant Christe". Additional to that there exist two other strings just the way I described above, which got the values "Merchant" and "Christe". So now I got three strings for one npc. I checked the creature shop script and found "set_npc_name( "@90100800" )". That string is already present: "Guide Prometh". A few other of these empty string shops got the same set_npc_name id. I tried to change it and add the needed strings again.
The forth link I found to the npc names was inside the NPCResources where it states a text_id and name_text_id, which correspond to the first added strings: "100011010" and "105011010", which say "GM Shop -" and "Creature Cards".
Now when I start the server and login to check the names it still says "empty string:100011010" and "empty string:105011010". So my question is, which arent those new entries read properly, or did I miss one? Basically its the same problem as with the teleporter, except I still got that confusing "set_npc_name( "@90100700" )" command, which seems to do nothing.

regard,
ranma.
07/17/2011 11:00 ironhammer500#2
the reason i think they say empty string is due to the client not having been updated sadly there no way to update the client atm.

ifu add custom teleports and npcs their names wont apear in the cleint coz that wont have the files for the new npcs and teleports so u get empty strings.
07/17/2011 11:02 Ranma014#3
Well if I add a direct string into the teleporter it works fine, so I thought the strings are sent by the server. If what you say is true, it would mean, that the client receives the string resource id and looks for it in its own databse instead for searching it in the servers databse. Then why are those strings stored inside the server database?
07/17/2011 11:07 ironhammer500#4
Quote:
Originally Posted by Ranma014 View Post
Well if I add a direct string into the teleporter it works fine, so I thought the strings are sent by the server. If what you say is true, it would mean, that the client receives the string resource id and looks for it in its own databse instead for searching it in the servers databse. Then why are those strings stored inside the server database?
something like that the client would have limited string names but display stuff is client sided so yea it would work like this

client -find this npc
server - searchs for npc name bob
server - send info about bob
client - gets info and searchs its database for bob
client - cant find bob so i giv him empty string


i think its all about client to server sync
07/17/2011 11:12 Ranma014#5
Well I figured it would be something like that, but its still obsolete to store those strings inside the server database. All the servers sends is the id entered inside the teleporter script. Now the client just has to look this up. the server doesnt need to know what it says exactly, it just need to know what to do when clicked. I just hoped there was another way, since those strings are inside the server database.
07/17/2011 11:18 ironhammer500#6
Well i dont think the client is able to access the server database coz well this would be to easy to hack so thats why i guess the server sends an id and info to the client to check a copy of the database it has.
07/17/2011 12:26 ironhammer500#7
Quote:
Originally Posted by Ne0@NCarbon View Post
Emptystring is a client issue and the string in db are required for a lot of things working.
It's a little bit more complicated than you think !!
i would imagine it is lol its rappelz....i doubt even nflavour know how the game works lmao, they kinda forget to tell new devs how stuff works so its just left =P
07/17/2011 19:31 Pyrok#8
So far the only real need for the strings to be server-side that I know of is for displaying the name of the mob when taming.