I7 - Les questions d'un débutant

Bon, j’ai passé mon weekend en lisant les 2 livres sur Inform7, impossible de retenir tous ca :unamused:

Donc j’ai décidé de commencer un petit jeux et simplement de voir ou ça coince…

Ça n’a pas durer longtemps avant les problèmes ont commencé, mais la plupart j’ai pu resoudre à partir de la notice et quelques exemples.

Actuellement il me reste 2 que je n’ai pas trouvé.
Alors, mon petit jeux commence dans la cuisne d’une maison

La cuisine is a room. "[if unvisited] Vous êtes dans une cuisine. Un endroit plutôt bizarre pour se réveiller, non ? La seule chose au quel vous pouvez penser est de sortir... 
Dans la cuisine il y a une armoire et une table, il y a aussi une porte fermée sur le coté est de la pièce. [otherwise] vous êtes de retour dans la cuisine ou vous vous êtes réveillé.[end if]" 

Tous va bien, sauf que… quand je sort de la cuisine et je revient je n’ai pas la 2° description de la cuisine ? Elle ne s’affiche pas, pourtant je pense qu’elle a les status de ‹ visited › parce que au début du jeu on démarre dans la cuisine?

Et aussi : à chaque fois que j’entre dans un room, le système m’affiche ‹ vous pouvez voire … › et une liste des objets dans cette room. Comment suprrimer ce message ?

merci d’avance

k

salut,

pour le premier point, c’est facile, c’est juste parce que les jeux sont systématiquement en mode « non verbose ». Donc soit le joueur tape « verbose » pendant le jeu (et l’annule avec « brief »), soit en tant qu’auteur tu ajoutes :

Use full-length room descriptions.

et là cela fonctionne.

Pour la seconde question, je n’ai pas de réponse simple.

Pour supprimer la liste des objets dans une pièce il suffit d’écrire :

Rule for listing contents: do nothing.

Par contre cela écrit toujours : you can see… / vous pouvez voir.

Pour cela il faut remplacer par cette longue fonction en dessous :

mais ça fonctionne pour un jeu anglais, dans un jeu français cela entre en conflit avec ma propre définition.
Donc tu devras modifier ma définition « French » pour retirer les « vous pouvez voir ». Ou alors on va demander sur la liste de discussion inform comment faire, je vais essayer ce soir, peut être on peut faire plus simple.

Section 1 - Descriptions locale (in place of Section SR2/13 - Locale descriptions - Unindexed in Standard Rules by Graham Nelson)

Table of Locale Priorities
notable-object (an object) locale description priority (a number)


with blank rows for each thing.

To describe locale for (O - object):
carry out the printing the locale description activity with O.

To set the/-- locale priority of (O - an object) to (N - a number):
if O is a thing:
if N <= 0, now O is mentioned;
if there is a notable-object of O in the Table of Locale Priorities:
choose row with a notable-object of O in the Table of Locale Priorities;
if N <= 0, blank out the whole row;
otherwise change the locale description priority entry to N;
otherwise:
if N is greater than 0:
choose a blank row in the Table of Locale Priorities;
change the notable-object entry to O;
change the locale description priority entry to N;

Printing the locale description of something (documented at act_pld) is an activity.

The locale paragraph count is a number that varies.

Before printing the locale description (this is the initialise locale description rule):
now the locale paragraph count is 0;
repeat with item running through things:
now the item is not mentioned;
repeat through the Table of Locale Priorities:
blank out the whole row.

Before printing the locale description (this is the find notable locale objects rule):
let the domain be the parameter-object;
carry out the choosing notable locale objects activity with the domain;
continue the activity.

For printing the locale description (this is the interesting locale paragraphs rule):
let the domain be the parameter-object;
sort the Table of Locale Priorities in locale description priority order;
repeat through the Table of Locale Priorities:
[say « [notable-object entry]… »;]
carry out the printing a locale paragraph about activity with the notable-object entry;
continue the activity.

