Source Editing - Pre-Identifying Items?

G

Guest

Guest
Archived from groups: rec.games.roguelike.nethack (More info?)

Although I know next to nothing of C, I've been toying a bit with the
3.4.3 source with the goal of eliminating the need to identify things,
i.e. make everything pre-identified. Are there any source-divers out
there who know how to make this alteration? I already know about the
CTRL-I command in wizard mode; it's just annoying to have to pick items
up to use it. I've looked around online and have yet to find any
information or preexisting patches that fit the bill. Please, any
assistance would be greatly appreciatedd

(This is my first post to this newsgroup. I apologize if there's
something obvious I missed or a flag I should have put in the title. I
read the FAQ and didn't see anything that applied.)

Taramnos
 
G

Guest

Guest
Archived from groups: rec.games.roguelike.nethack (More info?)

Andrew D. Hilton wrote:
> On 2005-03-05, Taramnos <taramnos@gmail.com> wrote:
> > Although I know next to nothing of C, I've been toying a bit with
the
> > 3.4.3 source with the goal of eliminating the need to identify
things,
> > i.e. make everything pre-identified. Are there any source-divers
out
> > there who know how to make this alteration? I already know about
the
> > CTRL-I command in wizard mode; it's just annoying to have to pick
items
> > up to use it. I've looked around online and have yet to find any
> > information or preexisting patches that fit the bill. Please, any
> > assistance would be greatly appreciatedd
> >
> > (This is my first post to this newsgroup. I apologize if there's
> > something obvious I missed or a flag I should have put in the
title. I
> > read the FAQ and didn't see anything that applied.)
>
> The easiest way to do this is probably to loop through all the
objects
> and call knows_object() on them in u_init() found in u_init.c
> I think that this code would do it, but I havent tested it:
>
> static void
> know_all(){
> int i;
> /* start at 1, since 0 is STRANGE_OBJECT */
> for(i=1;i<NUM_OBJECTS;i++){
> knows_object(i);
> }
> }
>
> put that code snippet in u_init.c before the u_init() function, then
> go down to where it says:
> /*** Role-specific initializations ***/
>
> and just put the line
>
> know_all();
>
> right below it.
>
> Like I said- havent tried it, but if it gives you problems, ask, and
Ill
> look into it in more detail.
> --
> Andrew D. Hilton
> UPenn Phd Student

Ok, did what you said and it worked for the most part, but the B/C/U
status of items still isn't displayed. Would that require more editing?
 
G

Guest

Guest
Archived from groups: rec.games.roguelike.nethack (More info?)

Sorry for double-posting like this, but I just noticed that the
enchantment of items isn't displayed, either.
 
G

Guest

Guest
Archived from groups: rec.games.roguelike.nethack (More info?)

Andrew D. Hilton wrote:
> I thikn you want to chnage objnam.c- in the xname function, where it
> says:
>
> if (Role_if(PM_PRIEST)) obj->bknown = TRUE;
>
>
> make it just say
>
> obj->bknown = TRUE;
>
>
>
> --
> Andrew D. Hilton
> UPenn Phd Student

Ok, I did that and it worked. All that's left is to display the level
of enchantment. Know how to do that?
 
G

Guest

Guest
Archived from groups: rec.games.roguelike.nethack (More info?)

On 2005-03-05, Taramnos <taramnos@gmail.com> wrote:
> Although I know next to nothing of C, I've been toying a bit with the
> 3.4.3 source with the goal of eliminating the need to identify things,
> i.e. make everything pre-identified. Are there any source-divers out
> there who know how to make this alteration? I already know about the
> CTRL-I command in wizard mode; it's just annoying to have to pick items
> up to use it. I've looked around online and have yet to find any
> information or preexisting patches that fit the bill. Please, any
> assistance would be greatly appreciatedd
>
> (This is my first post to this newsgroup. I apologize if there's
> something obvious I missed or a flag I should have put in the title. I
> read the FAQ and didn't see anything that applied.)

The easiest way to do this is probably to loop through all the objects
and call knows_object() on them in u_init() found in u_init.c
I think that this code would do it, but I havent tested it:

static void
know_all(){
int i;
/* start at 1, since 0 is STRANGE_OBJECT */
for(i=1;i<NUM_OBJECTS;i++){
knows_object(i);
}
}

put that code snippet in u_init.c before the u_init() function, then
go down to where it says:
/*** Role-specific initializations ***/

and just put the line

know_all();

right below it.

Like I said- havent tried it, but if it gives you problems, ask, and Ill
look into it in more detail.
--
Andrew D. Hilton
UPenn Phd Student
 
G

Guest

Guest
Archived from groups: rec.games.roguelike.nethack (More info?)

Taramnos <taramnos@gmail.com> wrote:
> Although I know next to nothing of C, I've been toying a bit with the
> 3.4.3 source with the goal of eliminating the need to identify things,
> i.e. make everything pre-identified. Are there any source-divers out
> there who know how to make this alteration? I already know about the
> CTRL-I command in wizard mode; it's just annoying to have to pick items
> up to use it. I've looked around online and have yet to find any
> information or preexisting patches that fit the bill. Please, any
> assistance would be greatly appreciatedd

add something like this to uinit() in src/u_init.c:

for (int ct = 1; ct < NUM_OBJECTS; ct++)
knows_object(ct);

--
Pasi Kallinen
paxed@alt.org
 
G

Guest

Guest
Archived from groups: rec.games.roguelike.nethack (More info?)

On 2005-03-05, Taramnos <taramnos@gmail.com> wrote:
>
> Ok, did what you said and it worked for the most part, but the B/C/U
> status of items still isn't displayed. Would that require more editing?

I thikn you want to chnage objnam.c- in the xname function, where it says:

if (Role_if(PM_PRIEST)) obj->bknown = TRUE;


make it just say

obj->bknown = TRUE;



--
Andrew D. Hilton
UPenn Phd Student
 
G

Guest

Guest
Archived from groups: rec.games.roguelike.nethack (More info?)

"Taramnos" <taramnos@gmail.com> wrote in news:1110046462.077248.130760
@z14g2000cwz.googlegroups.com:

> Sorry for double-posting like this, but I just noticed that the
> enchantment of items isn't displayed, either.

Yeah, there's a fundamental difference between knowing in general what an
item is and then knowing the specifics of that item. For instance, once
you know a scroll of identify, you know all scrolls of identify, but you
have to B/U/C each on an individual basis. This part of the code might be
a bit harder - if there's an initialization function that is called for
each item, put in there a call to a function that identifies it.



--
~ Cyde Weys ~
So say we all.
 
G

Guest

Guest
Archived from groups: rec.games.roguelike.nethack (More info?)

On 2005-03-05, Taramnos <taramnos@gmail.com> wrote:
> Sorry for double-posting like this, but I just noticed that the
> enchantment of items isn't displayed, either.

you can probably just change the

obj->bknown = TRUE;

line in xname() that you just changed (from checking if you are a priest)
to

obj->known = obj->rknown = obj->bknown = TRUE;

(that will also make you know if its rustproof or fireproof)

--
Andrew D. Hilton
UPenn Phd Student
 

James

Distinguished
Dec 31, 2007
1,388
0
19,280
Archived from groups: rec.games.roguelike.nethack (More info?)

In article <1110041398.300234.119460@f14g2000cwb.googlegroups.com>,
Taramnos <taramnos@gmail.com> wrote:

>Although I know next to nothing of C, I've been toying a bit with the
>3.4.3 source with the goal of eliminating the need to identify things,

That is almost the entire challenge of the early game.

>CTRL-I command in wizard mode; it's just annoying to have to pick items
>up to use it.

It looks very simple at first glance; any struct obj* can be passed
to fully_identify_object(obj), regardless of whether it's in inventory
or not. It might be simpler just to roll through all the object types
and send them through makeknown when the game starts, or go straight
to discover_object, which is how the game sets up the things your
class/race knows, and also starting inventory I think. You should be
able to do it easily for specific objects, by putting more
knows_object(type) statements in u_init cases for each class.
 

Chuck

Distinguished
Nov 19, 2001
1,479
0
19,280
Archived from groups: rec.games.roguelike.nethack (More info?)

Cyde Weys <cyde@umd.edu> wrote in
news:Xns96108DF84BF242galopagosterrapincy@128.8.10.18:

> "Taramnos" <taramnos@gmail.com> wrote in news:1110046462.077248.130760
> @z14g2000cwz.googlegroups.com:
>
>> Sorry for double-posting like this, but I just noticed that the
>> enchantment of items isn't displayed, either.
>
> Yeah, there's a fundamental difference between knowing in general what
> an item is and then knowing the specifics of that item. For instance,
> once you know a scroll of identify, you know all scrolls of identify,
> but you have to B/U/C each on an individual basis. This part of the
> code might be a bit harder - if there's an initialization function
> that is called for each item, put in there a call to a function that
> identifies it.
>
>
>
probably a bad example as cursed, "normal" and blessed scrolls if ID seem
to act the same. Ok not blessed, but sometimes the normal will id
everything you have and maybe cursed too.
 
G

Guest

Guest
Archived from groups: rec.games.roguelike.nethack (More info?)

chuck wrote:

> probably a bad example as cursed, "normal" and blessed scrolls if ID
> seem to act the same. Ok not blessed, but sometimes the normal will id
> everything you have and maybe cursed too.

No, a cursed scroll of identify only ever identifies one item. Except when
you're confused; then it will only identify itself ("You identify this as
an identify scroll") but so will uncursed and blessed.

Raisse, killed by burning scrolls

--
irina@valdyas.org LegoHack: http://www.valdyas.org/irina/nethack/
Status of Raisse (piously neutral): Level 8 HP 63(67) AC -3, fast.
 
G

Guest

Guest
Archived from groups: rec.games.roguelike.nethack (More info?)

Raisse the Thaumaturge wrote:

> No, a cursed scroll of identify only ever identifies one item. Except
> when you're confused; then it will only identify itself ("You
> identify this as an identify scroll") but so will uncursed and
> blessed.

<nitpick>
You could have left out the exception. After all, when it identifies
only itself, it *also* identifies exactly one item.
</nitpick>

:)

--
Boudewijn Waijers (kroisos at home.nl).

The garden of happiness is surrounded by a wall so low only children
can look over it. - "the Orphanage of Hits", former Dutch radio show.
 
G

Guest

Guest
Archived from groups: rec.games.roguelike.nethack (More info?)

Boudewijn Waijers <kroisos@removethisword.home.nl> wrote:

> <nitpick>
> You could have left out the exception. After all, when it identifies
> only itself, it *also* identifies exactly one item.
> </nitpick>

<nitpick>
Then it identifies TWO items normally: itself, and one other item :)
</nitpick>

-Heikki
 
G

Guest

Guest
Archived from groups: rec.games.roguelike.nethack (More info?)

Heikki Moilanen wrote:
> Boudewijn Waijers <kroisos@removethisword.home.nl> wrote:

>> <nitpick>
>> You could have left out the exception. After all, when it identifies
>> only itself, it *also* identifies exactly one item.
>> </nitpick>

> <nitpick>
> Then it identifies TWO items normally: itself, and one other item :)
> </nitpick>

