Register forum user name Search FAQ

Gammon Forum

Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the password reset link.

Due to spam on this forum, all posts now need moderator approval.

 Entire forum ➜ SMAUG ➜ SMAUG coding ➜ Pfile variables, random skill, class-changing, skill-differences...

Pfile variables, random skill, class-changing, skill-differences...

It is now over 60 days since the last post. This thread is closed.     Refresh page


Posted by Firedraconian   USA  (32 posts)  Bio
Date Thu 29 Jun 2006 11:44 PM (UTC)
Message
I'm utterly new to coding and designing a mud, so I have a few questions which I hope aren't too annoying.

First, one of the races I want to have would devour souls. The way I had thought to do was would be to have each mkill of a mob without a certain level range (5 below and 5 above, so that a player at level 16 would have a range of 11-21) would add one to a value in the player's pfile, aptly called 'souls'. Then, at some later date, the player would be able to go to a certain room, and decrease that soul number to get certain items.

Sort of a cross between mkills and bless, I suppose, but I have no idea how I would actually do it.


Secondly, I had a skill in mind that, when used, would have one, random effect from a list. For example, you'd use the skill, then the actual attack would do a kick, or a punch, or a headbutt, etc, randomly. Is it possible to do that? I'm not sure how attacks are coded in, or if you can do a random effect from a list or not.


Thirdly, is there a way to cause damage if certain races use certain skills? For example, I was gonna have a race that would be damaged if it used a portal opened by someone else (or by themselves, really just portals in general).


And lastly, and this is more of a "will this work" sort of thing, but could I have a system where all the attacks for various classes are in the racial list, and then the different classes actually practice the skills in class-specific rooms? This would be for a class-changing system, so that you could change classes and keep the skills, but only learn the skills if you're actually in that class.


Sorry, but I'm really new to this and I have no idea how a lot of this stuff works. I'm not asking for people to do it for me, but a good idea of what to do and where would be extremely helpful. Thanks.

X. D. Caeruleus
Draconian Industries
Top

Posted by Firedraconian   USA  (32 posts)  Bio
Date Reply #1 on Thu 06 Jul 2006 12:55 AM (UTC)
Message
Anyone know?

X. D. Caeruleus
Draconian Industries
Top

Posted by Nick Gammon   Australia  (23,173 posts)  Bio   Forum Administrator
Date Reply #2 on Thu 06 Jul 2006 01:51 AM (UTC)
Message
My first thought is that "anything is possible" when programming, my second is that doing complex changes like that when "I'm utterly new to coding and designing a mud" is probably going about things the wrong way.

A lot of the stuff in SMAUG is hard-coded in a rather annoying way, so that you can hunt around a fair bit in the code to make it behave in a different way to the way the original coders wanted. Sure, it can be done, but I would start with a simple change, like maybe your portal idea. You would need to find where, in the code, it opens portals, find out what race is doing it, and then start to make your changes.

The MUD is such a large and complex program - even without making changes - that you are well advised to come to grips with how it currently works. Then start making small changes, and work your way up to bigger ones.

One thing you need to look at, if you want to change what is saved to the player pfile, is both the saving and loading code, plus having somewhere in the player's data structure to store the value. Then you need to make sure for a new player that this is initialised (eg. to zero).

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Firedraconian   USA  (32 posts)  Bio
Date Reply #3 on Thu 06 Jul 2006 03:22 AM (UTC)
Message
Thanks. Would you mind directing me to which file does that whole saving/loading thing with pfiles? I've tried looking through them, but a lot of them seemed named weird things and a lot of the language inside is confusing.

X. D. Caeruleus
Draconian Industries
Top

Posted by Conner   USA  (381 posts)  Bio
Date Reply #4 on Thu 06 Jul 2006 04:40 AM (UTC)
Message
You're going to be looking at save.c for the file that handles saving and loading pfiles.

-=Conner=-
--
Come test your mettle in the Land of Legends at telnet://tcdbbs.zapto.org:4000
or, for a little family oriented medieval fun, come join us at The Castle's Dungeon BBS at telnet://tcdbbs.zapto.org
or, if you just want information about either, check our web page at http://tcdbbs.zapto.org
Top

Posted by Nick Gammon   Australia  (23,173 posts)  Bio   Forum Administrator
Date Reply #5 on Thu 06 Jul 2006 07:54 AM (UTC)

Amended on Thu 06 Jul 2006 07:55 AM (UTC) by Nick Gammon

Message
My approach in a situation like this is to find something I know is already in the player save file, like "pkills" and scan for that word.

As Conner points out, save.c is the appropriate file, and I have to say I think it is a pretty descriptive name too. :P

Scanning through save.c for "pkills" you find a couple of spots it is mentioned (one where the number is loaded, and one where it is saved). Thus, putting similar code for "souls" in a similar place could be the way to go.

Quote:

... a lot of the language inside is confusing ...


I am troubled by the thought of changing a MUD server being your first C programming experience. I strongly advise you to become more familiar with C by doing some simpler examples. There are some subtleties to running servers, like the asynchronous nature of communications (for example, trying to build in pauses is not simple), plus the heavy use of pointers.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by David Haley   USA  (3,881 posts)  Bio
Date Reply #6 on Thu 06 Jul 2006 01:17 PM (UTC)
Message
If you've never seen code before, there are lots of tutorials and introductions on the web. I agree with all the recommendations Nick gives you. It will be more fruitful in the long run, far less frustrating and far more valuable to you, to take some time off now and learn to walk before running a marathon. I would start with a simple "hello, world" program; move up from there.