For printing the locale description (this is the you-can-also-see rule):
let the domain be the parameter-object;
let the mentionable count be 0;
repeat with item running through things:
now the item is not marked for listing;
repeat through the Table of Locale Priorities:
[say « [notable-object entry] - [locale description priority entry]. »;]
if the locale description priority entry is greater than 0,
now the notable-object entry is marked for listing;
increase the mentionable count by 1;
if the mentionable count is greater than 0:
repeat with item running through things:
if the item is mentioned:
now the item is not marked for listing;
begin the listing nondescript items activity;
if the number of marked for listing things is 0:
abandon the listing nondescript items activity;
otherwise:
if handling the listing nondescript items activity:
if the domain is a room:
if the domain is the location, say " ";
otherwise say " ";
otherwise if the domain is a supporter:
say " ";
otherwise:
say «  »;
say " ";
let the common holder be nothing;
let contents form of list be true;
repeat with list item running through marked for listing things:
if the holder of the list item is not the common holder:
if the common holder is nothing,
now the common holder is the holder of the list item;
otherwise now contents form of list is false;
if the list item is mentioned, now the list item is not marked for listing;
filter list recursion to unmentioned things;
if contents form of list is true and the common holder is not nothing,
list the contents of the common holder, as a sentence, including contents,
giving brief inventory information, tersely, not listing
concealed items, listing marked items only;
otherwise say «  »;
if the domain is the location, say «  »;
say «  »;
unfilter list recursion;
end the listing nondescript items activity;
continue the activity.

Choosing notable locale objects of something (documented at act_cnlo) is an activity.

For choosing notable locale objects (this is the standard notable locale objects rule):
let the domain be the parameter-object;
let the held item be the first thing held by the domain;
while the held item is a thing:
set the locale priority of the held item to 5;
now the held item is the next thing held after the held item;
continue the activity.

Printing a locale paragraph about something (documented at act_plp) is an activity.

For printing a locale paragraph about a thing (called the item)
(this is the don’t mention player’s supporter in room descriptions rule):
if the item encloses the player, set the locale priority of the item to 0;
continue the activity.

For printing a locale paragraph about a thing (called the item)
(this is the don’t mention scenery in room descriptions rule):
if the item is scenery, set the locale priority of the item to 0;
continue the activity.

For printing a locale paragraph about a thing (called the item)
(this is the don’t mention undescribed items in room descriptions rule):
if the item is undescribed, set the locale priority of the item to 0;
continue the activity.

For printing a locale paragraph about a thing (called the item)
(this is the set pronouns from items in room descriptions rule):
if the item is not mentioned, set pronouns from the item;
continue the activity.

For printing a locale paragraph about a thing (called the item)
(this is the offer items to writing a paragraph about rule):
if the item is not mentioned:
if a paragraph break is pending, say «  »;
carry out the writing a paragraph about activity with the item;
if a paragraph break is pending:
increase the locale paragraph count by 1;
now the item is mentioned;
say «  »;
continue the activity.

For printing a locale paragraph about a thing (called the item)
(this is the use initial appearance in room descriptions rule):
if the item is not mentioned:
if the item provides the property initial appearance and the
item is not handled:
increase the locale paragraph count by 1;
say «  »;
say «  »;
if a locale-supportable thing is on the item:
repeat with possibility running through things on the item:
now the possibility is marked for listing;
if the possibility is mentioned:
now the possibility is not marked for listing;
say «  »;
list the contents of the item, as a sentence, including contents,
giving brief inventory information, tersely, not listing
concealed items, prefacing with is/are, listing marked items only;
say «  »;
now the item is mentioned;
continue the activity.

Definition: a thing (called the item) is locale-supportable if the item is not
scenery and the item is not mentioned.

For printing a locale paragraph about a thing (called the item)
(this is the describe what’s on scenery supporters in room descriptions rule):
if the item is not undescribed and the item is scenery and
the item does not enclose the player:
set pronouns from the item;
if a locale-supportable thing is on the item:
repeat with possibility running through things on the item:
now the possibility is marked for listing;
if the possibility is mentioned:
now the possibility is not marked for listing;
increase the locale paragraph count by 1;
say «  »;
list the contents of the item, as a sentence, including contents,
giving brief inventory information, tersely, not listing
concealed items, prefacing with is/are, listing marked items only;
say «  »;
continue the activity.

