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 ➜ A question about Spells and skills..

A question about Spells and skills..

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


Posted by Toy   (206 posts)  Bio
Date Tue 17 Feb 2004 01:37 AM (UTC)
Message
I was going through debugging and testing and I ran into an error. I typed in the command "practice" and this occurred:

refresh 100% remove curse 100% remove invis 100% remove trap 100%
----------------------------------[Spells]----------------------------------
reserved 100% sanctuary 100% scry 100%
shadowform 100% shield 100%

I noticed that the spells header had occured about halfway done the list. SO I looked further into this problem. I noticed that the original SMAUG code had the Reserved skill on the top of the skills.dat list and I guess the check for the Spells head occurs after the spell reserved.

    	if ( argument[0] == '\0' )
    	{
	int		col;
	sh_int	lasttype, cnt;

	col = cnt = 0;	
	lasttype = SKILL_SPELL;
	set_pager_color( AT_MAGIC, ch );
	for ( sn = 0; sn < top_sn; sn++ )
	{
	if ( !skill_table[sn]->name )
	break;

      if ( strcmp(skill_table[sn]->name, "reserved") == 0 && ( IS_IMMORTAL(ch) || DUAL_SKILL(ch, sn) ) )
	{
	if ( col % 3 != 0 )
	send_to_pager( "\n\r", ch );
	set_pager_color( AT_MAGIC, ch );
	send_to_pager_color( " ----------------------------------[&CSpells&B]----------------------------------\n\r", ch);
	col = 0;
	}


I believe that when I used the area editor it set my spells in alphabetical order, disrupting this. How would I go about fixing this?

-Toy

It's always good to know how far you are willing to go to be the best...

Karl Mancine
aka
Toy the Dark Puppet
Top

Posted by Toy   (206 posts)  Bio
Date Reply #1 on Tue 17 Feb 2004 01:41 AM (UTC)
Message
Ok.. quick dumb fix: simply put the spell Reserved back at the top of the skills.dat file. Have to remember to not use the area editor when working on skills. Seems to have a couple of strange faults, 2 of them being it rearranges the list into alphabetical order, and the second, it seems to like added 'blind' to all spell effects... wierd huh?

-Toy keeps finding dumb things wrong today...

It's always good to know how far you are willing to go to be the best...

Karl Mancine
aka
Toy the Dark Puppet
Top

Posted by Gregar   (20 posts)  Bio
Date Reply #2 on Tue 17 Feb 2004 09:02 AM (UTC)
Message
Not only did it default everything to blind, after I fixed each one of those manually, it changed all my new spell codes to spell_snooze.

Wish I had seen your reminder before I went thru line per line re-applying the new code.


Top

Posted by Nick Gammon   Australia  (23,166 posts)  Bio   Forum Administrator
Date Reply #3 on Tue 17 Feb 2004 10:09 PM (UTC)
Message
It does sort them into alphabetical order - does that matter? They are still the same spells/skills.

As for the blindness or spell_snooze problem, can you give an example? I added an extra spell and it took the code it was assigned.

Bearing in mind the skills.dat file is just a text file you can edit it and see what is going on.

Here is a skill from it before using the Area Editor:


#SKILL
Name         armor~
Type         Spell
Info         0
Flags        0
Target       2
Minpos       111
Slot         1
Mana         5
Rounds       12
Code         spell_smaug
Dammsg       ~
Wearoff      Your armor returns to its mundane value.~
Hitchar      $N's armor begins to glow softly as it is enhanced by a cantrip.~
Hitvict      Your armor begins to glow softly as it is enhanced by a cantrip.~
Hitroom      $N's armor begins to glow softly as it is enhanced by a cantrip.~
Affect       'l*10' 17 '-20' -1
Minlevel     1
End


And now after making a change (to something else) and saving the skills.dat file:


#SKILL
Name         armor~
Type         Spell
Flags        0
Target       2
Minpos       111
Slot         1
Mana         5
Rounds       12
Code         spell_smaug
Dammsg       ~
Wearoff      Your armor returns to its mundane value.~
Hitchar      $N's armor begins to glow softly as it is enhanced by a cantrip.~
Hitvict      Your armor begins to glow softly as it is enhanced by a cantrip.~
Hitroom      $N's armor begins to glow softly as it is enhanced by a cantrip.~
Affect      'l*10' 17 '-20' -1
Minlevel     1
End


The only difference is it seems to have removed the "Info" line. If you are having other problems can you post the actual skill/spell before and after the Area Editor changed it, and point out which part you think is wrong?

- Nick Gammon

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

Posted by Toy   (206 posts)  Bio
Date Reply #4 on Thu 19 Feb 2004 07:10 AM (UTC)
Message
To be honest, I can't explain what happened I just know this:

#SKILL
Name antimagic shell~
Type Spell
Info 0
Flags 0
Target 3
Minpos 108
Slot 224
Mana 40
Rounds 12
Code spell_smaug
Dammsg ~
Wearoff The shimmering shell and its protection from magic fade away...~
Hitvict A shimmering translucent shell forms about you.~
Hitroom A shimmering translucent shell forms about $N.~
Affect 'l*23' 27 '1048576' -1
Minlevel 17
End

In the line Affect, as with all spell_smaug skills, it changed the -1 to a 0, thus affected all the skills with 'blind'.

-Toy

It's always good to know how far you are willing to go to be the best...

Karl Mancine
aka
Toy the Dark Puppet
Top

Posted by Nick Gammon   Australia  (23,166 posts)  Bio   Forum Administrator
Date Reply #5 on Thu 19 Feb 2004 08:26 PM (UTC)
Message
I cannot reproduce that. I put the stuff you have there into a separate file, added #END to the end of it, loaded it into the Area Editor (as a skills file), changed something else (Info to 1) then saved it.

When I looked at it in a text editor the -1 was still -1.

What version of the Area Editor do you have?

- Nick Gammon

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

Posted by Toy   (206 posts)  Bio
Date Reply #6 on Thu 19 Feb 2004 11:39 PM (UTC)
Message
1.32

-Toy

It's always good to know how far you are willing to go to be the best...

Karl Mancine
aka
Toy the Dark Puppet
Top

Posted by Malelder   (9 posts)  Bio
Date Reply #7 on Fri 16 Jul 2004 10:23 PM (UTC)
Message
Same thing just happened to me, it looked like AE was setting the Flags setting on any spell affects to -1...which changed everything to Blind (:
Top

Posted by Nick Gammon   Australia  (23,166 posts)  Bio   Forum Administrator
Date Reply #8 on Fri 16 Jul 2004 11:41 PM (UTC)
Message
I still can't reproduce this. I changed the flags on "armor" to zero, saved it, edited the file in another editor, and it was indeed zero.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
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.


29,355 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.