On Fri, 14 Jan 2000, Brian Hartvigsen wrote: > I added POS_MEDITATE To my MUD it kept crashing because the mobfiles store > POS_STANDING as 8 adding POS_MEDITATE made standing PPOS_STANDING a 9 so I > had to go through EVERY .mob file and change any 8 8 (default and starting > POS) I did this by hand in Windows so I can't tell you how to do it for > your OS. Well, % sed s/"^8 8"/"9 9"/ xxx.mob > xxx.mob.new will do the replacement automatically. However, it'll also change some lines that it shouldn't. The changes are written into xxx.mob.new. After that, we'll want to compare the changes made to ensure that we didn't change anything that we shouldn't have. With the stock CircleMUD world, there are two lines that are modified that shouldn't be (one in 25.mob and one in 54.mob) that I saw. Needless to say, altering those two lines is much easier than altering a magnitude more for the same effect. Now the trick is to get this to run automatically and recursively on all mob files. How you do this depends upon your shell. With BASH, and thus probably most shells, % for f in *.mob ; do sed s/"^8 8"/"9 9"/ $f > $f.new ; done but in tcsh, you'll do, % foreach f ( *.mob ) and when you're prompted with "foreach?" do, foreach? sed s/"^8 8"/"9 9"/ $f > $f.new foreach? end If you don't care about errant changes, then just copy all of the .new files over the originals. If you do want to double-check, run "diff -u xxx.mob xxx.mob.new" to get a list of all changes (you might want to pipe this to 'less' or some other pagination program, since the output'll be over one page long in most cases). Note the changes (or save the output of 'diff' to a file), copy over the .new file, and manually revert bad changes. Like I said, there were only two in stock CircleMUD, and I think the only effect of replacing those "8 8"s was raising a mobile's level and thac0 by one. That's probably not a very big deal. -dak +------------------------------------------------------------+ | Ensure that you have read the CircleMUD Mailing List FAQ: | | http://qsilver.queensu.ca/~fletchra/Circle/list-faq.html | +------------------------------------------------------------+
This archive was generated by hypermail 2b30 : 04/10/01 PDT