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 ➜ Compiling the server ➜ Death System

Death System

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


Posted by Rok   (41 posts)  Bio
Date Sat 25 Aug 2001 08:09 AM (UTC)
Message
All right, next thing! I finally got most things I wanted working to work. The next thing I want to do is change the death system. Here is what I want to do. I want to create a few new spells(I shouldn't need help with that... I hope) and have when a player dies, they stay dead, without loosing any exp or gold or anything. Now, they could then choose two options.

1. Type in Die and then the system does what it normally does for deaths. (Takes them to a differnet room, a loss of exp. and items, gold, etc...) and I shouldn't need help with that.

However

2. The chance to speak with someone with this new spell of something like "Raise Dead" or "Ressurection" that will bring them back to life with no loss to anything.

The part that I need your help with is, getting it to the point where when you are killed in battle, it doesn't automaticlly make you loose exp and transfer you, but leave you in the room you died at. I will look into it more tonight, and if I figure more out I will edit this for what I know. But untill then, Any Ideas???

The always thankful
~ROK~
(~Hey you~)
Top

Posted by Rok   (41 posts)  Bio
Date Reply #1 on Sat 25 Aug 2001 04:15 PM (UTC)

Amended on Sat 25 Aug 2001 04:16 PM (UTC) by Rok

Message
Ok, I think I found the code part I need in fight.c:
/********************************************************/
case POS_DEAD:
if ( dt >= 0 && dt < top_sn )
{
SKILLTYPE *skill = skill_table[dt];

if ( skill->die_char && skill->die_char[0] != '\0' )
act( AT_DEAD, skill->die_char, ch, NULL, victim, TO_CHAR );
if ( skill->die_vict && skill->die_vict[0] != '\0' )
act( AT_DEAD, skill->die_vict, ch, NULL, victim, TO_VICT );
if ( skill->die_room && skill->die_room[0] != '\0' )
act( AT_DEAD, skill->die_room, ch, NULL, victim, TO_NOTVICT );
}

act( AT_DEAD, "$n is DEAD!!", victim, 0, 0, TO_ROOM );
act( AT_DEAD, "You have been KILLED!!\n\r", victim, 0, 0, TO_CHAR );
break;
/********************************************************/

Then I wanted to see what would happen if I took out the ifs and acts in the middle, so if I was to re-write the code what would happen to the rest then I got wierd errors that didn't even seem to have to do with anything I did, it is all affected way done in the code. But when I put the ifs and acts back it works perfectly fine. So, it must be something I did! Well, now I've isolated it I could really use anyone's input! Thanks guys!

Here they are:

------------------Configuration: smaug140 - Win32 Debug------------------
Compiling...
fight.c
C:\...\SMAUG Source\fight.c(2487) : error C2275: 'bool' : illegal use of this type as an expression
c:\...\smaug source\mud.h(89) : see declaration of 'bool'
C:\...\SMAUG Source\fight.c(2487) : error C2146: syntax error : missing ';' before identifier 'is_safe'
C:\...\SMAUG Source\fight.c(2487) : error C2143: syntax error : missing ')' before 'type'
C:\...\SMAUG Source\fight.c(2487) : error C2198: 'is_safe' : too few actual parameters
C:\...\SMAUG Source\fight.c(2487) : error C2059: syntax error : ')'
C:\...\SMAUG Source\fight.c(2509) : error C2065: 'show_messg' : undeclared identifier
C:\...\SMAUG Source\fight.c(2606) : error C2061: syntax error : identifier 'legal_loot'
C:\...\SMAUG Source\fight.c(2606) : error C2059: syntax error : ';'
C:\...\SMAUG Source\fight.c(2606) : error C2059: syntax error : 'type'

Error executing cl.exe.

smaug.exe - 9 error(s), 0 warning(s)


The always thankful
~ROK~
(~Hey you~)
Top

Posted by Nick Gammon   Australia  (23,133 posts)  Bio   Forum Administrator
Date Reply #2 on Sat 25 Aug 2001 11:04 PM (UTC)
Message
It is hard to say without seeing your exact changes. Did you take out everything between the asterisks or just some of it?

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Rok   (41 posts)  Bio
Date Reply #3 on Sun 26 Aug 2001 01:00 AM (UTC)

Amended on Sun 26 Aug 2001 01:04 AM (UTC) by Rok

Message
Here is what I took out:

if ( skill->die_char && skill->die_char[0] != '\0' )
act( AT_DEAD, skill->die_char, ch, NULL, victim, TO_CHAR );
if ( skill->die_vict && skill->die_vict[0] != '\0' )
act( AT_DEAD, skill->die_vict, ch, NULL, victim, TO_VICT );
if ( skill->die_room && skill->die_room[0] != '\0' )
act( AT_DEAD, skill->die_room, ch, NULL, victim, TO_NOTVICT );
}

