MVC 2021

Portail MVCSE Projet Metaverse City Saint-Étienne: documentation du travail 2020-2021

Juillet 2021 : passage à Minetest, l'équivalent libre de Minecraft. (Lire Metaverse City passe de Minecraft à Minetest sur le blog de Zoomacom)

Minetest

[[https://wiki.minetest.net/Main_Page/fr Wiki FR de Minetest]] ==Ressources et articles== Articles Framinetest, l'expérience et le serveur Minetest de Framasoft, Framablog, 01/09/2016
[[https://framablog.org/2016/09/01/minetest-interets-et-possibilites-pedagogiques/ Minestest, intérêts et possibilités pédagogiques]], //Framablog//, 01/09/2016 Articles Minetest sur le Framablog

Ressources
[[https://framacolibri.org/c/framinetest-minetest Forum Minetest de Framasoft]] API Lua de Minetest
[[https://minetest.gitlab.io/minetest/ Documentation de l'API Lua de Minetest]] Site offciel Lua

  • Exemple de création d’un nouveau type de pnj : castor
  • beaver
    • -0.5, -0.3, 0.3, 0.1
    • 10, y = 10
    • skin_petz_beaver.b3d
    • yl_speak_up_main_petz_beaver.png
      • beaver, «Beaver», « wool_brown
  • Réutiliser les skins de Minecraft pour les PNJ de Minetest
  • staff of shut up causes an NPC to not talk anymore. The staff of dawai-dawai causes an NPC to talk again. This speak or no-speak value is stored on the NPC, meaning if you delete the NPC, this status is also gone. The staff of game over deletes the NPC and all the values stored on him. Among those values are which skins the NPC has and the talk-status. The dialog however and the skins themselves are stored externally and do not vanish when an NPC having those skills or dialogs get deleted. While the dialogs are not easily accessible the skins can be used on any othe NPC, too. Two tools need more of an explanation. The staff of fashion lets you set skins for the NPC, its cape, left and right hand. The main skin is selected from a list of currently available skins. If the skin you want the NPC to have is not available in the list, please take a look at the Upload a skin section below. The skin must be in Minecraft format 64x64. Find an editor and inspiration at https://www.minecraftskins.com/skin-editor/ or https://minecraft.novaskin.me/ Here is a more advanced editor: https://www.planetminecraft.com/pmcskin3d/ The cape skin is a png with width 8 height 12 that is meant to display the faction an NPC is aligned to. Haven NPCs will usually wear the silver cross on red coat of arms, with the top line showing their rank. This cape style will apply to guilds as well. The left hand can be a shield or any other item. It is usually 16x16. It is held in the left hand like a shield strapped to the arm The right hand can be a sword or any other item. It is usually 16x16. it is held in the right hand like a sword held in the fist. While in the fashion-window you can set any skin and the NPC will remember your settings, but if you wish to apply them to the NPC you need to click the save button. The staff of I said so let's you configure the dialogs. Those dialogs are stored in JSON format in the world folder. If you wish you can also edit those dialogs outside of Minetest, they only need to be uploaded and carry the right npc id. This npc id links the dialogs to the NPCs. If we wanted to copy one dialog to another NPC, all we had to do is duplicate the file and edit the npc id to fit the new NPC. If a NPC is deleted, those dialogs stay on the server for future use. The dialog configuration starts with the "dialog" screen. The top left corner must show the NPC id. Every input field has a tool tip so you can see what goes in. Start by giving the NPC a name and a description. The sort-field applies to the dialog. The first dialog that is displayed when a user talks to the NPC needs to have a sort value of 0. The text area is whatever the NPC says to the user. It can take a huge amount of text, but it is recommended to keep it brief. The answers the user can give to the NPC are set in the options dialog. Select a dialog ID and then click the Options button to bring up the options dialog. In the options dialog in the top left corner there must be a dialog id. That's the dialog you set the answers for. The dialog line the NPC delivers is repeated in the top. Although short ones can be changed, it is recommended to use them only as reference on what the NPC says. The "text when prerequisites are met" is what the user can answer if there are no prerequisites or the prerequisites are met. If they are not met, you can either hide, greyout and/or deliver a whole new line. The sort value determines the order the options are displayed. Lowest is on the topmost spot, negatives are not allowed. Prerequisites are conditions that need to be met for this option to be available. Should a user click a button but the prerequisites are not met, the results are not executed. Results are the actions that come from the user clicking an answer option when talking to the NPC while having the prerequisites met. Currently you can only give items, take items, forward to a new dialog, teleport a player or execute one or more minetest function. In the future you can start start or forward quests. Results are never executed when the prerequisites are not met. You can have more than one prerequisite and more than one result tied to one option. They are all executed, but it is your duty to make sure they don't conflict. You cannot forward to TWO dialogs. In doubt they are executed in a random order. A user can talk to an NPC by rightclicking it. This shows a dialog, where the NPCs name and description and the lowest-sort dialog is displayed to the user, together with as many option dialogs as configured. The NPC portrait is calculated from the NPC skin. When the NPC delivered his opening dialog line, the user can answer by clicking the buttons below. Upload a skin To upload a skin or a cape, currently you need to put it in the world/worldmods/yl_npc/textures folder and then execute the following command, while replacing $$$FILENAME$$$ with the filename chosen: %%//lua minetest.chat_send_all("True: it worked. False: it did not. Result:" .. dump(minetest.dynamic_add_media(minetest.get_worldpath() .. DIR_DELIM .. "worldmods" .. DIR_DELIM .. "yl_npc" .. DIR_DELIM .. "textures" .. DIR_DELIM .. $$$FILENAME$$$)))%% This command will soon be made into a nice chatcommand and the upload done via a php form or something similar. For the cape or the skin be visible the filenames need to have this format: yl_npc_main_yourskinname.png for skins, with "yl_npc_main_" being a constant prefix for skins and yourskinname the dynamic "name" part of the skin yl_npc_cape_yourcapename.png for capes, with "yl_npc_cape_" being a constant prefix for capes and yourcapename the dynamic "name" part of the cape Storage The dialog is stored in JSON and can be edited outside of minetest, too. It sits in the dialog folder in the world folder. They stay when the NPC is deleted The skin- and cape-files are stored in the worldmods/yl_npc/textures folder. They stay when the NPC is deleted The current state an NPC is in is stored on the NPC. This attribution goes away when the NPC is deleted The current skin an NPC has is stored on the NPC. This attribution goes away when the NPC is deleted The amount of NPCs present on the server is stored in the modstorage The actions players and admins take to interact with the NPCs are stored in the log {{end elem="panel"}} {{end elem="accordion"}} {{accordion}} {{panel title="Plugin de communication Minetest-Arduino - Terminé" class="panel-success"}} Mod développé par Maxime : https://github.com/MaximeChretien/minetest-NodeMCU Mode d’emploi
  • ssid = "<nom_du_wifi>";
    • const char* password = "<mdp>";
    • [...]
    • WiFi.begin(ssid, password);
  • téléverser via un port USB 3.0 (maintenant SS : « SuperSpeed »), sinon erreur de compilation ("serial.serialutil.SerialException: Cannot configure port, something went wrong. Original message: PermissionError(13, [...])")
  • une fois le code téléversé, vérifier l’IP dans Outils > Moniteur série > 115200 baud, mettre à jour l'IP dans init.lua si nécessaire
  • Si 1re utilisation :
    • copier le fichier « nodemcu_control » dans minetest-5.3[...]/mods
    • lancer le jeu, activer le mod dans les configurations de mods
    • autoriser nodemcu_control en allant dans Réglages > Tous les paramètres > entrer « mods http » dans la barre de recherche > écrire « nodemcu_control » > valider

- Setup des blocs in-game (fichier init.lua) :
  • position des blocs à poser (POS_X…)
  • noms des actionnables (boutons, leds...)