内容发布更新时间 : 2024/11/15 9:26:54星期一 下面是文章的全部内容请认真阅读。
Delete Item Under Mouse
TheInput:GetWorldEntityUnderMouse():Remove() c_select() c_sel():Remove()
After pressing enter, it deletes the item under your mouse. Use the second command on dedicated servers, the first command will not work.
Reveal Map
TheWorld.minimap.MiniMap:ShowArea(0,0,0,10000)
Note that this is a local command, but will not work if you are a client.
Skip day
?TheWorld:PushEvent(\
Skips the current day. Change the value to skip more days or parts of days (e.g. 16*30*4.5 to skip 4.5 days) WARNING: Too big values may freeze the game. (Depending on computer speed)
Skip time
TheWorld.net.components.clock:OnUpdate(16*30*x)
Skips the current day. Change x to skip more days or parts of days (e.g. 16*30*4.5 to skip 4.5 days) WARNING: Too big values may freeze the game. (Depending on computer speed)
Skip time units and update LongUpdate(X)
Skips X time units and performs the \
Note: There are 30 time units per segment. To skip a whole day one can either use LongUpdate(480) or use multiplicative values such as LongUpdate(X*16*30) or LongUpdate(X*TUNING.TOTAL_DAY_TIME), with X=days to skip.
Skip phase
TheWorld:PushEvent(\Skips the current phase.
Set segments
TheWorld:PushEvent(\
Sets amount of segments. Errors if x + y + z adds up to over 16. Note that this will get reset the next day. Example:
TheWorld:PushEvent(\
Very long day, very short dusk and night (one segment for dusk and one for night)
Set season segments
?TheWorld:PushEvent(\{summer={day=sx,dusk=sy,night=sz},
15
winter={day=wx,dusk=wy,night=wz}})
Sets amount of segments. Errors if x + y + z adds up to over 16. Unlike setclocksegs, this is permanent. Example:
TheWorld:PushEvent(\{summer={day=14,dusk=1,night=1}, winter={day=13,dusk=1,night=2}})
Very long day, very short dusk and night (one segment for dusk and one for night), with a slightly longer night in winter.
Set season lengths
TheWorld:PushEvent(\
Sets the lengths of the seasons. {summer=20, winter=15} is the default, while {summer=50, winter=10} would be long summer.
Start Summer
TheWorld:PushEvent(\Start summer
Start Winter
TheWorld:PushEvent(\Start winter
When the RoG DLC is added, the additional commands will likely be TheWorld:PushEvent(\\and TheWorld:PushEvent(\\
Start Rain
TheWorld:PushEvent(\Start rain.
Stop Rain
TheWorld:PushEvent(\Stop rain. This also includes Frog Rain.
Do Lightning Strike
TheWorld:PushEvent(\Lightning strike on mouse cursor. Will hit lightning rod instead if there is one near
Meteor Strike
c_spawn(\
Meteor strike on mouse cursor.Spawns different kind of rocks randomly.
Measure Distance
16
print(math.sqrt(ThePlayer:GetDistanceSqToInst(TheInput:GetWorldEntityUnderMouse())))
Prints the distance between player and object under mouse to the console log (displayed with Ctrl + L by default).
Network/Server CommandsEdit Kick/Ban a player TheNet:Kick(userid) TheNet:Ban(userid)
Note that this can be accomplished more easily through the scoreboard. The userid can be obtained from the AllPlayers table. Once you've found the number of the player you want to kick (as shown above in the Other Player Commands section), you can use AllPlayers[#].userid. So, for example, with player 2, TheNet:Kick(AllPlayers[2].userid).
Connect to a server
c_connect(\
If connecting conventionally doesn't work, it is possible to connect directly to an IP address. By default, the port is 10999. If there is no password, you can leave that part out: c_connect(\
Reload the world c_reset( true / false )
true will save the world before reloading it, false will reload without saving. This command may crash your game if you are a client (unless you send it as a remote command).
Regenerate the world c_regenerateworld()
Regenerates specified items in a world.
Save the server c_save()
Forces the server to save immediately (servers normally autosave whenever night finishes).
Shut down the server c_shutdown( true / false)
true will save the game, false will exit without saving. c_shutdown() is the same as c_shutdown(true).
Roll back the server c_rollback(count)
Rolls back a server by the given number of saves. c_rollback() will roll it back by one, while c_rollback(3) will roll it back three.
Enable/Disable new player joining
TheNet:SetAllowIncomingConnections( true / false )
17
Setting it to true is the default behavior (people can join). Setting it to false prevents anyone from joining.
Make a server announcement (for dedicated server console) c_announce(\
This allows you to announce server shutdowns/restarts so players do not just get disconnected without warning.
Miscellaneous CommandsEdit Clear the morgue
ErasePersistentString(\
Clears the morgue.Requires closing and reopening the game for changes to be seen.
Categories:
Gameplay Add category Showing 25 most recent 79 comments
As a reminder, please read the rules before posting. Being cordial and do not post any comments discussing illegal copies of the games. Try to avoid replying to comments older than 2 weeks. ----------------------------------- -----------------------------------
Make all players invincible(no damage to sanity, hunger or health):
for k,v in pairs(AllPlayers) do v.components.health:SetInvincible(true) end
Make all players vulnerable again:
for k,v in pairs(AllPlayers) do v.components.health:SetInvincible(false) end
Set all players hunber to 100%:
for k,v in pairs(AllPlayers) do v.components.hunger:SetPercent(1) end
Set all players sanity to 100%:
for k,v in pairs(AllPlayers) do v.components.sanity:SetPercent(1) end
Set all players health to 100%:
for k,v in pairs(AllPlayers) do v.components.health:SetPercent(1) end
Move all players to the cursor:
for k,v in pairs(AllPlayers) do c_move(v) end
18
Respawn all players:
for k, v in pairs(AllPlayers) do v:PushEvent('respawnfromghost') end
Set health max to specific value(1000 in the example):
for k,v in pairs(AllPlayers) do v.components.health:SetMaxHealth(1000) end ----------------------------------- ----------------------------------- ----------------------------------- -----------------------------------
:PushEvent('respawnfromghost')
所有人重生
for k,v in pairs(AllPlayers) do v:PushEvent('respawnfromghost') end
for k,v in pairs(AllPlayers) do v:PushEvent('respawnfromghost') end
19