Screeps World 的代码开发环境搭建
- 自动补全
- rollup一行命令打包上传
![image](https://private-user-images.githubusercontent.com/77011000/261673098-4ecd741b-74a2-4118-bf22-1ce891d6a589.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTkxNzY5NzQsIm5iZiI6MTcxOTE3NjY3NCwicGF0aCI6Ii83NzAxMTAwMC8yNjE2NzMwOTgtNGVjZDc0MWItNzRhMi00MTE4LWJmMjItMWNlODkxZDZhNTg5LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA2MjMlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNjIzVDIxMDQzNFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTcwMjZiODVmMWQ2MWVlNWY3MWU4ZDVjODRlNWE4ZmY3OWQwNjdiZGZjYTIwNjU5YzYxYWRlNDU2NzU0MDY3NGEmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.JfnIVmE992UZIFo9W6mp7IG4ZTB1znVa3zQpK4Mtdno)
- ErrorMap跟踪报错
![image](https://private-user-images.githubusercontent.com/77011000/261670350-d28e8a3d-9862-4e78-8001-aed865b5a852.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTkxNzY5NzQsIm5iZiI6MTcxOTE3NjY3NCwicGF0aCI6Ii83NzAxMTAwMC8yNjE2NzAzNTAtZDI4ZThhM2QtOTg2Mi00ZTc4LTgwMDEtYWVkODY1YjVhODUyLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA2MjMlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNjIzVDIxMDQzNFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWU3MjMxZGFkNzU0MjJhZWU2MGE0ZGJmOWU4ZjgyMTczOGUzZGNkNzI5MjIzMTIwZjhhMmNkZDE4ZDgyNDMwOWUmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.dFgFCWHu2HJush75Lk00w8J8X1SeJP7zDrHxGOem1Ug)
- 支持ts开发
三种运行模式
- 本地部署,JetBrains-Webstorm连接 —— 功能稳定
- GitHub CodeSpace部署 —— 便捷的云端开发环境
- docker部署,JetBrains-Gateway SSH连接(待更新)
本地环境 node>=16
npm>=8
(以上版本为实际使用可行版本,不代表其他版本不可用,建议先测试一下)
git clone https://github.com/wper-golo/ScreepsDevSpace.git
npm install
token 可以从 https://screeps.com/a/#!/account/auth-tokens 获取
{
"main": {
"token": "你的 screeps token 填在这里",
"protocol": "https",
"hostname": "screeps.com",
"port": 443,
"path": "/",
"branch": "default"
},
"local": {
"copyPath": "你要上传到的游戏路径,例如 C:\\Users\\DELL\\AppData\\Local\\Screeps\\scripts\\screeps.com\\default"
}
}
注意需要填写里边的 main.token
字段和 local.copyPath
字段(如果你不想用这种方式的话可以直接不填) copyPath
可以通过游戏客户端控制台左下角的 Open local folder
按钮找到。
npm run local
npm run push
![image](https://private-user-images.githubusercontent.com/77011000/261666438-88d3b41e-9309-49f8-8247-3d6f816de972.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTkxNzY5NzQsIm5iZiI6MTcxOTE3NjY3NCwicGF0aCI6Ii83NzAxMTAwMC8yNjE2NjY0MzgtODhkM2I0MWUtOTMwOS00OWY4LTgyNDctM2Q2ZjgxNmRlOTcyLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA2MjMlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNjIzVDIxMDQzNFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTI5YzBhZGM5MzU4NjY4NmQ0YjE5OTE1OWJkOWYyMTU3NDUyOTBjOTRhNzUzMzg2NzFhMTEwYzRlZGY1YTcwYWUmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.KStRM78WWX_dbJqEuSzZvVB435P-dRKFRnW6HvzruYg)
![image](https://private-user-images.githubusercontent.com/77011000/261667676-b9720698-9dd3-4e0a-959a-fa5889cbee10.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTkxNzY5NzQsIm5iZiI6MTcxOTE3NjY3NCwicGF0aCI6Ii83NzAxMTAwMC8yNjE2Njc2NzYtYjk3MjA2OTgtOWRkMy00ZTBhLTk1OWEtZmE1ODg5Y2JlZTEwLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA2MjMlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNjIzVDIxMDQzNFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTBmM2NkZTc4YzAxZTJhNmFiMDFlN2YwOTVkZmUwMDlmZmRhZjkxMTUzNmIzZjc3Yjc2MjhkNDI1MzhjMTJlMmUmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.oj60P0xi-_CP033xiBsk6AXk8Jg_jajXUGEemsp4nWs)
Tips:
- CodeSpace配置最好上 4Core 16RAM的配置,防止JB的Gateway连接不上,并选择一个区域(根据你访问github的ip地址选择ping延迟较小的节点)
- CodeSpace 使用完毕记得Stop,防止产生不必要的消费
![image](https://private-user-images.githubusercontent.com/77011000/261668612-7721325a-b54e-45b6-8581-3e093c2a095e.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTkxNzY5NzQsIm5iZiI6MTcxOTE3NjY3NCwicGF0aCI6Ii83NzAxMTAwMC8yNjE2Njg2MTItNzcyMTMyNWEtYjU0ZS00NWI2LTg1ODEtM2UwOTNjMmEwOTVlLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA2MjMlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNjIzVDIxMDQzNFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTVjNzc0ODg4MzdlM2Q4YmMzYjU4YTU5MWJjOWRhZDZiYzZkNDZmMDJiODk5MDJlZTljMjJiN2RjNDExMjExNzkmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.ck0XnGp8WWYWZ92u8XXF5V98pVCZPfe_PLKgQkYZQVc)
token 可以从 https://screeps.com/a/#!/account/auth-tokens 获取
Tips:请保护好自己的token,不要push到github上,造成一些不必要的麻烦
{
"main": {
"token": "你的 screeps token 填在这里",
"protocol": "https",
"hostname": "screeps.com",
"port": 443,
"path": "/",
"branch": "default"
},
"local": {
"copyPath": "你要上传到的游戏路径,例如 C:\\Users\\DELL\\AppData\\Local\\Screeps\\scripts\\screeps.com\\default"
}
}
注意需要填写里边的 main.token
字段和 local.copyPath
字段(如果你不想用这种方式的话可以直接不填) copyPath
可以通过游戏客户端控制台左下角的 Open local folder
按钮找到。
Tips: 如果想要保留errorMapper的功能,就不要修改./src/modules/errorMapper中的内容。 新手入门Screeps World:
npm run push
本项目是本人通过对大佬HoPGoldy的简书教程进行的归纳整理,因为一些包版本等问题走了一些弯路,希望来玩Screeps World的玩家不要被开发环境不够优雅这种问题劝退,希望大家可以开心体验这款好玩的游戏。
![image](https://private-user-images.githubusercontent.com/77011000/261675172-5fac4000-be39-4b4d-adda-8682d0e62816.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTkxNzY5NzQsIm5iZiI6MTcxOTE3NjY3NCwicGF0aCI6Ii83NzAxMTAwMC8yNjE2NzUxNzItNWZhYzQwMDAtYmUzOS00YjRkLWFkZGEtODY4MmQwZTYyODE2LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA2MjMlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNjIzVDIxMDQzNFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTRmNzA2NzhmMDdiZTQ1Y2UwODFhOGRjNGE5MzY1ZWQ1ZjRkNDBjY2QwNzhmOWQ5YzhjNTFlODlhYjFmNzFiNzgmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.27HcJyCII7oz6D2-i6ZPavS8aibKwppAt46mW41rgAg)