Oo

Ça c’est de la bidouille :slight_smile:

Merci Otto

Pour l’instant et en attendant une (peut-être) meilleur solution, j’ai changer ta solution un peut :

Rule for listing contents:
	let N be a random number between 1 and 3;
	if N is 1:
		say "plein de choses ici, mais il faudra chercher et fouiner un peut... ";
	if N is 2:
		say "des objets ici, prend ton temps pour bien les examiner... ";
	if N is 3:
		say "plusieurs choses, à toi de les découvrir... ";
	do nothing. 

Ça donne un peut de variations :slight_smile:

k

J’ai trouvé une solution élégante :

A thing is usually undescribed.

À noter l’objet sera listé dans l’inventaire si on le prend, et redeviendra visible si on le laisse.

Pour qu’il reste invisible, rajouter :

After dropping a thing (called trucmuche): now trucmuche is undescribed; continue the action.

Mais je pense que ta solution est mieux car cela trompera moins tes joueurs.

Si tu veux tout de même lister les personnes, tu peux rajouter :

A person is usually described.

Si tu ne l’ajoutes pas, rien ne sera décrit !

C’est aussi une solution qui n’est pas mal :wink:

Notez, si on utilise ma solution, il faut faire une petite modif au fichier « French » de Eric Forgeot…
A la ligne 692 il faut remplacer " ici" par " ", comme ça le « ici » n’apparait plus après la description personnalisée.

Entretemps je continu mon petit projet de test, pas facile du tout. Malgré que la doc de I7 est assez complet je trouve qu’il est difficile de trouver ce qu’on a besoin…
Parfois je me heurte à des trucs qui me parait tous a fait logique et qui ne marche pas :confused:
Ex : Je voulais avoir une description qui apparait que la première fois qu’on prend un objet…
Ma solution logique était de mettre

if carton is taken: .....

mais pour une raison ou autre ça ne marche pas.
Après beaucoup de recherche j’ai trouver que ceci marche :

After taking carton for the first time:
    ....

Qui est logique aussi mais il faut le trouver…

Dans TADS il y a un tutoriel qui construit un jeux pas à pas avec toutes les explications, ça manque vraiment avec I7 !

Donc actuellement je perd beaucoup de temps avec des petits détails, mais je persiste…
Ce qui est difficile pour un débutant aussi est de s’imaginer tous ce que le lecteur peut faire, dans quel ordre (logique ou pas) et les bêtises qu’il pourra faire. Pas facile de trouver un équilibre.

J’aurai certainement d’autres questions :stuck_out_tongue:

k

Ton idée avec « if carton is taken » ne reflète pas le fait que c’est fait uniquement la première fois.
Mais c’est vrai que ce n’est pas forcément évident de trouver la bonne syntaxe immédiatement. La force d’Inform 6 c’est d’avoir un très bon index pour le manuel, ce que l’on n’a pas dans Inform 7. Ils ont indexé les exemples, mais cela n’a pas énormément d’intérêt, et il manque vraiment un bon index des procédures car le classement thématique n’est pas suffisant. De plus, la recherche dans le manuel complet renvoie bcp trop de réponses pour certains sujets (« time » par exemple).

Mais par contre, l’avantage de la syntaxe d’Inform 7 selon moi c’est que la structure se retient beaucoup mieux une fois qu’elle est apprise, cela vient naturellement avec un peu d’entraînement.

Pour ma part je devrais relire tout le manuel, car ils ont ajouté pas mal de nouveautés, et certaines parties sont assez ardues à assimiler au vus des possibilités de programmation (activities, rulebooks).

La lecture des jeux existants est formatrice. À noter que la structure « Instead of ***ing the **** for the first time: » se trouve dans le petit exemple de jeu de la bibliothèque « French ». Je vais essayer de l’étoffer (avec des commentaires) dans le futur pour prendre en compte certaines questions de débutants.

