A question about Spells and skills..

Posted by Toy on Tue 17 Feb 2004 01:37 AM — 9 posts, 32,082 views.

#0
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
#1
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...
#2
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.


Australia Forum Administrator #3
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?
#4
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
Australia Forum Administrator #5
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?
#6
1.32

-Toy
#7
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 (:
Australia Forum Administrator #8
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.