 |
xnomeda Newbie
Joined: 24 Nov 2009 Posts: 7
|
Posted: Wed Jul 11, 2012 12:24 am
Inline trigger w/variable help |
Ok, so I'm trying to make an EQ DB for my mud. Some of the lines in the identify result are such as
Affects: Hitroll by 1
Where Hitroll and 1 are variable depending on the stat. Is there any way to make a #Trigger Affects: (&Item.%1) by (&Item.%2) type of trigger statement? Where it would add hitroll=1 or charisma=2 depending on the Affect line? or some sort of inline #ADDITEM command? |
|
|
 |
Daern Sorcerer
Joined: 15 Apr 2011 Posts: 809
|
Posted: Wed Jul 11, 2012 1:25 am |
Not within the pattern, but you could just do something like #trigger {^Affects: (%w) by (%d)$} {#addkey item %1 %2}.
|
|
|
 |
xnomeda Newbie
Joined: 24 Nov 2009 Posts: 7
|
Posted: Wed Jul 11, 2012 11:54 pm |
Well, I was able to get {Affects: (&%%additem(Item.Affects))$} {} to work slightly, it wouldn't add to the Item.Affects list as much as it would just replace the variable with the latest Affect line. However using your suggestion I was able to get it to work as intended, thank you.
Now let me ask this: Would it be a better deign to try and create a field for each and every affect variable (ie a field for hitroll, a field for strength, etc)and add the modifiers per row to the fields that applied, or would it be better to just have a text list and use strings such as hitroll=1|charisma=2 and such in a single field? If it would be the single field, would it be best to just store a List variable into a text/memo field and parse it on search, or is there a better way? |
|
|
 |
Daern Sorcerer
Joined: 15 Apr 2011 Posts: 809
|
Posted: Thu Jul 12, 2012 2:19 am |
I think it would make much more sense to have a separate field for each stat, with your second option it would be a lot harder to search or filter your equipment, if you wanted to find pieces with a certain amount of hitroll, for example.
|
|
|
 |
Rahab Wizard
Joined: 22 Mar 2007 Posts: 2320
|
Posted: Thu Jul 12, 2012 3:26 pm |
As with any database design, it depends on how you intend to use the data. You should organize it according to how you intend to search it.
|
|
|
 |
|
|