Difference between revisions of "Talk:Naming artifacts"

From NetHackWiki
Jump to navigation Jump to search
(Is this just a forgotten relic?: Note on oartifact)
(Is this actually a _bug_?)
Line 20: Line 20:
  
 
::To get rid of the naming bug this way, you could allow the name to go through, but still apply the naming restriction to setting oartifact. -- [[User:Ray Chason|Ray Chason]] 08:41, 3 September 2006 (UTC)
 
::To get rid of the naming bug this way, you could allow the name to go through, but still apply the naming restriction to setting oartifact. -- [[User:Ray Chason|Ray Chason]] 08:41, 3 September 2006 (UTC)
 +
 +
== Is this actually a bug? ==
 +
 +
If the DevTeam doesn't think this is a bug, I don't think we should call it one. I can't find it in the bugs list. -- [[User:Raxvulpine|Raxvulpine]]

Revision as of 19:46, 8 September 2006

Is this just a forgotten relic?

Noting the existance of the oartifact field, I wonder if NetHack still uses the artifact's name for anything. Here's a trick I pulled off SLASH'EM that seems to indicate names are irrelevant:

  1. Start SLASH'EM (IIRC worked in 0.0.7E7 a yearish ago, I cannot test ATM since I've misplaced my binaries)
  2. ^Wish up an elven dagger and a potion of gain level.
  3. Name the elven dagger 'The Great Dagger of Glaurgnaa'
  4. Dip the elven dagger into the potion of gain level.

The elven dagger will now be upgraded into a great dagger, keeping its name; thus you now have a 'great dagger named The Great Dagger of Glaurgnaa'. That is the the name and base item of the Necromancer quest artifict. But you didn't create an artifact! You do NOT get level drain resistance, magic resistance, or ENERGY_BOOST invokation.

I also (just now) tested this in vanilla, using a hex editor instead of the upgrade exploit, and the Eye instead of the GDoG. Again, energy did not regenerate with the hand-named amulet, and did regenerate with the wished artifact. ^G summoned quest nemesis did not steal named amulet, but stole wished amulet.

It seems like the artifact naming trick could trivially be fixed by removing the name-restriction code.

--Stefanor 07:35, 3 September 2006 (UTC)

I patched my copy of the NetHack source to try this out: I #ifdef 0'd do_name.c#line313 through do_name.c#line323. I got the opposite results you did; my named Eye of the Aethiopica worked just as well as the real thing (as soon as I dropped it and picked it up after naming it to make sure the extrinsics were set), even in explore mode. Are you sure wished for an amulet of ESP? Perhaps the use of the hex editor screwed NetHack up. --Eidolos 07:46, 3 September 2006 (UTC)
It's oartifact, not the name, that makes an artifact an artifact. When the name is set, if the base object and the name match an artifact, oartifact is also set. See artifact.c#line112. IOW, you may have a long sword and its name may be Vorpal Blade, but if oartifact is 0, it ain't Vorpy; and if you're wielding a pancake, and oartifact is set to VORPAL_BLADE, you're going to be chopping heads with that baby.
To get rid of the naming bug this way, you could allow the name to go through, but still apply the naming restriction to setting oartifact. -- Ray Chason 08:41, 3 September 2006 (UTC)

Is this actually a bug?

If the DevTeam doesn't think this is a bug, I don't think we should call it one. I can't find it in the bugs list. -- Raxvulpine