I was hoping that when I died it would just leave me there. Then I could add this upper part later in the script after I figured out if that would work.

The always thankful
~ROK~
(~Hey you~)
Top

Posted by Nick Gammon   Australia  (23,133 posts)  Bio   Forum Administrator
Date Reply #4 on Sun 26 Aug 2001 02:07 AM (UTC)
Message
You took out a "}" too many. That is part of the if.


if ( dt >= 0 && dt < top_sn )
{ // start of if

// blah blah

} // end of if


- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Rok   (41 posts)  Bio
Date Reply #5 on Wed 29 Aug 2001 04:33 AM (UTC)
Message
Do you Think that would even work? How would I go about programming it. All I could think of is to make the spell do something of the sort of changing the character position from POS_DEAD to POS_STANDING and having a built in restore... Would that work? I just don't know man.... Well I'll see what I can do and I'll post my results, any input would be great!

The always thankful
~ROK~
(~Hey you~)
Top

Posted by Nick Gammon   Australia  (23,133 posts)  Bio   Forum Administrator
Date Reply #6 on Wed 29 Aug 2001 09:56 PM (UTC)
Message
Well, you can make it do anything you want. The only limitations are the amount of time you have to spend on it.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Kelven   (10 posts)  Bio
Date Reply #7 on Sun 02 Sep 2001 11:00 PM (UTC)
Message
well... the way I'd go about it is first take out the code where it makes ya lose xp and stuff, then change the VNUM_TEMPLE (vnum they get trans'ed to when they die), make it point to a special "death" room, in there they'll get to pick whether they wanna "die" or be "resurrected" (or whatever your idea was :)). It could be done with an mprog I assume, you'd just have to add another trigger to the code.
(I'm very rusty on my smaug, been on ROT muds for the past year or so)
Like... if the character says "die", have the mprog trigger a new part of the code that will execute the rest of the regular death code. If the character says "ressurect", then make it do whatever.

I dont know if that's fairly clear, but it's all the thought I can really put into this until I re-familiarize myself with smaug.
Top

Posted by Rok   (41 posts)  Bio
Date Reply #8 on Thu 20 Sep 2001 08:02 PM (UTC)
Message
Alright Kelven.... That would rock! Hehe...... now if ONly I knew how to do that... Oh well, I'll try... thanks for the suggestion.

The always thankful
~ROK~
(~Hey you~)
Top

Posted by Kelsid   USA  (35 posts)  Bio
Date Reply #9 on Sun 14 Oct 2001 08:53 AM (UTC)
Message
Rok,


I just got a chance to look at your posting, and I came up with an idea. The code that automatically transfers a person to the alter is actually in handler.c not fight.c.

Specificly the code you may want to alter is the following:

 
      if ( !fPull )
    {
	location = NULL;

	if ( !IS_NPC(ch) && ch->pcdata->clan )
	    location = get_room_index( ch->pcdata->clan->recall );

	if ( !location )
	    location = get_room_index( ROOM_VNUM_ALTAR );

	if ( !location )
	    location = get_room_index( 1 );

	char_to_room( ch, location );
	/*
	 * Make things a little fancier				-Thoric
	 */
	if ( ( wch = get_char_room( ch, "healer" ) ) != NULL )
	{
	    act( AT_MAGIC, "$n mutters a few incantations, waves $s hands and points $s finger.",
		wch, NULL, NULL, TO_ROOM );
	    act( AT_MAGIC, "$n appears from some strange swirling mists!", ch, NULL, NULL, TO_ROOM );
	    sprintf(buf, "Welcome back to the land of the living, %s",
		    capitalize( ch->name ) );
	    do_say( wch, buf );
	}
	else
	    act( AT_MAGIC, "$n appears from some strange swirling mists!", ch, NULL, NULL, TO_ROOM );
        ch->position = POS_RESTING;
	return;
    }


You may want to comment that out totally if you want a person to "stay dead". Then I imagine you could create a command... like say decay, to trigger that above code. Then alls you need to do is set a timer to trigger that decay command automatically after a certain period of time. Then go into fight.c and alter the experience loss to refect the decay command being excecuted, instead of the state change to DEAD. That way you could manually create spells like your resurection spell, and you give the player a choice.


Hope these stray ideas help.

-Kelsid

-Kelsid
Top

Posted by Rok   (41 posts)  Bio
Date Reply #10 on Mon 15 Oct 2001 08:54 PM (UTC)
Message
Kelsid, You rock! Thanks! I was having some serious problems finding that code. That will work awesome! I'll keep you informed on how things go! Thanks again!

The always thankful
~ROK~
(~Hey you~)
Top

Posted by Kelsid   USA  (35 posts)  Bio
Date Reply #11 on Tue 16 Oct 2001 03:14 AM (UTC)
Message
Ok, Rok...

I might be able to save you some time though. I have my own altered death code finished. When characters die their state actually goes to POS_DEATH. They dont automaticaly go to the alter, they sit there. I had to do some modification to the do_say, and do_look commands (to add a case for POS_DEATH). So they can talk, and look, but thats it. (you also have to alter the commands.dat file to set the min position to 100). Then I created a new command called do_decay (I put it in act_move.c with the sit/stand/rest commands) I basically just added most of the statements I removed from handler.c, and the experience loss from fight.c) What I ended up with is a dead person that can decay at his choosing to be reincarnated. It opens possibilities in the future for spells like resurections, while at the same time allowing the person to decay if they dont feel like waiting. Also another good idea is to set a timer (best to match it to the bodies decay) for the do_decay command to kick off automaticaly if yer dead for a certain time.

