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 ➜ Thrown Item Code?

Thrown Item Code?

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


Pages: 1  2 

Posted by Gatewaysysop2   USA  (146 posts)  Bio
Date Reply #15 on Fri 17 Feb 2006 12:27 AM (UTC)
Message
Quote:

Jeez, what's up your ass, Gatewaysysop?


One might ask you the same question, but it seems you already provided the answer at the end of your post. :)

Quote:

I gave step by step instructions on what to do, which is far more than what I got when I was learning to code


So, since you got so little help, others should be so lucky to get any better treatment from you when the tables are turned? That's awful big of you.

Quote:

My mistake apparently is assuming that anyone posting on a coding board knows basic coding already, so I just told him which functions to use.
Silly silly me.


If you thought that nobody would be put off by a response for a snippet request with a posting that basically said "You shouldn't need a snippet," then yes, I think that was pretty silly.

Quote:

I'm just tired of people asking for snippets all the time. I used to release snippets, only to find people coming onto my mud and telling me my code was stock because they found it on a snippet site. Bleh.


Ahh, there's the answer. It all makes sense now.


"The world of men is dreaming, it has gone mad in its sleep, and a snake is strangling it, but it can't wake up." -D.H. Lawrence
Top

Posted by David Haley   USA  (3,881 posts)  Bio
Date Reply #16 on Fri 17 Feb 2006 12:40 AM (UTC)
Message
Quote:
If you thought that nobody would be put off by a response for a snippet request with a posting that basically said "You shouldn't need a snippet," then yes, I think that was pretty silly.
It could be very constructive to tell somebody that they don't need a snippet. He did in fact give step by step instructions, even if they were very brief. If the receiver doesn't understand, then he can ask for clarification, at which point the steps become more detailed. But I think it's not very nice of you to blame somebody who's trying to teach people to fish for themselves in a simple case, instead of simply throwing fish at the problem. If somebody's really willing to learn, then they should not be put off by being told that the problem is not too hard. And the problem ISN'T too hard, given that the majority of the code is already right there.

From a teacher's perspective (I've taught this stuff) there are few things more frustrating than a student who demands immediate answers without understanding how you get there. If the student already has the tools to get there, it is a teacher's duty -- and the student's -- to use those tools as best as possible to reach the desired goal, without simply throwing code immediately at the problem.

David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone

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

Posted by Gadush   (92 posts)  Bio
Date Reply #17 on Fri 17 Feb 2006 12:57 AM (UTC)
Message
I am hesitant to post, because I do not want to stir a dying (dead?) fire. I agree with both perspectives, on the whole. Of course the ultimate goal is to help somebody learn to help themselves. Giving advice can in fact help someone. But to be honest, humiliating or belittling someone to make a point, or to 'teach them' is not productive. I AM NOT saying that was the intent in this case! Just pointing out that tone and attitude carry a lot of weight from someone who possesses skill, to someone who does not yet. Crush a student under the weight of your superior skill, and risk losing a student.
I think both of the individuals involved here were trying to help Longbow. One was trying to help him with coding. The other felt the sting they thought was implied in the tone of the post.
Nick's place is a great community, and we all benefit from everyone who posts here, one way or another.
Anyway, take care all.
Gadush
Top

Posted by Dace K   Canada  (169 posts)  Bio
Date Reply #18 on Fri 17 Feb 2006 12:59 AM (UTC)

Amended on Fri 17 Feb 2006 01:02 AM (UTC) by Dace K

Message
Ksilyan: Thanks for the backup. It's nice to see that someone understands what I'm getting at :).

Gateway: I noticed the lack of thanks for a function which you were actually the first one to request :/

Longbow: No worries. Smaug, and especially SmaugFUSS is my favorite codebase to recommend to new people learning C, because there're examples of almost everything already in the code. I learned myself by looking for functions similar to what I wanted to do, copying them, and modifying them to suit my needs. After about a year, I found that I could write most simple functions from scratch without any reference to anything else. As long as you understand a simple language like BASIC, you can learn C! (Or at least, enough C to program a mud :P).

