Salut
Je sais qu’il existe une extension appelée « Notepad » mais elle ne me convient pas, dans la mesure où elle ne permet pas de retenir des textes longs, comme un journal intime, au fil d’une partie - alors que c’est ce que j’aimerais proposer dans mon jeu.
J’ai testé un truc ultra simpliste :
[code]
The File of journaljoueur is called « journaljoueur ».
When play begins :
write « JOURNAL[line break][line break] » to the File of journaljoueur.
The player has an indexed text called journalentry.
A person can be entréejournal. A person is usually not entréejournal.
Journaling is an action applying to nothing. Understand « journal » as journaling.
Instead of journaling, now the player is entréejournal.
Instead of texting when the player is entréejournal :
now the journalentry is the topic understood ;
append « [the journalentry] » to the File of journaljoueur ;
say line break ;
say « [text of the File of journaljoueur] ».[/code]
Ca fonctionne, sauf si on veut y écrire, ce qui est plutôt gênant :mrgreen:
Ca me fait un runtime problem 31 : attempt to use a property of the ‹ nothing › non-objet : property journalentry
Qqun aurait-il une idée ?
Cet exemple semble fonctionner :
[code]« Journal » by « Otto »
Kitchen is a room.
The File of journaljoueur is called « journaljoueur ».
When play begins :
write « JOURNAL[line break][line break] » to the File of journaljoueur.
The player has an indexed text called journalentry.
A person can be entréejournal. A person is usually not entréejournal.
Journaling is an action applying to nothing. Understand « journal » as journaling.
Instead of journaling, now the player is entréejournal.
Instead of texting when the player is entréejournal:
append « [topic understood] » to the File of journaljoueur;
say line break;
say « [text of the File of journaljoueur] ».
Texting is an action applying to one topic. Understand « [text] » as texting.[/code]
Reste plus qu’à l’améliorer pour pouvoir relire simplement le journal sans avoir à écrire, et peut-être ne pas effacer le fichier à chaque redémarrage du jeu ?
Merci, en effet ça fonctionne.
Par contre il faudrait trouver un moyen pour que ce qu’entre le joueur soit recopié dans le journal sans être du tout " interprété " par le programme, parce que si j’écris par exemple :
« Demain, j’irai au marché »
Le jeu me répond " vous semblez parler à quelqu’un, blabla".