No it doesn't. When you read a scroll of identify while confused, it
identifies only itself, NO other item.

--
Boudewijn Waijers (kroisos at home.nl).

The garden of happiness is surrounded by a wall so low only children
can look over it. - "the Orphanage of Hits", former Dutch radio show.
 
G

Guest

Guest
Archived from groups: rec.games.roguelike.nethack (More info?)

Boudewijn Waijers <kroisos@removethisword.home.nl> wrote:
> Heikki Moilanen wrote:
> > Then it identifies TWO items normally: itself, and one other item :)

> No it doesn't. When you read a scroll of identify while confused, it
> identifies only itself, NO other item.

I meant "normally" as in "reading a cursed scroll while not confused",
while reading it when confused would only identify the identify scroll
itself.

Sorry if I wasn't too clear.

-Heikki
 
G

Guest

Guest
Archived from groups: rec.games.roguelike.nethack (More info?)

Heikki Moilanen wrote:
> Boudewijn Waijers <kroisos@removethisword.home.nl> wrote:
>> Heikki Moilanen wrote:

>>> Then it identifies TWO items normally: itself, and one other item :)

>> No it doesn't. When you read a scroll of identify while confused, it
>> identifies only itself, NO other item.

> I meant "normally" as in "reading a cursed scroll while not confused",
> while reading it when confused would only identify the identify scroll
> itself.