If you run into any snags, just ask.

-Kelsid

-Kelsid
Top

Posted by Rok   (41 posts)  Bio
Date Reply #12 on Thu 01 Nov 2001 11:52 PM (UTC)
Message
Thanks again Kelsid, but I'm having troubles again. I can't figure out what in handler.c needs to be modified as you said. It could very well be I just missed a spot but I have been through the code several times and I'm just not seeing it. I fixed all the stuff in commands.dat and added do_decay but I'm not sure how to implement it. Any advice would be GREATLY appritiated! Thanks. (By the way, is your mud up and running? From what you have posted it sure would be interesting to check it out.)

The always thankful
~ROK~
(~Hey you~)
Top

Posted by Kelsid   USA  (35 posts)  Bio
Date Reply #13 on Fri 02 Nov 2001 05:32 AM (UTC)
Message
Rok,


Although nothing would please me more than to post all of my code on the forum, I doubt Nick would appreciate it :). Give me your email address and Ill send you my code. Ive worked a great deal of bugs out, and coverted the entire game mechanics to AD&D 3rd Edition rules.... I have completely chucked that old practice system, and replaced it with the skills/feats system. This allows greater felexibility and realism(DC checks). I have 265 player levels and my max stats (Str, Con, Dex, ect) stop at 100. Ive completely revamped the dieties and online building as well, As a matter of fact, my code is starting to move into a new direction, just as smaug did with the merc code. As far as my server is concerned, Its not ready for Users, or even Beta Testers at this point. Im slating a release of Dark Mesa as Jan 30, 2002. It will be open to beta testers only. On top of that, I still need to make contact with the SMAUG/MERC/DIKU teams, and get premission for using the code. Like I said, I have many obstacles to overcome and a fairly short deadline. If you would like to take a look at my server (and dont mind the mess) send me an email and Ill show you around.


-Kelsid

-Kelsid
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.


33,353 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.