Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How to Level up and Gaine EXP in Inform 7?

84 views
Skip to first unread message

TJ Weston

unread,
May 31, 2010, 6:59:23 PM5/31/10
to
How to make NPC and Player gain exp?
Help plz, Thanks

cunningjames

unread,
May 31, 2010, 7:33:38 PM5/31/10
to
On May 31, 6:59 pm, TJ Weston <olp...@gmail.com> wrote:
> How to make NPC and Player gain exp?
> Help plz, Thanks

Well, you could do something as simple as:

<code>Each person has a number called experience. The experience of
the a person is usually 0.</code>

and when the player has done something experience-worthy:

<code>increment the experience of the player by 1.</code>

Best,
James

Roger

unread,
Jun 2, 2010, 7:40:15 PM6/2/10
to
On May 31, 6:59 pm, TJ Weston <olp...@gmail.com> wrote:
> How to make NPC and Player gain exp?
> Help plz, Thanks

a) Implement a system similar to the built-in scoring system, or...
b) Just use the built-in scoring system.and reference it as
"EXPERIENCE" to the end user, instead of "SCORE"

That's a simplistic answer, but honestly I would just do a searching
in the documentation for the keywords "score' or "scoring" and read up
on that system. I'm assuming you want to award experience points after
certain actions, and awarding score points works exactly that way.

As for "levels" you can also do something like that using a scoring
table, which is also kind of built into Inform 7. Refer to chapter 9.3
("Introducing tables: rankings") in the documentation.

cunningjames

unread,
Jun 3, 2010, 10:58:06 AM6/3/10
to

He says that he would like "NPC"s to be able to gain experience and
levels, so I'm not sure the built-in system would be precisely what he
wants. If the author wished to make his own system, he could very
simply do something like the following:

<code>
"Lurking"

Level is a kind of value. The levels are novice, apprentice,
journeyman, and master. Each person has a level. The level of a person
is usually novice.

Each person has a number called experience. The experience of a person
is usually 0.

When play begins:
change the left hand status line to "Experience: [experience of the
player]".

To provide (character - a person) with (n - a number) experience
points:
increment the experience of the character by n;
possibly level up the character.

To possibly level up (character - a person):
if the level of the character is not master:
let the next level be the level after the level of the character;
let the target be the threshold corresponding to the rank of next
level in the Table of Thresholds;
if the target is not greater than the experience of the character:
say "Congrats[if the player is not the character] to [character]
[end if] for a level gained!!";
change the level of the character to the next level.

Table 1 - Thresholds
rank threshold
novice 0
apprentice 10
journeyman 20
master 30

The bedroom is a room. "Desk, computer, all that stuff."

Lurking is an action applying to nothing. Understand "lurk" as
lurking.

Carry out lurking: provide the player with 5 experience points. Report
lurking: say "You find yourself with a greater proficiency in their
ways."

Carry out a person lurking: provide the person asked with 10
experience points. Report a person lurking: say "You feel that [the
actor] continues to gain proficiency in their ways."

TJ is a man in the bedroom. The description of TJ is "[experience of
TJ]". Every turn: try TJ lurking.
</code>

Best,
James

Robin Horneman

unread,
Jan 23, 2023, 10:01:57 AM1/23/23
to
Very old thread but I couldn't make this code work in the latest version of Inform 7.
0 new messages