diff --git a/.env b/.env index 476d27a1..37ad4c9c 100644 --- a/.env +++ b/.env @@ -8,10 +8,7 @@ TILESET_OPTIMIZATION=false TILESET_OPTIMIZATION_QUALITY_MIN=0.9 TILESET_OPTIMIZATION_QUALITY_MAX=1.0 -# You can set your upload mode to MAP_STORAGE or GH_PAGES -# By default it will be MAP_STORAGE, if not set but you can change it to GH_PAGES to upload your map on Github Pages. If you are self hosting your map, you can remove it. -# You can check the documentation for more information and tutorials on how to upload your map : https://docs.workadventu.re/map-building/tiled-editor/ -# If you have any questions, feel free to ask on WorkAdventure : https://play.staging.workadventu.re/@/tcm/workadventure/wa-village - +# Here you can set your upload strategy. Simply comment the option you don't want to use. +# Learn more reading the 'Upload your map' section in the README. UPLOAD_MODE=MAP_STORAGE # UPLOAD_MODE=GH_PAGES diff --git a/README.md b/README.md index ae8b625a..dd12e57b 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,21 @@ # WorkAdventure Map Starter Kit -![map](./map.png) +![map](./office.png) This is a starter kit to help you build your own map for [WorkAdventure](https://workadventu.re). To understand how to use this starter kit, follow the tutorial at [https://docs.workadventu.re/map-building/tiled-editor/](https://docs.workadventu.re/map-building/tiled-editor/). +If you have any questions, feel free to ask in [WorkAdventure office](https://play.staging.workadventu.re/@/tcm/workadventure/wa-village). + +## Upload your map + +In the .env file you can set your upload strategy to `MAP_STORAGE` (default) or `GH_PAGES`. Simply comment the option you don't want to use. + +Uploading a map using the [WA map storage](https://docs.workadventu.re/map-building/tiled-editor/publish/wa-hosted) will host your project in the WA servers. + +Uploading a map using [Github Pages](https://docs.github.com/pages) will host your project in the Github servers. + ## Structure We recommend following this file structure: @@ -13,14 +23,11 @@ We recommend following this file structure: * *public/*: Static files like PDFs or audio files * *src/*: Scripts files or design source files * *tilesets/*: All PNG tilesets -* *map.tmj*: Map file -* *map.png*: The map thumbnail used as meta-data - -If you want to use more than one map file, just add the new map file in the root folder ( we recommend creating a copy of *map.tmj* and editing it, in order to avoid any mistakes). -We recommend using 512x512 images for the map thumbnails. - -If you are going to create custom websites to embed in the map, please reference the HTML files in the `input` option in *vite.config.js*. +> **Pro tips** +> If you want to use more than one map file, just add the new map file in the root folder (we recommend creating a copy of *office.tmj* and editing it, in order to avoid any mistakes). +> We recommend using 512x512 images for the map thumbnails. +> If you are going to create custom websites to embed in the map, please reference the HTML files in the `input` option in *vite.config.js*. ## Requirements @@ -47,17 +54,25 @@ npm run build npm run prod ``` +You can manually upload your map to the map storage by running: + +```sh +npm run deploy +``` + ## Licenses This project contains multiple licenses as follows: * [Code license](./LICENSE.code) *(all files except those for other licenses)* -* [Map license](./LICENSE.map) *(`map.tmj` and the map visual as well)* +* [Map license](./LICENSE.map) *(`office.tmj` and the map visual as well)* * [Assets license](./LICENSE.assets) *(the files inside the `src/assets/` folder)* ### About third party assets If you add third party assets in your map, do not forget to: -1. Credit the author and license with the "tilesetCopyright" property present in the properties of each tilesets in the `map.tmj` file -2. Add the license text in LICENSE.assets +1. Credit the author and license of a tileset with the "tilesetCopyright" property by etiding the tileset in Tiled. +2. Add the tileset license text in *LICENSE.assets*. +3. Credit the author and license of a map with the "mapCopyright" property in the custom properties of the map. +4. Add the map license text in *LICENSE.map*. diff --git a/conference.tmj b/conference.tmj index 66a3f31a..1ff8c025 100644 --- a/conference.tmj +++ b/conference.tmj @@ -325,7 +325,7 @@ { "name":"exitUrl", "type":"string", - "value":"map.tmj#from-conference" + "value":"office.tmj#from-conference" }], "rotation":0, "visible":true, @@ -483,7 +483,7 @@ { "name":"mapImage", "type":"string", - "value":"map.png" + "value":"office.png" }, { "name":"mapName", diff --git a/index.html b/index.html index 5f468ce9..9a8a162b 100644 --- a/index.html +++ b/index.html @@ -17,12 +17,12 @@ path = path.substr(path, path.length - 'index.html'.length); } const instanceId = Math.random().toString(36).substring(2, 15); - const url = `https://play.workadventu.re/_/${instanceId}/${host}${path}map.tmj`; + const url = `https://play.workadventu.re/_/${instanceId}/${host}${path}office.tmj`; document.getElementById('testMapURL').href = url; document.getElementById('testMapBtnURL').href = url; document.getElementById('testMapURL').innerText = url; - const tmjURL = window.location.protocol + '//' + window.location.host + path + 'map.tmj'; + const tmjURL = window.location.protocol + '//' + window.location.host + path + 'office.tmj'; document.getElementById('tmjURL').innerText = tmjURL; const gettingStartedLink = 'https://workadventu.re/getting-started?name=Map&mapUrl=' + tmjURL; @@ -150,8 +150,8 @@

Test my map

-

(In order to test another map, locate "map.tmj" at the end of the URL and replace it by another file name)

- Map thumbnail +

(In order to test another map, locate "office.tmj" at the end of the URL and replace it by another file name)

+ Map thumbnail

Test my map

diff --git a/map.tmj b/map.tmj index 2e163e2f..f33c5b38 100644 --- a/map.tmj +++ b/map.tmj @@ -559,7 +559,7 @@ { "name":"mapImage", "type":"string", - "value":"map.png" + "value":"office.png" }, { "name":"mapName", diff --git a/map.png b/office.png similarity index 100% rename from map.png rename to office.png diff --git a/package.json b/package.json index 5ee59e9b..b4f4eb35 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "workadventure-map-starter-kit", - "version": "3.3.14", + "version": "3.3.15", "license": "MIT", "type": "module", "scripts": {