When you read a cursed scroll while *not* confused, and it "identifies
only itself", it still identifies exactly one item, which was what I
said.

> Sorry if I wasn't too clear.

You *were* clear. You were also wrong. When you're nitpicking, reread
what you write before clicking the "send" button, because everything you
say can and will be used against you.

:)

But I reacted to the following statement by Raisse, which you removed
when you quoted me:

" No, a cursed scroll of identify only ever identifies one item.
Except when you're confused; then it will only identify itself
("You identify this as an identify scroll") but so will uncursed
and blessed. "

And even then, my assertion that "when it identifies only itself, it
[*also*] identifies exactly one item" is always true, even when we're
not talking about confused reading.

--
Boudewijn Waijers (kroisos at home.nl).

The garden of happiness is surrounded by a wall so low only children
can look over it. - "the Orphanage of Hits", former Dutch radio show.
 
G

Guest

Guest
Archived from groups: rec.games.roguelike.nethack (More info?)

Boudewijn Waijers <kroisos@removethisword.home.nl> wrote:

> When you read a cursed scroll while *not* confused, and it "identifies
> only itself", it still identifies exactly one item, which was what I
> said.

But...

Reading a cursed scroll of identify while not confused also identifies one
other item... I mean, the scroll of identify is also added to your
Discoveries list (identified), if you haven't already identified it
before. So that's TWO items, the scroll itself and the other item you
happen to identify ;-)

