[Home] [Downloads] [Search] [Help/forum]

Gammon Software Solutions forum

See www.mushclient.com/spam for dealing with forum spam. Please read the MUSHclient FAQ!

[Folder]  Entire forum
-> [Folder]  SMAUG
. -> [Folder]  SMAUG coding
. . -> [Subject]  Health description each round, like rom?
Home  |  Users  |  Search  |  FAQ
Username:
Register forum user name
Password:
Forgotten password?

Health description each round, like rom?

It is now over 60 days since the last post. This thread is closed.   [New subject]  Start a new subject   [Refresh] Refresh page


Posted by Jeryx   (7 posts)  [Biography] bio
Date Sun 03 Oct 2004 11:05 AM (UTC)  quote  ]
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?
[Go to top] top

Posted by Greven   Canada  (835 posts)  [Biography] bio
Date Reply #1 on Sun 03 Oct 2004 04:24 PM (UTC)  quote  ]
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
[Go to top] top

Posted by David Haley   USA  (3,881 posts)  [Biography] bio   Moderator
Date Reply #2 on Mon 04 Oct 2004 04:40 PM (UTC)  quote  ]
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
[Go to top] top

Posted by Greven   Canada  (835 posts)  [Biography] bio
Date Reply #3 on Mon 04 Oct 2004 07:47 PM (UTC)  quote  ]
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
[Go to top] top

Posted by David Haley   USA  (3,881 posts)  [Biography] bio   Moderator
Date Reply #4 on Tue 05 Oct 2004 06:12 AM (UTC)  quote  ]
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
[Go to top] top

Posted by Greven   Canada  (835 posts)  [Biography] bio
Date Reply #5 on Tue 05 Oct 2004 06:48 AM (UTC)  quote  ]
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
[Go to top] top

Posted by David Haley   USA  (3,881 posts)  [Biography] bio   Moderator
Date Reply #6 on Tue 05 Oct 2004 08:04 AM (UTC)  quote  ]
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
[Go to top] top

Posted by Jeryx   (7 posts)  [Biography] bio
Date Reply #7 on Wed 06 Oct 2004 05:20 PM (UTC)  quote  ]
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++ :)
[Go to top] 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.


2,248 views.

It is now over 60 days since the last post. This thread is closed.   [New subject]  Start a new subject   [Refresh] Refresh page

Go to topic:           Search the forum


[Go to top] top

Quick links: MUSHclient. MUSHclient help. Forum shortcuts. Posting templates. Lua modules. Lua documentation.

[Home]

Written by Nick Gammon - 5K

Comments to: Gammon Software support
[RH click to get RSS URL] Forum RSS feed ( http://www.gammon.com.au/rss/forum.xml )

[Best viewed with any browser - 2K]    [Web site powered by FutureQuest.Net]