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

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » zMUD General Discussion
ckentlea
Newbie


Joined: 22 Aug 2003
Posts: 3
Location: United Kingdom

PostPosted: Fri Aug 22, 2003 7:32 pm   

What else do i need to add
 
I'm working a database populator for Gondor and I think I figured out most the triggers i need execpt hpw to start the ident/dabse process AND saving the dbase

This is what I have so far

-----------------------

Dbase creation for Zmud

Field names Type Trigger done Notes
name Text *
type Option * Allow Others
extra Text *
weight Num *
value Num *
level Num *
damage Text *
avgdam text *
wFlags Option * Allow others
saves Num *
acp Num * Armor Pierce
acb Num * Armor Bash
acs Num * Armor Slash
acm Num * Armor vs Magic
str Num *
int Num *
wis Num *
dex Num *
con Num *
hr Num *
dr Num *
hp Num *
mana Num *
moves Num *
charges Num * Charges
scharge Text * Spell charged
slevel Num * Spell level
Notes Text n/a






Triggers
#TRIGGER {'Weapons flags:(%d)}
#ADDKEY newrecord wflags %1

#TRIGGER {^Object (%d) is type (d%), extra (%d).}
#ADDKEY newrecord name %1
#ADDKEY newrecord type %2
#ADDKEY newrecord extra %3


#TRIGGER {^Has (%d)~(%d~) charges of level (%d) ~'(*)~'.$}
#ADDKEY newrecord charges %1
#ADDKEY newrecord slevel %2
#ADDKEY newrecord scharge {%3}


#TRIGGER {^Level (%d) spells of: ~'(*)~'.$}
#ADDKEY newRecord slevel %1
#ADDKEY newRecord scharge %replace( {%2}, "' '", "|")

#TRIGGER {^Armor class is (%d).$} {#ADDKEY newrecord AC %1}
#TRIGGER {^Affects hp by (%n).$} {#ADDKEY newRecord hp %1}
#TRIGGER {^Affects dexterity by (%n).$} {#ADDKEY newRecord dex %1}
#TRIGGER {^Affects strength by (%n).$} {#ADDKEY newRecord str %1}
#TRIGGER {^Affects constitution by (%n).$} {#ADDKEY newRecord con %1}
#TRIGGER {^Affects luck by (%n).$} {#ADDKEY newRecord luck %1}
#TRIGGER {^Affects intelligence by (%n).$} {#ADDKEY newRecord int %1}
#TRIGGER {^Affects wisdom by (%n).$} {#ADDKEY newRecord wis %1}
#TRIGGER {^Affects charisma by (%n).$} {#ADDKEY newRecord char %1}
#TRIGGER {^Affects mana by (%n).$} {#ADDKEY newRecord mana %1}
#TRIGGER {^Affects moves by (%n).$} {#ADDKEY newRecord mv %1}
#TRIGGER {^Affects damage roll by (%n).$} {#ADDKEY newRecord dam %1}
#TRIGGER {^Affects hit roll by (%n).$} {#ADDKEY newRecord hit %1}
#Trigger {^Affects saves by(%n).$}{#ADDKEY newrecord saves %1}

#TRIGGER {^Its weight is (%d), value is (%d), and level is (%d).$}
#ADDKEY newRecord Weight %1
#ADDKEY newRecord Value %2
#ADDKEY newRecord Level %3

#TRIGGER {^Damage is (%d) ~(average (%d)~).$}
#ADDKEY newrecord damage %1
#ADDKEY newrecord avgdam %2

#TRIGGER {^Armor class is (%d) pierce, (%d) bash, (%d) slash, and (%d) vs. magic.}
#ADDKEY newrecord ACP %1
#ADDKEY newrecord ACB %2
#ADDKEY newrecord ACS %3
#ADDKEY newrecord ACM %4
-------------------
I just dont know what to do now....
Reply with quote
Troubadour
GURU


Joined: 14 Oct 2000
Posts: 556
Location: USA

PostPosted: Fri Aug 22, 2003 7:54 pm   
 
To stuff the data into the database, I like to create an alias:

#ALIAS addnewrecord {#DBLOAD Eq; #NEW All @newrecord; #DBRESET}

and call the alias using a temp trigger. The temp trigger is created by the first line of the information.

#TRIGGER {^Object (%d) is type (d%), extra (%d).} {
#VARIABLE newrecord ""
#ADDKEY newrecord name %1
#ADDKEY newrecord type %2
#ADDKEY newrecord extra %3
#TEMP tmptrigid {^$} {#T-tmptrigid; addnewrecord}
}

The temporary trigger fires when it hits the first blank line after the item info.

You might also want to store the source (area/mob) of the item. A #PROMPT statement in addnewrecord works well for that.
Reply with quote
ckentlea
Newbie


Joined: 22 Aug 2003
Posts: 3
Location: United Kingdom

PostPosted: Fri Aug 22, 2003 8:32 pm   
 
Tried it...but it didnt seem to work...i had the dbase open and a dummy record in the first entry...but nothing
Reply with quote
ckentlea
Newbie


Joined: 22 Aug 2003
Posts: 3
Location: United Kingdom

PostPosted: Fri Aug 22, 2003 8:52 pm   
 
These are the triggers/allias i have...they are all in the main folder
------------------------------------------------------

#ALIAS addnewrecord {#DBLOAD Eq;;#NEW All @newrecord;;#DBRESET}

#ALIAS ident {cast identify}

#TRIGGER {XXX^Object (%d) is type (d%), extra (%d)} {#VARIABLE newrecord "";#ADDKEY newrecord name %1;#ADDKEY newrecord type %2;#ADDKEY newrecord extra %3;#TEMP tmptrigid {^$} {#T- tmptrigid;addnewrecord}}
#TRIGGER {^Affects charisma by (%n).$} {#ADDKEY newrecord char %1}
#TRIGGER {^Affects constitution by (%n).$} {#ADDKEY newrecord con %1}
#TRIGGER {^Affects damage roll by (%n).$} {#ADDKEY newrecord dam %1}
#TRIGGER {^Affects dexterity by (%n).$} {#ADDKEY newrecord dex %1}
#TRIGGER {^Affects hit roll by (%n).$} {#ADDKEY newrecord hit %1}
#TRIGGER {^Affects hp by (%n).$} {#ADDKEY newrecord hp %1}
#TRIGGER {^Affects intelligence by (%n).$} {#ADDKEY newrecord int %1}
#TRIGGER {^Affects luck by (%n).$} {#ADDKEY newrecord luck %1}
#TRIGGER {^Affects mana by (%n).$} {#ADDKEY newrecord mana %1}
#TRIGGER {^Affects moves by (%n).$} {#ADDKEY newrecord mv %1}
#TRIGGER {^Affects saves by(%n).$} {#ADDKEY newrecord saves %1}
#TRIGGER {^Affects strength by (%n).$} {#ADDKEY newrecord str %1}
#TRIGGER {^Affects wisdom by (%n).$} {#ADDKEY newrecord wis %1}
#TRIGGER {^Armor class is (%d) pierce, (%d) bash, (%d) slash, and (%d) vs. magic.} {#ADDKEY newrecord acp %1;#ADDKEY newrecord acb %2;#ADDKEY newrecord acs %3;#ADDKEY newrecord acm %4}
#TRIGGER {^Has (%d)~(%d~) charges of level (%d) ~'(*)~'.$} {#ADDKEY newrecord charges %1;#ADDKEY newrecord slevel %2;#ADDKEY newrecord scharge %3}
#TRIGGER {^Level (%d) spells of: ~'(*)~'.$} {#ADDKEY newRecord slevel %1;#ADDKEY newRecord scharge %replace( {%2}, "' '", "|")}
#TRIGGER {^Object (%d) is type (d%), extra (%d).}} {#ADDKEY newrecord name %1;#ADDKEY newrecord type %2;#ADDKEY newrecord extra %3}
#TRIGGER {^Weapons flags:(%d)} {#ADDKEY newrecord wflags %1}
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » zMUD 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