> everything you
> say can and will be used against you.

As it should be, if I'm wrong. But I haven't admitted it, atleast yet :)

I admit, you're right as long as the identity of the scroll of identify is
known prior to reading the cursed scroll.

-Heikki
 
G

Guest

Guest
Archived from groups: rec.games.roguelike.nethack (More info?)

On 3/9/05 9:53 AM, Boudewijn Waijers wrote:
>
> When you read a cursed scroll while *not* confused, and it "identifies
> only itself", it still identifies exactly one item, which was what I
> said.

No, Boudewijn, now *you're* wrong. From scrl-343.txt:

identify
Always identified when read.
[snip]
cursed
You can identify one item from your inventory.
"This is an identify scroll."
confused
You merely identify the scroll.
"You identify this as an identify scroll."

So if you read a cursed scroll while not confused, it does *not*
"identify only itself." It identifies one item from your inventory and
also identifies itself. So it identifies two items, just as Heikki had said.
>
>
> [Heikki Moilanen wrote:]
>>Sorry if I wasn't too clear.
>
>
> You *were* clear. You were also wrong. When you're nitpicking, reread
> what you write before clicking the "send" button, because everything you
> say can and will be used against you.
>
> :)

Indeed.
>
> But I reacted to the following statement by Raisse, which you removed
> when you quoted me:
>
> " No, a cursed scroll of identify only ever identifies one item.
> Except when you're confused; then it will only identify itself
> ("You identify this as an identify scroll") but so will uncursed
> and blessed. "
>
> And even then, my assertion that "when it identifies only itself, it
> [*also*] identifies exactly one item" is always true, even when we're
> not talking about confused reading.
>
And you're reiterating misinformation here. You know, you can check
these things out in wizard mode....

--
Kevin Wayne

"I came to Casablanca for the waters."
"Waters? What waters? We're in the desert?"
"I was misinformed."
 
G

Guest

