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 ➜ Help...again on 2 things : - |

Help...again on 2 things : - |

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


Posted by USER007   (124 posts)  Bio
Date Sat 18 Oct 2003 05:19 PM (UTC)
Message
How do you save the description that I edited? Does it have to do with HSET? And I want to add the damage thing to my MUD but it is written in C and my MUD code is based on C++ so what things would I need to change to make it into C++? Heres the code: :P

Overview: This will allow you to put damage into the damage display line
example: Xerves slices a dog for 120
File: fight.c

Code: Find this function

void new_dam_message( CHAR_DATA *ch, CHAR_DATA *victim, int dam, int dt, OBJ_DATA *obj )

Next go down a few lines to find this code

if ( dt == TYPE_HIT )
{
sprintf( buf1, "$n %s $N%c", vp, punct );
sprintf( buf2, "You %s $N%c", vs, punct );
sprintf( buf3, "$n %s you%c", vp, punct );
}

Change that code to this

if ( dt == TYPE_HIT )
{
sprintf( buf1, "$n %s $N%c for %d", vp, punct, dam );
sprintf( buf2, "You %s $N%c for %d", vs, punct, dam );
sprintf( buf3, "$n %s you%c for %d", vp, punct, dam );
}

Go down even farther to find this

sprintf( buf1, "$n's %s %s $N%c", attack, vp, punct );
sprintf( buf2, "Your %s %s $N%c", attack, vp, punct );
sprintf( buf3, "$n's %s %s you%c", attack, vp, punct );

And change it to this

sprintf( buf1, "$n's %s %s $N%c for %d", attack, vp, punct, dam );
sprintf( buf2, "Your %s %s $N%c for %d", attack, vp, punct, dam );
sprintf( buf3, "$n's %s %s you%c for %d", attack, vp, punct, dam );


Notes: dam is the value of the damage done to either you or the mob. If you
look closely you can see %d in the sprintf function and then dam at
the very end of the function. %d is used to tell the machine that it
is going to accept a number and dam will be that number.

Secondly, buf1 is to all but the attacker/defender
buf2 is to the attacker
buf3 is to the defender
Top

Posted by David Haley   USA  (3,881 posts)  Bio
Date Reply #1 on Sat 18 Oct 2003 05:36 PM (UTC)
Message
Yes, if you read help hset, it should tell you that "hset save" will save the help file.

That snippet should integrate just fine, unless the damage code has been fuddled with (likely, if the MUD has been ported to C++.) What's the name of your C++ codebase again?

You know, you really should think about trying to keep things really simple here. Apparently, you know little or no coding, and you're trying to do things that really aren't easy and that sometimes keep even experienced coders a little stumped (such as all the messing around with races and stats.) I very strongly suggest that you try to stay simple, otherwise you'll get nothing but headaches and frustration out of this. It's sort of like a person picking up a violin for the first time and trying to play Vivaldi or Bach or something. It won't be any fun, and chances are that you'll learn much less than if you started simple and moved up from there. This is supposed to be fun, after all. :)

David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone

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

Posted by USER007   (124 posts)  Bio
Date Reply #2 on Sat 18 Oct 2003 06:11 PM (UTC)
Message
I tried the hset save and it did save but when I rebooted the mud it went back into yellow text. :| The only things I want to add are the damage thing and the compass, then I'll be happy with what I got. :D
Top

Posted by David Haley   USA  (3,881 posts)  Bio
Date Reply #3 on Sat 18 Oct 2003 09:39 PM (UTC)
Message
Well, you need to be more clear on what the "description" you edited is, and what went back to yellow, what it was before, how you changed it, and what it is supposed to be.

David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone

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

Posted by Rob Harper   (108 posts)  Bio
Date Reply #4 on Sat 18 Oct 2003 10:27 PM (UTC)
Message
Why not just get the regular smaug 1.4 code base, or samsons bug free one, wouldnt that be easier? Some people allways try'en to be walken up hill.
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.


19,493 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.