The scene is based on 1800s northeast Alabama on Sand Mountain, a plateau 70 miles long rising 700 feet and running to the northeast. There was a wilderness there the Indians called the Big Woods.
This document is a collection of my notes and thoughts as I learn building at DragonMUD.
All the Best of Life,
Malan
(Northeast Tower, Room 308)
o---? u o---o---o o d |\ | o o o o C---o \ / |/ / \ o o o o--o \ | \ | o | \| | o-------o-------o
if else if
-chain construct.if
-sequence construct.Locks and effects provide you with certain conventional programming constructs. I'm sure I have not discovered them all, but the following are a few I have noticed.
An action's Lock and its effects provide an if
construct.
// Basic Action if (action.lock) { show action.succ show action.osucc eval action.effect[1] ... eval action.effect[n] if (action.isExit) { goto exit.destination } } else { show action.fail show action.ofail }
Multiple actions with the same first name provide an if else if
construct. However, there is an interesting twist to this such that the following pseudo code is not exactly correct. The action actually executed (successful) will be chosen at random from all the actions whose locks eval to true [some wiz please tell me if i'm right or wrong about this]. If all the actions' locks eval to false then only the last action's fail and ofail messages will be displayed. So... I don't really know yet how to show all this with simple pseudocode.
// Alternate Actions if (action[1].lock) { // same as above } else if (action[n].lock) { // same as above } else { show action[n].fail show action[n].ofail }
Lock's on groups provide a sequence of if
constructs.
// Group Filters on an Action's Effects if (action.lock) { show action.succ show action.osucc for (i = 1; i < action.effect.length; ++i) { if (action.effect[i].group.filter_lock) { if (action.effect[i].op == 'ADD') { add action.effect[i].group : action.effect.target show action.effect[i].group.succ } else if (action.effect[i].op == 'REM') { remove action.effect[i].group : action.effect.target show action.effect[i].group.fail } } else { // does anything happen here? } } if (action.isExit) { goto exit.destination } } else { show action.fail show action.ofail }
Here are some DragonMUD toys that I've built:
This implements the CAA pattern. It requires the player to call for help three times. On the third call the player receives help.
@action call for help;call help;call;help;call0=here @action call for help;call help;call;help;call1=here @action call for help;call help;call;help;call2=here @set call0=sticky,dark @set call1=sticky,dark @set call2=dark @lock call0 = !+nightmode & +talisa.brokenleg & !call0 @lock call1 = !+nightmode & +talisa.brokenleg & !call1 & call0 @lock call2 = !+nightmode & +talisa.brokenleg & call1 @succ call2 = Talisa hears you and climbs down the cliff to help you. She cleans your wounds, gives you water and then becomes very still and silent for a long time. Your pain stops and you fall asleep. When you awake Talisa is gone and... @fail call2 = It seems that Talisa is not on the slope now. @eff call2 = rem +talisa.brokenleg @eff call2 = add +talisa.friend @eff call2 = rem call0 @eff call2 = rem call1
I tried this with both the CAA and CGF patterns. I settled on using CAA. It provides chained/sequential messages. Each time the player "listens" they hear the next message until all have been heard, then the process repeats.
" 'listen to Menawa' using the CAA technique @action listen to menawa;listen menawa;listen;ltm;lm;lm0=here @action listen to menawa;listen menawa;listen;ltm;lm;lm1=here @action listen to menawa;listen menawa;listen;ltm;lm;lm2=here @action listen to menawa;listen menawa;listen;ltm;lm;lm3=here @action listen to menawa;listen menawa;listen;ltm;lm;lm4=here @set lm0=sticky,dark @set lm1=sticky,dark @set lm2=sticky,dark @set lm3=sticky,dark @set lm4=dark @lock lm0 = +nightmode & !lm0 @lock lm1 = +nightmode & !lm1 & lm0 @lock lm2 = +nightmode & !lm2 & lm1 & lm0 @lock lm3 = +nightmode & !lm3 & lm2 & lm1 & lm0 @lock lm4 = +nightmode & lm3 @succ lm0 = We are on... @succ lm1 = The mount... @succ lm2 = The white... @succ lm3 = In these ... @succ lm4 = There is ... @fail lm4 = The dayti... @eff lm4 = rem lm0 @eff lm4 = rem lm1 @eff lm4 = rem lm2 @eff lm4 = rem lm3 @eff lm4 = add +menawa.listener " 'listen to Menawa' using the CGF technique @makegroup menawa.msg1 @set menawa.msg1 = !tattle,dark @makegroup menawa.msg2 @set menawa.msg2 = !tattle,dark @makegroup menawa.msg3 @set menawa.msg3 = !tattle,dark @makegroup menawa.msg4 @set menawa.msg4 = !tattle,dark @makegroup menawa.msgend @set menawa.msgend = !tattle,dark @succ +menawa.msg1 = We are the last of the ... @succ +menawa.msg2 = Our enemies have set tr... @succ +menawa.msg3 = We are on the southern ... @succ +menawa.msg4 = There is a spring to th... @succ +menawa.msgend = There is an extra bed... @fail +menawa.msgend = Again? Very well... @lock +menawa.msg1 = me ; #0 ; menawa.msgend | !+menawa.msg1 @lock +menawa.msg2 = me ; #0 ; menawa.msgend | (+menawa.msg1 & !+menawa.msg2) @lock +menawa.msg3 = me ; #0 ; menawa.msgend | (+menawa.msg1 & +menawa.msg2 & !+menawa.msg3) @lock +menawa.msg4 = me ; #0 ; +menawa.msgend | (+menawa.msg1 & +menawa.msg2 & +menawa.msg3 & !+menawa.msg4) @lock +menawa.msgend = me;#0 ; +menawa.msgend | (+menawa.msg1 & +menawa.msg2 & +menawa.msg3 & +menawa.msg4) @action listen to menawa;listen menawa;ltm;lm = here @lock lm = +nightmode @fail lm = menawa is not here now. @succ lm = You listen closely to menawa... @eff lm = toggle +menawa.msgend @eff lm = toggle +menawa.msg4 @eff lm = toggle +menawa.msg3 @eff lm = toggle +menawa.msg2 @eff lm = toggle +menawa.msg1
This ball can be thrown back and forth between two rooms. In this case the rooms are Camp and Clearing. You need two players to see all the effects.
" While in Clearing create the ball and an action to throw it up to the Camp: @create toli ball @set toli ball = copy @lock toli ball = ! toli ball ; ! toli ball @desc toli ball = A ball used in kapucha toli ("ball play") - the little brother to war. @hint toli ball = you need a ball to throw @warn toli ball = drop the ball @link toli ball = here @action throw the ball;throw ball;throw;tbnw = here @set tbnw = dark @lock tbnw = toli ball @fail tbnw = Throw what? @succ tbnw = You throw the ball up to the camp. @ofail tbnw = pretends to throw a ball. @osucc tbnw = throws the ball up to the camp. @eff tbnw = rem toli ball @eff tbnw = rem toli ball : here " #37766 is Camp @eff tbnw = add toli ball : #37766 @eff tbnw = notify #37766. " While in Camp create an action to throw the ball down the slope: @action throw the ball;throw ball;throw;tbse = here @set tbse = dark @lock tbse = toli ball @fail tbse = Throw what? @succ tbse = You throw the ball down the slope. @ofail tbse = pretends to throw a ball. @osucc tbse = throws the ball down the slope. @eff tbse = rem toli ball @eff tbse = rem toli ball : here " #37967 is Clearing @eff tbse = add toli ball : #37967 @eff tbse = notify #37967
This implements the MEAA pattern. A specific message is displayed only when a specific condition is true. It does not provide chained (sequential) messages.
@action listen to Talisa;listen talisa;listen;ltt;lt;lt0 = here @set lt0 = dark @lock lt0 = +snake.bite1 @succ lt0 = You must act ... @action listen to Talisa;listen talisa;listen;ltt;lt;lt1 = here @set lt1 = dark @lock lt1 = +talisa.friend & !+snake.bite1 @succ lt1 = Have you seen ... @action listen to Talisa;listen talisa;listen;ltt;lt;lt2 = here @set lt2 = dark @lock lt2 = !+snake.bite1 & !+talisa.friend @succ lt2 = You should take ...
This is a combination of two patterns I've been playing with: CAA+GF. It gives the player "memories" by looking at the player's group memberships. It provides the memories in three sets of three. The display of the sets is chained, and group filters are used to conditionally display the individual memories.
" Remember in Spring of Memories @makegroup spring.mem0 @set spring.mem0 = !tattle,dark @makegroup spring.mem1 @set spring.mem1 = !tattle,dark @makegroup spring.mem2 @set spring.mem2 = !tattle,dark @makegroup spring.mem3 @set spring.mem3 = !tattle,dark @makegroup spring.mem4 @set spring.mem4 = !tattle,dark @makegroup spring.mem5 @set spring.mem5 = !tattle,dark @makegroup spring.mem6 @set spring.mem6 = !tattle,dark @makegroup spring.mem7 @set spring.mem7 = !tattle,dark @makegroup spring.mem8 @set spring.mem8 = !tattle,dark " Group Succ @succ +spring.mem0 = ...climbing trees @succ +spring.mem1 = ...easy money @succ +spring.mem2 = ...the depths of chaos @succ +spring.mem3 = ...a deep mud @succ +spring.mem4 = ...travel to the stars @succ +spring.mem5 = ...toad death @succ +spring.mem6 = ...understanding @succ +spring.mem7 = ...loving sex @succ +spring.mem8 = ...inner conflict " Group Locks @lock +spring.mem0 = me ; #0 ; +In Robore Virtus @lock +spring.mem1 = me ; #0 ; +Thief @lock +spring.mem2 = me ; #0 ; +Chaos Scholar @lock +spring.mem3 = me ; #0 ; +Muddy! & +DeepVisitors @lock +spring.mem4 = me ; #0 ; +Stargazers @lock +spring.mem5 = me ; #0 ; +Toaded & +Stone Cold Dead @lock +spring.mem6 = me ; #0 ; +Philosopher @lock +spring.mem7 = me ; #0 ; +Sex Slave @lock +spring.mem8 = me ; #0 ; +Chaos Scholar & +Bound to Order " Action r0 @action remember;r0 = here @set r0 = dark,sticky @lock r0 = !r0 @succ r0 = You ride the first of three ripples, and you remember... @osucc r0 = is in a trance. @eff r0 = add +spring.mem0 @eff r0 = add +spring.mem1 @eff r0 = add +spring.mem2 @eff r0 = rem +spring.mem0 @eff r0 = rem +spring.mem1 @eff r0 = rem +spring.mem2 " Action r1 @action remember;r1 = here @set r1 = dark,sticky @lock r1 = !r1 & r0 @succ r1 = Up the second ripple, and you remember... @osucc r1 = is in a deep trance. @eff r1 = add +spring.mem3 @eff r1 = add +spring.mem4 @eff r1 = add +spring.mem5 @eff r1 = rem +spring.mem3 @eff r1 = rem +spring.mem4 @eff r1 = rem +spring.mem5 " Action r2 @action remember;r2 = here @set r2 = dark @lock r2 = r1 @succ r2 = Over the crest of the third ripple, and you remember... @osucc r2 = is one with the water. @eff r2 = add +spring.mem6 @eff r2 = add +spring.mem7 @eff r2 = add +spring.mem8 @eff r2 = rem +spring.mem6 @eff r2 = rem +spring.mem7 @eff r2 = rem +spring.mem8 @eff r2 = rem r0 @eff r2 = rem r1
The structure above has the potential for interesting applications. Instead of chaining the actions, they could be mutually exclusive, or random, or a combination of the two. The group filters could be chained or could be mutually exclusive in some other way.