Installing a patch to SMAUG1.8(no idea how to do it)

Posted by ShadowGazer on Wed 11 Feb 2009 12:59 AM — 13 posts, 49,068 views.

USA #0
Alright, I downloaded a patch that adds new classes, spells, etc. to the stock smaug server. Thing is, it gives no instructions on installing it. I've opened the file in windows with 7 zip (the file had a tgz extension) and there are a bunch of files in there with the .pat extension. So, how do I install it into my mud? Do I have to edit code? I really hope not because I want to be able to put these classes into my game.

I got the file from: ftp://ftpgame.org/pub/mud/snippets/smaug/patch.tgz

There is a readme contained in the file but it doesn't explain what to do with the files. I'm pretty stupid when it comes to installing things. I'm still learning how to use the commands within smaug. I put up the game so I can learn how to code, but with basically no help to go on, it's a pretty slow process.
Australia Forum Administrator #1
The basic idea is that you use the "patch" program that probably is, or should be, installed with Cygwin or Linux.

You can edit the patch files, for example magic.c.pat starts with these lines:


--- magic.c	Mon Jun  2 22:46:08 1997
+++ new/magic.c	Tue Jun  3 23:46:48 1997
@@ -1175,7 +1175,7 @@
 	 * Vampire spell casting				-Thoric
 	 */
 	blood = UMAX(1, (mana+4) / 8);      /* NPCs don't have PCDatas. -- Altrag */
-	if ( IS_VAMPIRE(ch) )
+	if ( IS_VAMPIRE(ch) || IS_DEMON(ch) )


What that is basically saying is, in the file magic.c, around line 1175, for 7 lines, remove (minus) the line:


  if ( IS_VAMPIRE(ch) )


... and replace it (plus) by this:


  if ( IS_VAMPIRE(ch) || IS_DEMON(ch) )


And so on, for the rest of that file.

The general technique is to untar (unzip if you like) the patch archive so all the files are in the "src" directory. Then from a command prompt you would run something like this:


patch < magic.c.pat


Or possibly, to do all of them:


patch < *.pat


What that does is effectively feed the file into the patch program, which does its stuff.

However you need to be pretty cautious. These files are dated 1997 as you can see from the first line. If the version of Smaug you are applying them to is not the same, or very similar, to what it was when the patch files were made, it won't find the old lines, and thus cannot replace them by the new ones.

If you are beginning, I would try running SmaugFuss (Fixed Up Smaug Source) without trying to change anything for now. Just get used to what it currently does. The patch files are really coders releasing the differences between a version without their change, and one with it. But if you don't have the version without the change in the first place things are likely to go seriously wrong.


USA #2
Ok, I'll try messing around with SmaugFUSS. I'd like to learn how to code, so I'm going to be going to the library and get, or order online, some books on C coding. I really want to have a successful MUD using the SMAUG codebase, so I'll try using SmaugFUSS for a while until I can learn how to code better. Thanks again Nick!
USA #3
A good way of getting started is to get [b]very[/b] familiar with how SMAUG behaves from the user's perspective. Then, when you read the code, you will be able to connect things to what you have observed. Think of it kind of like learning a foreign language: if you know what a block of text is supposed to be saying, you'll have an easier time piecing apart the individual words than if you had no idea at all what the topic matter is. Another thing we suggest to everybody is to have the patience to start small, and learn to crawl, then stand, then walk, then run. It might feel like a slower process, but it's far more rapid in the end of the day than falling over all the time and breaking things irreparably. :-)
USA #4
Heh, I tried SmaugFUSS and the commands are alot different from what I was using, so I'm back to using my older codebase. Gonna get used to those commands, build from there, then maybe I'll go to SmaugFUSS in the future.

I'm also going to take the suggestion and get used to the player's perspective before I decide on programming things that I know I'll probably break.

I'm going to be taking a look at code, try to understand how it works, and get some books to help me figure out what everything means, and go from there.

Thanks for all the help you two. It is much appreciated, and I hope I can come back here and post some success stories!
USA #5
Different how? 1.8 shouldn't be that different compared to FUSS.

If you haven't applied any FUSS fixes to your Smaug MUD, you are open for a number of exploits and the such.
USA #6
Well, alot of the commands I was used to using were not in SmaugFUSS, like rassign. There was a help file for it but the command itself was not present. In fact, all the commands I was used to using in 1.8 were not in smaugfuss, so I could not figure out how to do anything. I don't know, maybe I was using a wrong version or something but I couldn't find most if not all the commands I was used to using. All I would get was "Huh?". And like I said, the help files were in there, but the commands themselves were not. I had full imm powers as well, so it wasn't that
USA #7
Are you running with Cygwin? There are some things you need to do to get the dynamic loading working -- there are instructions in the makefile or readme, and many references to the problem on the forums.
USA #8
No I'm running linux I believe. Red Hat to be exact. I'm going through thirdhosting.com with their advanced mud package. Do I need to do anything in linux to get all the commands I'm used to? Let me know and I'll consider moving to SmaugFUSS
Amended on Thu 12 Feb 2009 12:04 AM by ShadowGazer
USA #9
Well, I'm just surprised that there would be help files, but no commands. Do you get any warnings whatsoever when you compile? In particular, anything about "ldl", "dlsym", "libdl" are things to look out for.
USA #10
Nope, no errors whatsoever, everything compiles clean. I just compiled smaugfuss1.9.tgz

There are help topics for the commands but the commands themselves return a "Huh?" when I try to use them.

For instance, here's a paste directly from the game:

help rassign
Help level: 58
Syntax: rassign
oassign
massign

> Steps for creating a new area from scratch;
> 1. checkvnum rooms low_vnum hi_vnum
> checkvnum objects low_vnum hi_vnum
> checkvnum mobs low_vnum hi_vnum
> (make sure the vnums don't overlap another area)
> 2. rassign (person) low_vnum hi_vnum
> massign (person) low_vnum hi_vnum
> oassign (person) low_vnum hi_vnum
> 3. mset (person) aloaded yes
> 4. goto low_vnum
> goto hi_vnum
> 5. savea
> 6. save
>
> This should create a new area listed as '{PROTO} (Person)'s area in
> progress', with the file name '(person).are' and it should load up after
> rebooting the MUD with 'loadarea' or 'loadarea (person).are' if it's not
> your area.
(C)ontinue, (N)on-stop, (R)efresh, (B)ack, (Q)uit: [C]

NEVER do this to someone who has an area assigned to them. This would
change the range for the area they have assigned and wipe out the area.

<24hp 145m 110mv> <#1200>
rassign
Huh?


See? The help topic is there but the command gives a "Huh?" when I use it.
Australia Forum Administrator #11
See: http://www.gammon.com.au/forum/?id=8789

There is no rassign command. ;-)
USA #12
I knew it had to be something obvious that I was missing. Thank you very much!