You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Link the advanced tutorials from the end of the Redstone Guide
Fix a link
Tutorial 1 first pass
Section Numbers
Update tut 2
Fixing a link
Clean up the reference doc
Update tutorial 3
Update tutorial 4
Update Tutorial 5
Spelling
Fix a link
Update tutorial 6
Final deploy step on tut 6
Modify tut 7
Add tutorial 7 to the tutorial list
-[npm](https://docs.npmjs.com/downloading-and-installing-node-js-and-npm) or [npm Windows](https://nodejs.org/en/download/)
17
-
18
-
## 1. Deploy the game
19
-
20
-
First, deploy an instance of Downstream locally using Docker.
21
-
22
-
From a terminal in the repository root run:
23
-
24
-
```bash
25
-
docker compose up --pull=always
26
-
```
27
-
28
-
After some time (this could take up to 5 minutes), you should see "ready" in the terminal output:
29
-
30
-
contracts-1 | +-------+
31
-
contracts-1 | | ready |
32
-
contracts-1 | +-------+
33
-
34
-
You can now open a web browser and navigate to [http://localhost:3000] to load the front page.
35
-
36
-
From here you can select a zone, select Zone 1 as it will be owned by the deployer.
37
-
38
-
You should see a blue world, with a single hex tile in the center and the **Welcome to Zone 1** dialogue box:
39
-
40
-
<imgsrc="./readme-images/step1.png"width=200>
41
-
42
-
## 2. Enter the Zone and Spawn a Unit
43
-
44
-
First click the **Connect Wallet** button.
45
-
Then, select **LocalDevAccount**.
46
-
Then visit Zone 1 (Zone 1 will be owned by the LocalDevAccount)
11
+
- Have set up Metamask
12
+
- Have claimed a Downstream Redstone Zone
13
+
Follow the [Redstone Guide](../../../../tutorial/REDSTONEGUIDE.md) for more information
47
14
48
-
<imgsrc="./readme-images/step2a.png"width=200>
49
-
50
-
You can now click "Spawn Unit" and you should see your Unit on the center tile:
51
-
52
-
53
-
<imgsrc="./readme-images/step2b.png"width=200>
54
-
55
-
56
-
## 3. Create a map
15
+
## 1. Create a map
57
16
58
17
There is no where for the Unit to go so we will now expand the world by creating some tiles.
59
18
60
-
First, open the the **tile-fabricator**, by opening a web browser and navigating to [http://localhost:3000/tile-fabricator].
19
+
First, open the the **tile-fabricator**, by opening a web browser and navigating to [tile-fabricator](http://redstone.downstream.game/tile-fabricator).
61
20
62
21
Now, draw a map design:
63
22
- Left click each tile that you want on your map.
@@ -77,7 +36,7 @@ Finally, create a new folder in your desktop. This folder is your 'map' and will
77
36
- Copy the exported tiles manifest into the folder.
78
37
- Rename it to 'Locations.yaml'.
79
38
80
-
## 4. Deploy the new tiles
39
+
## 2. Deploy the new tiles
81
40
82
41
We will use the Downstream CLI to deploy our newly created tiles to our local Downstream instance.
83
42
@@ -90,43 +49,30 @@ Check it is installed from any terminal folder by running:
90
49
ds help
91
50
```
92
51
93
-
Now copy your Burner private key from Downstream:
94
-
- Browse to [localhost:3000]([http://localhost:3000]).
95
-
- Click the player icon at the top left.
96
-
97
-
<imgsrc="./readme-images/step4a.png"width=200>
98
-
99
-
- Click **show**
100
-
101
-
<imgsrc="./readme-images/step4b.png"width=200>
102
-
103
-
- Highlight and copy the key.
104
-
105
52
Finally, run the command to deploy your map:
106
-
In a terminal at your new folder run the following, where `<private-key>`can be pasted from the one you just copied:
53
+
In a terminal at your new folder run the following, where `<zone-number>`is your Zone number:
107
54
```bash
108
-
ds apply -n local -z 1 -k <private-key> -f Locations.yaml
We are using Zone 1 (`-z 1`) as the LocalDevAccount already owns Zone 1 and it saves up some time!
112
-
113
58
Note: If using Windows you get the error "running scripts is disabled on this system", open Powershell as an Administrator and run `Set-ExecutionPolicy RemoteSigned`
114
59
115
-
You should see the terminal output display a series of ✅s for each tile that is deployed.
60
+
Running the command will open your default broswer and ask you to sign a transaction in Metamask. This will confirm your identity and verify ownership of your zone.
61
+
62
+
Once you have accepted the Metamask prompts, return to your terminal and the output should display a series of ✅s for each tile that is deployed.
116
63
117
64
<imgsrc="./readme-images/step4c.png"width=200>
118
65
119
-
Browse to [localhost:3000/zones/1](http://localhost:3000/zones/1) and you should see your newly created map and be able to move your Unit around it!
66
+
Browse to your Zone on [redstone.downstream.game](redstone.downstream.game) and you should see your newly created map and be able to move your Unit around it!
120
67
121
68
<imgsrc="./readme-images/step4d.png"width=200>
122
69
123
70
124
-
125
-
## 5. Create a new type of building
71
+
## 3. Create a new type of building
126
72
127
73
The map is currently empty and there are no buildings to build. So we are going to create a new kind of 'Factory' building that crafts a new kind of item.
128
74
129
-
First, open the the **building-fabricator**, by opening a web browser and navigating to [http://localhost:3000/building-fabricator].
75
+
First, open the the **building-fabricator**, by opening a web browser and navigating to the [building-fabricator](http://redstone.downstream.game/building-fabricator).
130
76
131
77
You should see a page like this:
132
78
@@ -151,22 +97,20 @@ You should now have a folder that looks this:
151
97
152
98
<imgsrc="./readme-images/step5c.png"width=200>
153
99
154
-
## 6. Deploy the new type of building
100
+
## 4. Deploy the new type of building
155
101
156
102
We will use the Downstream CLI to deploy our newly created building to our local Downstream instance.
157
103
158
104
Deploying the building is the same as the tiles manifest but passing BasicFactory.yaml instead of Locations.yaml:
159
105
- In a terminal in the folder with your exported building source.
160
-
- (using the same `<private-key>` as above)
161
-
- Still using Zone 1 (`-z 1`)
162
-
-`ds apply -n local -z 1 -k <private-key> -f BasicFactory.yaml`
You should see the terminal output display for the building kind and item kind defined by your new factory:
108
+
Again, metamask will ask you to sign a transaction and then you should see the terminal output display for the building kind and item kind defined by your new factory:
165
109
166
110
<imgsrc="./readme-images/step6a.png"width=200>
167
111
168
112
This type of building now exists in our local instance of Downstream, which means it is available for Units to build on the map:
169
-
- Browse to [http://localhost:3000/zones/1].
113
+
- Browse to your zone on [https://redstone.downstream.game](redstone.downstream.game).
170
114
- Select the build action.
171
115
- Choose your new building type from the drop down list.
172
116
- Confirm.
@@ -176,15 +120,15 @@ You should now have an instance of your building deployed to the map!
176
120
<imgsrc="./readme-images/step6b.png"width=200>
177
121
178
122
179
-
## 7. Add some decorations
123
+
## 5. Add some decorations
180
124
181
125
There are plenty for examples of pre-made building kinds in the ds repository that can be copy and pasted into your map folder.
182
126
183
127
We will add some decorative blocking buildings to your map and see how everything in the map folder can be deployed at once.
184
128
185
129
First copy the [blockers.yaml](./blockers.yaml) to your map folder.
186
130
187
-
Now, use the [tile-fabricator](http://localhost:3000/tile-fabricator) to add some blockers to your map:
131
+
Now, use the [tile-fabricator](http://redstone.downstream.game/tile-fabricator) to add some blockers to your map:
188
132
- Press the **import** button, navigate to your map folder, and select blockers.yaml.
189
133
- New building types will now be available in the **Brush** drop done.
190
134
@@ -197,17 +141,13 @@ Now, use the [tile-fabricator](http://localhost:3000/tile-fabricator) to add som
197
141
- When you're happy, press the **export** button.
198
142
- Replace your old Locations.yaml with the new downloaded manifest.
199
143
200
-
## 8. Deploy the whole map folder
144
+
## 6. Deploy the whole map folder
201
145
202
146
To complete the tutorial, we're going to deploy your whole map folder together.
203
147
204
-
First, stop the Downstream instance running in Docker with **ctrl-c**, and restart it by running `docker compose up`.
205
-
206
-
Once you see "ready", browse to the game and check you have a single tile world.
207
-
208
148
Now you can `ds apply` the whole map folder by passing the `-R` flag and the folder path. At a terminal In your map folder run:
The only change we want to make to these steps is in _Creating a map_. As this is the next room in the tutorial series, we will be creating our map at a different angle so it doesn't overlap with tutorial-room-1.
17
+
We are going to put together the map below, it is the second spoke of tutorial Island! There is intentionally a choke point so we can show off Doors!
25
18
26
19
<imgsrc="./readme-images/step1.png"width=600>
27
20
28
21
We're using this particular shape to demonstrate the functionality of the gate. We will use the bottleneck to ensure there is no way around the gate.
29
22
30
-
Run the game and use the [tile-fabricator](http://localhost:3000/tile-fabricator) to create tiles following the shape shown in the example above.
23
+
Run the game and use the [tile-fabricator](http://redstone.downstream.game/tile-fabricator) to create tiles following the shape shown in the example above.
31
24
32
25
Once you've painted the tiles, click export, and save the output file as `Locations.yaml` in a new project folder on your computer.
33
26
@@ -57,7 +50,7 @@ spec:
57
50
58
51
**Note:** later, we'll be using the item ID to verify the unit has the key in their inventory. If you're following along and want to use the same ID as we do, you should use the same name. Otherwise, you can run the command `ds get items -n local` while running the game to get a list of all the items in your world with their IDs.
59
52
60
-
One thing here that isn't clear is the icon. The best way to pick an icon is to open the [building-fabricator](http://localhost:3000/building-fabricator) where you can easily flick through the item icons available.
53
+
One thing here that isn't clear is the icon. The best way to pick an icon is to open the [building-fabricator](http://redstone.downstream.game/building-fabricator) where you can easily flick through the item icons available.
61
54
62
55
You can change how much goo it costs the unit to craft this item.
63
56
@@ -154,7 +147,7 @@ spec:
154
147
facingDirection: LEFT
155
148
```
156
149
157
-
Before continuing, you may want to use `ds apply` ([see tutorial-room-1](https://github.com/playmint/ds/blob/main/contracts/src/maps/tutorial-room-1/README.md#8-deploy-the-whole-map-folder)) to check your progress!
150
+
Before continuing, you may want to use `ds apply` ([see tutorial-room-1](https://github.com/playmint/ds/blob/main/contracts/src/maps/tutorial-room-1/README.md#6-deploy-the-whole-map-folder)) to check your progress!
158
151
159
152
160
153
# 5. Gate
@@ -386,11 +379,11 @@ spec:
386
379
location: [8, -1, -7]
387
380
facingDirection:RIGHT
388
381
```
389
-
2. Run `ds apply` ([see tutorial-room-1](https://github.com/playmint/ds/blob/main/contracts/src/maps/tutorial-room-1/README.md#8-deploy-the-whole-map-folder)) and refresh!
382
+
2. Run `ds apply` ([see tutorial-room-1](https://github.com/playmint/ds/blob/main/contracts/src/maps/tutorial-room-1/README.md#6-deploy-the-whole-map-folder)) and refresh!
390
383
391
384
392
385
# You did it, good job! 🥳
393
386
394
387
At this point, everything should be working! Feel free to refer to the example files to learn more about the implementation.
Copy file name to clipboardExpand all lines: contracts/src/maps/tutorial-room-3/README.md
+2-2
Original file line number
Diff line number
Diff line change
@@ -5,7 +5,7 @@
5
5
We will follow the steps below to create a series of quests which you will use to guide the player to complete various tasks.
6
6
7
7
## 1. Preparation
8
-
-Before starting, ensure that you have deployed an instance of Downstream locally using Docker. You can find instructions on how to do that in [Tutorial 1 here](../tutorial-room-1/README.md).
8
+
-Make sure you have followed [Tutorial 1](../tutorial-room-1/README.md) & [Tutorial 2](../tutorial-room-2/README.md).
9
9
- You should also copy the CastleOfTreasure .yaml, .sol and .js files out of the tutorial room 3 folder and paste them into your working folder. To save you some time drawing a map, you can also copy the Tile.yaml.
10
10
11
11
@@ -119,7 +119,7 @@ We will use the Downstream CLI to deploy our newly created building to our local
119
119
Run the following in a terminal in the folder with your exported building source (refer to tutorial 1 for more information).
@@ -190,7 +188,7 @@ function themedRandomColour(){
190
188
191
189
if `disco` is false, it makes each tile (except for the one the unit is standing on) blue.
192
190
193
-
And for colouring the tiles, that's it! Once you've passed in the `map` array we pushed to, to the `map`, feel free to [give it a test run](https://github.com/playmint/ds/blob/main/contracts/src/maps/tutorial-room-1/README.md#8-deploy-the-whole-map-folder)!
191
+
And for colouring the tiles, that's it! Once you've passed in the `map` array we pushed to, to the `map`, feel free to [give it a test run](https://github.com/playmint/ds/blob/main/contracts/src/maps/tutorial-room-1/README.md#6-deploy-the-whole-map-folder)!
194
192
195
193
```js
196
194
return {
@@ -413,8 +411,18 @@ return {
413
411
414
412
<img src="./readme-images/step5.png" width=600>
415
413
414
+
## 6. Deploy your files
415
+
416
+
We will use the Downstream CLI to deploy our newly created building to our local Downstream instance.
417
+
418
+
Run the following in a terminal in the folder with your exported building source (refertotutorial1formoreinformation).
419
+
420
+
```
421
+
ds apply -n redstone -z <zone-number> -R -f ./
422
+
```
423
+
416
424
## You did it, good job! 🥳
417
425
418
426
At this point, everything should be working! Feel free to refer to the example files to learn more about the implementation.
0 commit comments