Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD General Discussion
teion
Wanderer


Joined: 03 May 2005
Posts: 72

PostPosted: Wed Jan 28, 2015 10:40 pm   

database questions
 
Hi I am new to using databases but I would like to make 2 databases 1 for NPC (mobs) and the other for Quests.

I want the npc database to contain the fields Name Type and Location
for example one such entry would be wise man Healer 43067

where wise man is the name, healer is the type and 43067 is the location of the npc on the map i use



I would like to be able to query the database from the command line and have the results shown. should I use the
old database or sql database for queries. Which is faster and does it matter
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4715
Location: Pensacola, FL, USA

PostPosted: Wed Jan 28, 2015 10:52 pm   
 
You might want to consider a database variable instead.
They are quicker to access i believe, and easier (for me at least) to manipulate.

$thisMob=wise man
#ADDKEY mobs.${thisMob} Type Healer
#ADDKEY mobs.${thisMob} Location 43067
_________________
Discord: Shalimarwildcat
Reply with quote
teion
Wanderer


Joined: 03 May 2005
Posts: 72

PostPosted: Wed Jan 28, 2015 11:00 pm   
 
am I limited on the number of keys I can add to a database? Additionally for the database Quests I will have three fields - the last field will be the notes field which will contain a fairly large amount of data.

Would a database variable suffice for something like this


Last edited by teion on Wed Jan 28, 2015 11:03 pm; edited 1 time in total
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4715
Location: Pensacola, FL, USA

PostPosted: Wed Jan 28, 2015 11:02 pm   
 
I am sure there is some practical limit... but i have had databases several layers deep, and thousands wide.
_________________
Discord: Shalimarwildcat
Reply with quote
Scarn
Apprentice


Joined: 24 Jul 2005
Posts: 137

PostPosted: Sun Mar 01, 2015 10:28 pm   
 
Say I have:

#ADDITEM People.Scarn Race=edain
#ADDITEM People.Scarn Profession=warrior
#ADDITEM People.Scarn PvP=on
#ADDITEM People.Scarn AFK=no

How can I replace items within the variable, I have tried %replaceitem but to no avail.

#CALL %replaceitem(wizard, @People.Scarn.Profession)

Any ideas?
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4715
Location: Pensacola, FL, USA

PostPosted: Sun Mar 01, 2015 11:10 pm   
 
#ADDKEY not #ADDITEM, and it overwrites.
_________________
Discord: Shalimarwildcat
Reply with quote
Scarn
Apprentice


Joined: 24 Jul 2005
Posts: 137

PostPosted: Mon Mar 02, 2015 3:46 am   
 
Super, thank you.
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD General Discussion All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

© 2009 Zugg Software. Hosted by Wolfpaw.net