Another reason to start slow is that diving in too quickly will give you some very bad habits, because you will develop a "hackish" style where you stop when it appears to work, but without truly understanding what happened where and why. This only leads to trouble later on. If you're in college, take an intro CS class. If you're not, look around on the web for tutorials. There is lots of material out there; you'll just have to take the time and patience to walk through it.

But of course, we are here to help you as you learn, so feel free to ask questions.

David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone

http://david.the-haleys.org
Top

Posted by Firedraconian   USA  (32 posts)  Bio
Date Reply #7 on Thu 06 Jul 2006 08:34 PM (UTC)
Message
Thanks, I'll be sure to study some tutorials on the basics. I'll have to check to see if my campus offers an intro CS class, but that would definately help me out a lot.

X. D. Caeruleus
Draconian Industries
Top

Posted by Conner   USA  (381 posts)  Bio
Date Reply #8 on Thu 06 Jul 2006 11:25 PM (UTC)
Message
You know, Nick, for what consolation there might be in this for firedraconian and others, Smaug was my first experience with C programming a little over 3 years ago, but I bought a few good books on C and got some great help from members of our community (too numerous to mention) and have learned an amazing amount.. and frankly, if I do say so myself, have developed a pretty nice mud out of it.

So it can be done, but I will give Nick's argument some credence too. This was not my first programming experience, I'd already run an ISP for 8 years on my own, and was certified A+, Network+, MCSE+I, and had previously learned and used cobol, fortran, pascal, basic, and a few other languages, so I wasn't totally new to programming, just to C based programming, and I am still learning.

I also wouldn't recommend starting out trying to change such major features, rather I would strong agree with Nick that you're better off starting out small/easy and building up.

-=Conner=-
--
Come test your mettle in the Land of Legends at telnet://tcdbbs.zapto.org:4000
or, for a little family oriented medieval fun, come join us at The Castle's Dungeon BBS at telnet://tcdbbs.zapto.org
or, if you just want information about either, check our web page at http://tcdbbs.zapto.org
Top

Posted by David Haley   USA  (3,881 posts)  Bio
Date Reply #9 on Fri 07 Jul 2006 05:37 PM (UTC)
Message
If you are a strong programmer already, being new to C is almost irrelevant. If you are completely unfamiliar with references, memory, functions, loops, control flow etc., that is the problem. A language is (usually) just a question of syntax, not concepts. (Mastering the language, however, might require mastering the concepts.)

David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone

http://david.the-haleys.org
Top

Posted by Conner   USA  (381 posts)  Bio
Date Reply #10 on Fri 07 Jul 2006 07:36 PM (UTC)
Message
Again, for what it's worth, I was not a strong programmer, I had a little background in a variety of languages, but had avoided programming any time that I possibly could for many professional years. I did not have a good grasp of most of those concepts either. By far, the marojity of what I know at this point is, frighteningly enough, gleaned from the last three years of playing with Smaug's code.. and a great many kudos to those who's struggled along to help me figure out how to do the things I'd tried along the way, and to those who've fixed my mistakes and were patient enough to show me what I'd done wrong and how to do it right instead.

-=Conner=-
--
Come test your mettle in the Land of Legends at telnet://tcdbbs.zapto.org:4000
or, for a little family oriented medieval fun, come join us at The Castle's Dungeon BBS at telnet://tcdbbs.zapto.org
or, if you just want information about either, check our web page at http://tcdbbs.zapto.org
Top

Posted by David Haley   USA  (3,881 posts)  Bio
Date Reply #11 on Fri 07 Jul 2006 08:33 PM (UTC)
Message
What I meant is that even some basic exposure can get you a really long way. Basic exposure can be as simple as understanding elementary control flow, function calls, very basic data structures, and such things. The difference between somebody who has had such exposure and somebody who is truly completely new is pretty amazing.

That being said, it's quite possible to have Smaug as first exposure, it's just that the novice has to accept that they won't be changing the face of the world for quite a while as they learn the ropes. If they start small, then by using good community resources they will get very far, much further than if they try from the get-go to make very complicated changes.

David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone

http://david.the-haleys.org
Top

Posted by Conner   USA  (381 posts)  Bio
Date Reply #12 on Sat 08 Jul 2006 02:27 AM (UTC)
Message
Now there, I fully agree. From my own experience your best best is to make yourself a todo list, in fact, make it a help entry in help.are so even your players can see what you intend, and put on it all your great worldchanging ideas, and even a few of the really minor ones. Then start with the smallest things that are going to be easiest and try to do them. Once you get those right, move up to the next smallest changes until after a couple of years you're actually ready to tackle the really tough things.. by then, you may even find that you've got some other great ideas too, or that your players have some for you. Lord knows that my players never seem to run short of ideas for me... *LOL*

-=Conner=-
--
Come test your mettle in the Land of Legends at telnet://tcdbbs.zapto.org:4000
or, for a little family oriented medieval fun, come join us at The Castle's Dungeon BBS at telnet://tcdbbs.zapto.org
or, if you just want information about either, check our web page at http://tcdbbs.zapto.org
Top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


39,052 views.

It is now over 60 days since the last post. This thread is closed.     Refresh page

Go to topic:           Search the forum


[Go to top] top

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.