En attendant, n’hésite pas à demander sur le forum si tu as d’autres questions.

Pour ta question initiale, Emily Short a proposé cela dans ce fil, tout à la fin :

groups.google.fr/group/rec.arts. … fb476944a#

ps : je vais retirer le « ici » des bibliothèques, je l’ai traduit bêtement mais cela n’existait pas avant et n’apporte rien en français.

Connais-tu An alphabetical guide to Inform syntax ? Comme je ne connais pas Inform 7, je ne sais pas si ça peut t’aider, mais je sais que des gens sur les newsgroups anglophones ont trouvé ce document très utile…

Effectivement, j’avais juste jeté un oeil sans plus il y a un moment, mais en le regardant de nouveau maintenant c’est vrai que c’est utile, merci de l’avoir rappelé Eriorg !

Merci pour vos réponses, le document ‹ An alphabetical guide to Inform syntax ? › est effectivement très utile !
Pour le moment je m’habitue au syntaxe et la logique de I7 et je galère un peut moins avec le fonctions de base, mais il reste beaucoup à apprendre !

k

Je profite de ce sujet comme moi aussi j’essaye de débuter en inform 7.
…Et je tombe sur plusieurs os dont celui ci par exemple:
Existe t’il en i7 un équivalent au found_in de i6 ? il y a bien les backdrops mais ça ne m’arrange pas dans mon cas…

backdrop est maintenant l’équivalent de found_in
c’est une classe qui ajoute cette propriété à l’objet en question.

Par exemple, voici le code intermédiaire inform 6 produit par le compilateur d’inform 7 :

Object O35_sable "" [b]class K7_backdrop[/b] with IK7_Link nothing, with IK2_Link O40_momie, with name 'sable' with vector 0 with [b]found_in[/b] O29_oasis O36_desert O37_crypte with article SC_20 with IK_0 7 with IK_2 5 with IK_7 0 with short_name "sable" with list_together 0, has mark_as_thing, with action_bitmap 0 0 0 0 0 0 ;

Si cela te dérange vraiment que cela soit dans cette classe, avec le reste des caractéristiques (scenery, pas déplaceable), il doit y avoir moyen de faire autrement, mais là je n’ai pas trop le temps de développer. Tu aurais ton exemple à me passer ?

Il doit aussi y avoir moyen de créer une classe avec le « found_in », ou plus simplement de déplacer l’objet en question à chaque fois que le joueur arrive dans la ou les pièces voulues.

Je suis en train de faire un manuel d’inform 7 en français, cela apparaîtra sur le site du zéro, mais cela peut prendre du temps. Je t’envoie le lien en message privé si cela peut t’aider.

en fait dans mon exemple, j’étais parti sur un ordinateur de bord auquel le joueur pourrait parler partout où il se trouverait dans son vaisseaux spatial. Du coup je ne pouvais pas le déclarer comme backdrop.
Ce que j’ai fais finalement c’est ce que tu préconises, le déplacer à chaque fois que le joueur change de pièce (si cette dernière se trouve toujours à l’intérieur du vaisseaux).

after going to a room which is in ShipArea[Region contenant toutes les pièces du vaisseaux]:
   move Ordinateur de bord to the location of the player; continue the action.

oui, voilà, on peut faire cela. Mais en quoi ça gêne que cela soit un backdrop ?

Pour ce genre d’objet, je pense que le backdrop pouvait fonctionner également, et tu peux aussi désactiver toutes les actions sur l’ordinateur sauf la parole, par exemple (de tête, non testé) :

 Before doing something to Ordinateur de bord, say "L[']ordinateur n'est pas visible, mais il est partout présent et disposé à vous parler.";
stop the action.

[plus loin]

Before talking to Ordinateur de bord:
  [action...]

On doit utiliser before à la place de instead of pour court circuiter l’action précédente.

Un manuel d’Inform 7 sur le site du zéro? Wow! Voilà qui pourrait bien nous ramener quelques auteurs :slight_smile: