Hardcore Mode

  • Papaya Pete
  • Topic Author
  • Offline
  • Gold Boarder
  • Gold Boarder
More
4 years 5 months ago #4835 by Papaya Pete
Hardcore Mode was created by Papaya Pete
This is an idea that I wanted to try out, but haven't gotten around to it due to being super busy. I've seen some muds that are hardcore, meaning if your character dies... that's it.

What would it take to code something like that in? I imagine looking at the function that deals with player deletion would be a good start...

Would also be great to figure out how to put in a score board, to show the (for example) top 20 players who have lost. Ideas or leads on this?

Looks like I need to get the thick layer of dust off of that code...

Please Log in or Create an account to join the conversation.

More
4 years 5 months ago #4836 by Liko
Replied by Liko on topic Hardcore Mode

Papaya Pete wrote: This is an idea that I wanted to try out, but haven't gotten around to it due to being super busy. I've seen some muds that are hardcore, meaning if your character dies... that's it.

What would it take to code something like that in? I imagine looking at the function that deals with player deletion would be a good start...

Would also be great to figure out how to put in a score board, to show the (for example) top 20 players who have lost. Ideas or leads on this?

Looks like I need to get the thick layer of dust off of that code...


Quite easy really. I would flag them if they are hardcore from the start. In the death function write if found flagged hardcore delete them. I would write a scoreboard source that updates automatically.

DragonBall: Tournament (1.2.0)
Owner/Developer

Please Log in or Create an account to join the conversation.

  • Papaya Pete
  • Topic Author
  • Offline
  • Gold Boarder
  • Gold Boarder
More
4 years 5 months ago #4839 by Papaya Pete
Replied by Papaya Pete on topic Hardcore Mode
Hmm... I'll take a look there first. Also need to look at how deleting is handled.

Regarding the scoreboard... I'll have to come up with a point system that shows how well a character did. I'll take a look around to see if there's a snippet floating around somewhere that sort of does the same thing in some way.

Please Log in or Create an account to join the conversation.

More
4 years 5 months ago #4840 by Rumble
Replied by Rumble on topic Hardcore Mode
I used to play CheesyMUD, I know they have a 10 death rule. It might give you some ideas.

Rumble
The Builder Academy
tbamud.com 9091

Please Log in or Create an account to join the conversation.

  • Papaya Pete
  • Topic Author
  • Offline
  • Gold Boarder
  • Gold Boarder
More
4 years 5 months ago #4842 by Papaya Pete
Replied by Papaya Pete on topic Hardcore Mode
Hmmm, I'll have to take a look at that lead, thanks!

For now I'm just working on a snippet for having character deaths recorded in a file that everyone can look at (I call it a score board). So far, it works, except for two issues:

1.) When I type in the command to look at the score board ("fallen" is the command, showing who's died in the course of adventuring), it has around a 10 second delay before showing the contents of the file.

I found this snippet which sort of is what I have in mind, except it's not inputted manually like Idea, Bug, and Typo. www.circlemud.org/pub/CircleMUD/contrib/...wizard/file_decs.txt

2.) Second issue is... I'm trying to make my own version of mudlog, calling it scorelog, but I'm not really familiar with writing and reading files. So it works... but writes to the syslog instead of the other. Trying to figure out that part.

Anyways, will post it once I'm done.

Please Log in or Create an account to join the conversation.

  • Papaya Pete
  • Topic Author
  • Offline
  • Gold Boarder
  • Gold Boarder
More
4 years 5 months ago - 4 years 5 months ago #4844 by Papaya Pete
Replied by Papaya Pete on topic Hardcore Mode
So I've been trying to do something more simply, then attempting to write a new mudlog-type file (a friend and I were looking at it, and... I'll just say it would've been more work than worth it).

So I'm trying to figure out how to use fopen, fclose, and fprintf.

I've redone the function "scorelog" in the following manner, just for the purpose of testing things out. It compiles just fine. However, when scorelog is called (every time a PC dies), the mud crashes and nothing is written to the file. I'm more than likely using fopen and such wrong... I've been reading some tutorials, and to me it looks like I'm doing something right. But what do newbies know, right? :P
void scorelog(struct char_data * ch, struct char_data * killer)
{
  FILE *fp;

  fp = fopen("../lib/misc/scboard.txt", "a");

  fprintf(fp, "Testing this thing out.");

  fclose(fp);

}

The way the function is called is...

scorelog(ch, killer);

... in fight.c, towards the end of raw_kill() function before the corpse object is made and the character is extracted.

Any thoughts on this are greatly appreciated. I'll work on this more later tonight, hopefully. I might even have a solution! Seems to happen that way sometimes.

Edit: just tried the above again and it worked. Running more tests...
Last edit: 4 years 5 months ago by Papaya Pete.

Please Log in or Create an account to join the conversation.

  • Papaya Pete
  • Topic Author
  • Offline
  • Gold Boarder
  • Gold Boarder
More
4 years 5 months ago #4845 by Papaya Pete
Replied by Papaya Pete on topic Hardcore Mode
So I figured out what was going on and how the crash was occuring. Whenever a character dies, now it's recorded in a txt file I've added into the lib\misc folder!

Next thing I'll work on is cleaning up the command that reads that file and prints the contents whenever a player types in "fallen" to see who's died recently. The code that's in the link above works... but it makes the entire mud hang for 10 seconds or so. Great way for someone to grief everybody by typing it in over and over again.

Please Log in or Create an account to join the conversation.

  • Papaya Pete
  • Topic Author
  • Offline
  • Gold Boarder
  • Gold Boarder
More
4 years 5 months ago - 4 years 5 months ago #4846 by Papaya Pete
Replied by Papaya Pete on topic Hardcore Mode
Finished the score board snippet. Going to upload it, and next I'll be working on the hardcore mode.

... I think one could mimic the way CheesyMud did the 10 lives by using a combination of the kill counter snippet and permdeath snippet.

Edit: Wish I could update what file I uploaded and get rid of the old one. I forgot a step: adding the prototype in act.h. Open it up, and add...
ACMD(do_title);
ACMD(do_visible);

+ACMD(do_fallen);

Sorry for the mistake there! And caught another bug as well... it was recording even when mobs were beaten. That'd fill that file up quickly. Here's a quick fix.
+  if (!IS_NPC(ch))
    scorelog(ch, killer);
  make_corpse(ch);
  extract_char(ch);
Last edit: 4 years 5 months ago by Papaya Pete.

Please Log in or Create an account to join the conversation.

  • Papaya Pete
  • Topic Author
  • Offline
  • Gold Boarder
  • Gold Boarder
More
4 years 5 months ago #4849 by Papaya Pete
Replied by Papaya Pete on topic Hardcore Mode
So I got the hardcore death coded in. ... in a rather hackneyed way. The easiest way, at least for me since I'm still getting familiar with this part of the code, is changing the STATE of the character after a death occurs in extract_char to DELCNF2 if the death counter for a character is above x number. This works... however, it will not close the connection to the mud like you'd normally expect after deleting a character. It will stay connected and you have to manually disconnect.

Tomorrow, maybe I can figure out a better way or a way to resolve this problem.

Please Log in or Create an account to join the conversation.

Time to create page: 2.423 seconds