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 ➜ Health description each round, like rom?

Health description each round, like rom?

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


Posted by Jeryx   (7 posts)  Bio
Date Sun 03 Oct 2004 11:05 AM (UTC)
Message
One of the things I enjoyed greatly with ROM was each round of battle, you saw the short health description of your opponent, like X has a few cuts, X is bleeding freely, etc.
My players are also yelling at me to get this done, as they dislike having to manually look at the mob every few rounds to see their progress.
So, my questions are,

1. where in the code is the text for the last round compiled to send out

2. what is the name of that string, that shows wounds

3. How difficult would it be to tack it back in there to display at the end of every round?
Top

Posted by Greven   Canada  (835 posts)  Bio
Date Reply #1 on Sun 03 Oct 2004 04:24 PM (UTC)
Message
You wanna make flush_buffer look like this:
bool flush_buffer( DESCRIPTOR_DATA *d, bool fPrompt )
{
    char buf[MAX_INPUT_LENGTH];
    extern bool mud_down;

    ch = d->original ? d->original : d->character;
    if (ch && ch->fighting && ch->fighting->who)
    	show_condition(ch, ch->fighting->who);

    /*
     * If buffer has more than 4K inside, spit out .5K at a time   -Thoric
     */
    if ( !mud_down && d->outtop > 4096 )
    {
	memcpy( buf, d->outbuf, 512 );
	d->outtop -= 512;

Nobody ever expects the spanish inquisition!

darkwarriors.net:4848
http://darkwarriors.net
Top

Posted by David Haley   USA  (3,881 posts)  Bio
Date Reply #2 on Mon 04 Oct 2004 04:40 PM (UTC)
Message
Woah. It seems to be that it doesn't belong there at all! Why not put it in violence_update so that it actually goes out with the rounds, and not connect it to flushing the buffer which is really a completely separate concept?

David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone

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

Posted by Greven   Canada  (835 posts)  Bio
Date Reply #3 on Mon 04 Oct 2004 07:47 PM (UTC)
Message
Thats where it is in SWR, thats why I put it there, and I don't have any kind of problem with it, and I've never heard any complaints about from anyone else.

Nobody ever expects the spanish inquisition!

darkwarriors.net:4848
http://darkwarriors.net
Top

Posted by David Haley   USA  (3,881 posts)  Bio
Date Reply #4 on Tue 05 Oct 2004 06:12 AM (UTC)
Message
It's just wrong, though. It may seem to be correct because the buffer simply *happens* to be flushed at the end of an update cycle, but it simply does not belong in the flushing of the buffer because that is not what flushing the buffer should do. I realize this is somewhat going in circles, but if a low-level function is meant to flush the buffer then it should do just that and not something else - especially something not at all related to network connectivity.

David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone

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

Posted by Greven   Canada  (835 posts)  Bio
Date Reply #5 on Tue 05 Oct 2004 06:48 AM (UTC)
Message
I happen to agree. For coding "philosophy", everything has its own place. I barely found that, I of course first looked in violence_update myself, but didn't see it there, so I grep'ed.

A communication module should do just that, but looking through flush_buffer, it has some other things that seem misplaced, snooping, IMO.

Either way, that is a simple solution for a newbie-ish coder, which was my intent. I would like to like to redo the whole way that the server communicates with the client, but not alot of time, so that seems a little far off at this point.

A more appropriate place may be
                                        }
                                }
                        }
                }
         <----------- Here 
        }
		
        return;
}
at the end of violence update, but I haven't tested it.

Nobody ever expects the spanish inquisition!

darkwarriors.net:4848
http://darkwarriors.net
Top

Posted by David Haley   USA  (3,881 posts)  Bio
Date Reply #6 on Tue 05 Oct 2004 08:04 AM (UTC)
Message
Yes, I would have put it there in violence_update as well. Or at least somewhere at the end of processing somebody's fight round.

One of the thing that bothers me a lot about the SMAUG code base is precisely how much you find things in places they really don't belong. This is fine for 'ad hoc' solutions but as soon as you start building on the system, the complexity increases dramatically. Add to that the problem of redundancy in SMAUG, and making changes to fundamentals can be a true monster at points.

Snooping is a hard one, though. It probably belongs somewhere down low, I think, but not quite as low as flushing the buffer.

David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone

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

Posted by Jeryx   (7 posts)  Bio
Date Reply #7 on Wed 06 Oct 2004 05:20 PM (UTC)
Message
I found a snippet here
http://www.geocities.com/TimesSquare/Labyrinth/2695/smaug/snippets.html
called Autoglance that works quite nicely. I have also updated do_score in player.c to display the new flag along with the other "auto" flags. not too bad for someone who dont know C++ :)
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,966 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.