screeps 里會(huì)時(shí)不時(shí)的給你一個(gè)提示纯续,平時(shí)也沒(méi)怎么看過(guò),今天特地點(diǎn)了一遍灭袁,把常見(jiàn)的 tip 都記錄一下供大家參考猬错。
Walking over swamps is 5 times slower compared to plain land.
在沼澤地上行走比平原慢5倍。
Ramparts and walls initially have 1 hit point. Repair them after construction.
城墻和城墻最初有1點(diǎn)hit
茸歧。要記得施工后進(jìn)行維修倦炒。
If you want to play from scratch, you can always Respawn in a new room.
如果你想從頭開(kāi)始玩,你可以在一個(gè)新房間里重生软瞎。
You can output HTML content to the console, like links to rooms.
您可以將HTML內(nèi)容輸出到控制臺(tái)逢唤,例如一個(gè)跳轉(zhuǎn)到指定房間的超文本鏈接。
The
RANGED_ATTACK
body part is 2 times weaker thanATTACK
and 2 times costlier at that.
RANGED_ATTACK
身體部件的相對(duì)傷害只有ATTACK
部件的 1/2涤浇,成本卻高2倍鳖藕。
Observers allow to get the Room object for the rooms that have no objects of yours.
Observers
可以獲取那些沒(méi)有你單位存在的房間對(duì)象。
Respawning in a chosen room would automatically destroy all structures except walls and roads
在選定的房間重生會(huì)自動(dòng)破壞房間內(nèi)除墻和道路以外的所有建筑芙代。
You can build and repair roads in any rooms, even neutral ones.
你可以在任何房間修建和維修道路吊奢,甚至是中立房間盖彭。(容器container
也可以)
A creep can execute some commands simultaneously in one tick, for example move+build+dropEnergy.
creep
可以在一個(gè)tick
內(nèi)同時(shí)執(zhí)行多個(gè)命令纹烹,例如 move
+ build
+ dropEnergy
。
Use storage to not lose surplus of mined resources.
使用storage
來(lái)存儲(chǔ)開(kāi)采出來(lái)的過(guò)量資源召边。
There is a keyword
debugger
in the simulator that stops your script in the browser.
模擬器中有一個(gè)關(guān)鍵字debugger
铺呵,可以用于在瀏覽器中暫停腳本。
The console.log function of the simulator displays a live expandable object in the browser console.
模擬器的console.log
函數(shù)可以在瀏覽器的控制臺(tái)中同步顯示(可以對(duì)object
進(jìn)行展開(kāi)操作)隧熙。
If
CPU
limit raises, your script will execute only partially.
如果運(yùn)算量超過(guò)CPU限制片挂,腳本將只執(zhí)行部分代碼。
To output an object content into the console, use
JSON.stringify
.
要將對(duì)象內(nèi)容輸出到控制臺(tái),請(qǐng)使用JSON.stringify
音念。
Sources in neutral rooms have reduced capacity. Reserve or claim the room to restore it to full capacity.
中立房間礦的能量上限只有1500
沪饺。預(yù)訂或占領(lǐng)房間可以使其恢復(fù)到最大容量。
Send emails to yourself with the function
Game.notify
to be aware of everything happening in the game.
使用Game.notify
函數(shù)向自己發(fā)送電子郵件來(lái)了解游戲中發(fā)生的一切闷愤。
You can apply transfer and heal to another player’s creep, and transfer, build and repair to others’ structures.
你可以transfer
和heal
另一個(gè)玩家的creep
整葡,以及transfer
,build
和repair
到其他玩家的建筑讥脐。
Walls and roads don’t belong to any player, so they should be searched with the help of
FIND_STRUCTURES
, notFIND_MY_STRUCTURES
.
墻壁和道路不屬于任何玩家遭居,因此應(yīng)該使用FIND_STRUCTURES
進(jìn)行搜索,而不是FIND_MY_STRUCTURES
旬渠。
A creep with an
ATTACK
part automatically strikes back at every attacker byATTACK
.
一個(gè)帶有ATTACK
部分的creep
會(huì)自動(dòng)反擊任何帶有ATTACK
的攻擊者俱萍。
To save your
CPU
, use less creeps of a larger size.
生成數(shù)量更少、身體部件更多的creep
來(lái)節(jié)省你的CPU
告丢。
Use Room.energyAvailable and Room.energyCapacityAvailable to determine how much energy all the spawns and extensions in the room contain.
使用Room.energyAvailable
和Room.energyCapacityAvailable
來(lái)確定房間中所有spawn
和extensions
包含多少能量及能量上限是多少枪蘑。
You can use more
CPU
than yourCPU
limit allows in short bursts.
你的CPU
使用量可以在短時(shí)間內(nèi)使用超過(guò)你CPU
上限。(“短時(shí)間”取決于你的cpu
桶中的余額)
Roads wear out as they are used, so don’t forget to repair them.
道路在使用過(guò)程中會(huì)逐漸磨損岖免,所以別忘了修理它們腥寇。
Build roads to save on
MOVE
body parts of your creeps.
建造道路可以讓你的creep
使用更少的MOVE
部件。
Use
try/catch
blocks in right places to avoid a complete halt of your script due to errors.
在適當(dāng)?shù)奈恢檬褂?code>try/catch代碼塊觅捆,以避免由于異常而導(dǎo)致腳本退出赦役。
A tower’s effectiveness depends on the distance to the target.
tower
的工作效率取決于tower
到目標(biāo)的距離。
Energy in a storage can not be used to spawn creeps. Transfer it to a spawn or extensions instead.
storage
里儲(chǔ)存的能量不能用來(lái)產(chǎn)生creep
栅炒,要先將能轉(zhuǎn)移到一個(gè)spawn
或extension
掂摔。
Spawn extensions capacity increases on room levels 7 and 8.
RCL7 和 RCL8 將提升 extension 的容量。
Use towers to set up automatic defense of your room.
使用tower
來(lái)建立你房間的自動(dòng)防御赢赊。
Dead body parts have weight and generate fatigue as well.
一個(gè)壞掉的身體部件也會(huì)產(chǎn)生疲勞乙漓。
The game is fully recorded, so you can see replay of any room for the past several days.
游戲已經(jīng)被完整錄制,所以你可以隨時(shí)回放過(guò)去幾天發(fā)生的事情释移。
Unless you use up your CPU limit each tick, it is stored for future use.
除非你每tick
都用光了你的CPU
叭披,不然沒(méi)有用掉的會(huì)被存起來(lái)以備以后使用。
The more spawn extensions in a room, the more energy you can spend on building one creep.
一個(gè)房間中的spawn
和extension
越多玩讳,你就可以用更多的能量來(lái)構(gòu)建一個(gè)creep
涩蜘。
Modular architecture of a script will allow easy testing of individual functions in the simulator.
腳本的模塊化架構(gòu)使得你可以在模擬器中輕松測(cè)試單個(gè)函數(shù)。