Welcome to the Builder Academy

Idea Hardcore Mode

More
13 Apr 2014 05:57 #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
13 Apr 2014 17:01 #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.

Randian(0.0.0)
Owner/Developer

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

More
14 Apr 2014 00:20 #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
14 Apr 2014 11:29 #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
rumble@tbamud.com

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

More
14 Apr 2014 18:20 #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.

More
15 Apr 2014 00:38 - 15 Apr 2014 00:45 #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
Code:
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: 15 Apr 2014 00:45 by Papaya Pete.

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

Time to create page: 0.308 seconds