Guest
Archived from groups: rec.games.roguelike.nethack (More info?)

Heikki Moilanen wrote:
> Boudewijn Waijers <kroisos@removethisword.home.nl> wrote:

>> When you read a cursed scroll while *not* confused, and it
>> "identifies only itself", it still identifies exactly one item,
>> which was what I said.

> Reading a cursed scroll of identify while not confused also
> identifies one other item...

But I was specifically and *only* talking about any case where the
scroll "identifies only itself" (thet is a literal quote from my first
post).

You can say whatever you want, but when a scroll "identifies only
itself", it does *not* identify more than only itself, hence exactly one
item.

--
Boudewijn Waijers (kroisos at home.nl).

The garden of happiness is surrounded by a wall so low only children
can look over it. - "the Orphanage of Hits", former Dutch radio show.
 
G

Guest

Guest
Archived from groups: rec.games.roguelike.nethack (More info?)

Kevin Wayne wrote:
> On 3/9/05 9:53 AM, Boudewijn Waijers wrote:

>> When you read a cursed scroll while *not* confused, and it
>> "identifies only itself", it still identifies exactly one item,
>> which was what I said.

> So if you read a cursed scroll while not confused, it does *not*
> "identify only itself." It identifies one item from your inventory and
> also identifies itself. So it identifies two items, just as Heikki
> had said.

I was talking about a case where you read a cursed scroll while not
confused *AND* it identifies only itself. You are talking about a case
where you read a cursed scroll while not confused where it does *not*
identify only itself. That is not the case I was talking about.

>> And even then, my assertion that "when it identifies only itself, it
>> [*also*] identifies exactly one item" is always true, even when we're
>> not talking about confused reading.

> And you're reiterating misinformation here.

No I'm not. The statement "when a scroll identifies only itself, it
identifies exactly one item" is inherently always true.

You may say that the part before the comma can never become true, but
logic tells us that A=>B AND NOT(A) is a correct statement. For example:
A="0=1" and B="The moon is made of green cheese". Since A is wrong, B
follows from A.

Every statement made about the empty collection is always true.

--
Boudewijn Waijers (kroisos at home.nl).

The garden of happiness is surrounded by a wall so low only children
can look over it. - "the Orphanage of Hits", former Dutch radio show.
 
G

Guest

Guest
Archived from groups: rec.games.roguelike.nethack (More info?)

Boudewijn Waijers <kroisos@removethisword.home.nl> wrote:

> I was talking about a case where you read a cursed scroll while not
> confused *AND* it identifies only itself.

And there isn't such a case in Nethack.

> No I'm not. The statement "when a scroll identifies only itself, it
> identifies exactly one item" is inherently always true.

Yes, so it is.

What I originally thought was that you agreed with Raisse that a cursed
scroll of identify always identifies exactly one item. Seems I
misunderstood.

-Heikki
 

seraphim

Distinguished
Mar 27, 2003
184
0
18,680
Archived from groups: rec.games.roguelike.nethack (More info?)

Heikki Moilanen <heikkimo@paju.oulu.sbam.fi> wrote in news:d0onc1$3ar$1
@news.oulu.fi:

> Boudewijn Waijers <kroisos@removethisword.home.nl> wrote:
>
>> I was talking about a case where you read a cursed scroll while not
>> confused *AND* it identifies only itself.
>
> And there isn't such a case in Nethack.

What happens if you read an unided scroll of identify and it is the only
item in your inventory?
What happens if you read an unided scroll of identify and everything else
in your inventory is already identified?
 
G

Guest

Guest
Archived from groups: rec.games.roguelike.nethack (More info?)

Seraphim wrote:

>
> What happens if you read an unided scroll of identify and it is the
> only item in your inventory?

As you read the scroll, it disappears. This is an identify scroll.

> What happens if you read an unided scroll of identify and everything
> else in your inventory is already identified?

As you read the scroll, it disappears. This is an identify scroll.--More--
You have already identified all of your possessions.


Have you considered using wizard mode to get the answers to this sort of
question?