If you have issues installing that function, lemme know in this thread and I'll help out :P

ASJ Games - .Dimension 2, Resident Evil, and snippets - oh my!
http://asj.mudmagic.com

Drop by the area archives and find something for your mud. http://areaarchives.servegame.com
Top

Posted by David Haley   USA  (3,881 posts)  Bio
Date Reply #19 on Fri 17 Feb 2006 01:38 AM (UTC)
Message
I also learned to program, at first, by looking at things that did something I knew, and then trying to figure out how they did it, and then copy-pasting it, tweaking it, and seeing what happened. Sometimes the results were good and sometimes they were disastrous. :P

Of course, a more formal approach is better in the long run. Never learning a language properly will only do you harm, in the long term. My recommendation is to start informally, "just for fun" as it were, and once you feel comfortable enough, to start challenging yourself to actually understanding the language. That means understanding precisely how syntax works - not just how it looks like it works - and more importantly, understanding formal data structures such as maps, trees, etc.

Having a proper grasp of data structuers is absolutely critical to programming efficiently, both in terms of speed of program execution and in terms of how long it takes you to write the program. But this is something that you can (usually) only gain through training and learning, unless of course you actually re-invent the data structures yourself. But that's a lot of wasted time. Imagine the person who spends a long time reinventing and debugging balanced binary tree algorithms, when it's something students learn relatively quickly in class...

David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone

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

Posted by Gatewaysysop2   USA  (146 posts)  Bio
Date Reply #20 on Fri 17 Feb 2006 02:27 PM (UTC)
Message
Quote:

Gateway: I noticed the lack of thanks for a function which you were actually the first one to request :/


You must have stopped reading after the first post then. Directly after Txzeenath posted the (now defunct) link, I posted the following in response:

Quote:

Will take a look, thanks for the help!


Sigh...

"The world of men is dreaming, it has gone mad in its sleep, and a snake is strangling it, but it can't wake up." -D.H. Lawrence
Top

Posted by Dace K   Canada  (169 posts)  Bio
Date Reply #21 on Fri 17 Feb 2006 06:24 PM (UTC)
Message
Then why not post the code for the guy yourself?:D

ASJ Games - .Dimension 2, Resident Evil, and snippets - oh my!
http://asj.mudmagic.com

Drop by the area archives and find something for your mud. http://areaarchives.servegame.com
Top

Posted by Gatewaysysop2   USA  (146 posts)  Bio
Date Reply #22 on Fri 17 Feb 2006 10:59 PM (UTC)
Message
Quote:

Then why not post the code for the guy yourself?:D


Sigh. Again, I question whether or not you've actually read the posts you yourself are responding to. I said pretty plainly before:

Quote:

For those interested, I may have a copy of the code that was posted here. I'll hunt around for it and post if I find it. In the mean time, I believe either SWR has thrown item code in it somewhere that you might look at.



"The world of men is dreaming, it has gone mad in its sleep, and a snake is strangling it, but it can't wake up." -D.H. Lawrence
Top

Posted by Samson   USA  (683 posts)  Bio
Date Reply #23 on Sat 18 Feb 2006 03:16 AM (UTC)
Message
I don't think it's entirely necessary to go back and forth rehashing the argument, is it? The code is posted now, he got the help he was looking for, and from what I can see, the issue should be settled, yes?
Top

Posted by Dace K   Canada  (169 posts)  Bio
Date Reply #24 on Sat 18 Feb 2006 04:12 AM (UTC)
Message
Haha. I'm done, unless Longbow needs help with the code I posted.

ASJ Games - .Dimension 2, Resident Evil, and snippets - oh my!
http://asj.mudmagic.com

Drop by the area archives and find something for your mud. http://areaarchives.servegame.com
Top

Posted by Nick Gammon   Australia  (23,133 posts)  Bio   Forum Administrator
Date Reply #25 on Sat 18 Feb 2006 10:21 PM (UTC)
Message
Please keep discussions on this forum polite.

