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
DarkKnight0002
Beginner


Joined: 21 Jan 2002
Posts: 10
Location: USA

PostPosted: Sat Mar 03, 2007 1:56 am   

Database Triggers
 
I 've been trying the new client and I really like it so far, will buy it here shortly. However I'm running into an issue. dreating an auto database trigger.

Heres what my mud specifies for identiffies cast:

You feel informed:
Object 'silver plate neckguard', Item type: ARMOR
Item is: METAL RARE
Level: 30 Rest: !MAGE !THIEF !DRUID !PSI !RANGER !BARD >=30 !EVIL
Weight: 5, Value: 10000, Rent cost: 10000
AC-apply is 20 but is effectively 20
Can affect you as:
Affects: RESISTANCE By SLASH
Affects: ARMOR By -20

Just one item, but I can't seem to get anything to store properly. The only thing I've got working is putting each item in its own variable, but even then I
can't get it into a record on the database.

Appreciate any help I can get.
Reply with quote
DarkKnight0002
Beginner


Joined: 21 Jan 2002
Posts: 10
Location: USA

PostPosted: Sat Mar 03, 2007 5:06 pm   
 
Ok,

So I got it all working except one thing. The

Can Affect you as:
Affects: ect
Affects: ect

It seems it wants to only store one affects in the db and I don't have any clue how to add multiple values there
Reply with quote
Arminas
Wizard


Joined: 11 Jul 2002
Posts: 1265
Location: USA

PostPosted: Sat Mar 03, 2007 5:22 pm   
 
Try a string list inside the value of the key named effects.

Make the list

#addkey variable {Thingaffects=(one|two|three)}


Get the list out

#show %db(@variable,thingaffects)

Then you can use the list functions and commands to pull out what you want.

#show %item(%db(@variable,thingaffects),1)

Enjoy
_________________
Arminas, The Invisible horseman
Windows 7 Pro 32 bit
AMD 64 X2 2.51 Dual Core, 2 GB of Ram
Reply with quote
DarkKnight0002
Beginner


Joined: 21 Jan 2002
Posts: 10
Location: USA

PostPosted: Sat Mar 03, 2007 5:46 pm   
 
Thats definately helpful, but I'm looking for a trigger format sorry I wasn't clear. Unfortunately each Affects: is on a new line, so it just keeps replacing the old value instead of adding too it.
Reply with quote
Arminas
Wizard


Joined: 11 Jul 2002
Posts: 1265
Location: USA

PostPosted: Sat Mar 03, 2007 7:25 pm   
 
Take the same trigger that you are capturing it with, and...

#addkey variable {Thingaffects=(%additem(%1,%db(@variable,thingaffects)))}

This will fix the overwriting problem you have been having.
_________________
Arminas, The Invisible horseman
Windows 7 Pro 32 bit
AMD 64 X2 2.51 Dual Core, 2 GB of Ram
Reply with quote
DarkKnight0002
Beginner


Joined: 21 Jan 2002
Posts: 10
Location: USA

PostPosted: Sat Mar 03, 2007 8:15 pm   
 
Wow that works wonders :) Thanks.

Not pretty but that I really dont care about at this moment :) I owe you alot
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