There is nothing that annoys me more than forums which are 80% insult and counter-insult, with only 20% helpful information on them.

If you find something that someone says annoying, and can find no constructive thing so say, don't say anything please.

- Nick Gammon

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

Posted by Longbow   (102 posts)  Bio
Date Reply #26 on Tue 21 Feb 2006 12:11 AM (UTC)
Message
Hey guys, interesting discussion here. I've been taking a look at the code in Smaug and its diriv Fear, and I've actually learned to read some of the code. Not a whole bunch, mind you, but a little. ;)

The thing that I really want to learn is skillbuilding, but I'm not sure how best to go about it. I'm trying to develop a throwing skill, with weapons that do differant amounts of damage depending on the weapon. That's why I asked about it here.
The C book I was studying I had to return it to the guy I was borrowing it from. So, at risk of being offtopic, does anybody know any online C tutorials, particularly those aimed toward text-based-gaming? Not to say that I should desert the basics of C by any means, of course.
And thanks for all the help so far guys. It is really appreciated. ;)

Godbless,
Longbow
Top

Posted by David Haley   USA  (3,881 posts)  Bio
Date Reply #27 on Tue 21 Feb 2006 12:43 AM (UTC)
Message
I'm not sure if there really are C tutorials meant specifically for text-based gaming. If there are, they'd be fairly rare. I imagine it'd be like asking for a violin instruction manual specially for Bach music. I'm sure such a thing exists, but playing the violin is a much more general tool than to merely play Bach.

Basically what I'm trying to say is that learning C is, at the beginner's level, fairly independent of what application you're trying to develop.

That being said, googling for "C tutorial" (with quotes) gives a number of links that look fairly decent. That being said, you're probably beyond the 'hello world' level. Do you have any more specific questions? Is there a line of code that you can't read? Or are you having trouble putting what you know together?

If you read the code for ranged weapons, do you understand what it's doing? If not, where is the problem?

Item throwing is almost identical to ranged weapons, so understanding ranged weapons is the first step in making an item throwing skill.

David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone

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

Posted by Longbow   (102 posts)  Bio
Date Reply #28 on Thu 23 Feb 2006 05:49 PM (UTC)
Message
Well, I know what void does, and I can read printf and figure out how to channel messages to the triggering PC or the room, or whatever. I have also figured out str_cmp's ability to call a particular string. Basic stuff like that, about all of which I picked up from scanning code. :) BUT! I don't know how to put it all together. Hence, I can't really write any code for myself; I spend my time editing other folk's code, and whenver I have to change variables and all that good stuff I'm stuck.

Now, as to reading the code Dace K posted, some of it I can follow, but not all of it. I'm not sure what all the char arg2[Max_Imput_Length] stuff fits in, and I don't really understand the char *dtxt and *stxt.

Is the first character argument checking for the item to be thrown, or is it checking for the target?

Is the second argument checking for a direction the heave the object in?

Where is the target determined?

Most of the rest seems to make sense, though how I'd modify it to do a skill/command of my own I'm not sure. I'll try to take a closer look at it at a later time.

Anyway, that may be more than you wanted, but there ya go!

Godbless,
Longbow
Top

Posted by Dace K   Canada  (169 posts)  Bio
Date Reply #29 on Fri 24 Feb 2006 03:33 PM (UTC)
Message
A char is simply a character string (word/phrase). Dtxt was directional text, and I forget what stxt is for. Whatever they're called to = in the code is what it's for though :P\

Target is determined where victim = something.

As for making it a skill of your own, add the appropriate calls in the mud.h do_funs, the table.c entries, then make a skill with the code do_throw

ASJ Games - .Dimension 2, Resident Evil, and snippets - oh my!
http://asj.mudmagic.com

Drop by the area archives and find something for your mud. http://areaarchives.servegame.com
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.


75,824 views.

This is page 2, subject is 2 pages long:  [Previous page]  1  2 

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.