Lua Command Line

From Sapiens Wiki
Jump to navigation Jump to search
The Lua Command Line

Overview

The Lua Command Line is an in-game command line tool that allows direct interaction with the Sapiens Lua game engine. It can be accessed by pressing '`'. Once the command line has started (the prompt should turn to "lua>"), Lua commands can be executed directly allowing the player to modify various game behaviors. The Lua Command Line can be exited by typing /exit.

Commands

Command Description
completeCheat() Enables instant build mode.
setDebugObject() There is an option in the game menu that turns on debug mode. With that enabled, new buttons appear in the UI when you select any object in the world. If you click the debug button for that object, it logs all of the details about that object to every log, and is now set to be the target object for objectLog. These mj:objectLogs are scattered throughout the code base, in particular around the sapiens AI, so this is useful for tracking exactly what one particular sapien is doing. This command allows you to set a debug object from the lua command line.
setSunrise() Advances the game time of day to sunrise.
setSunset() Advances the game time of day to sunset.
printType() Allows you to find the typeIndex or typeKey for an object.

Example:
lua>printType("gameObject.wheat")
typeKey:gameObject.wheat = 338
lua>printType(338)
typeIndex:338 = gameObject.wheat
lua>spawn(338)

spawn(object, count) Spawn an item in the game.

To spawn an item in the game type:

spawn("apple",1)

Please note if the quantity is omitted, 1 will default. In other words...

spawn("apple",1)

and

spawn("apple")

...produce the same result. List of Spawnable Game Objects

tp() Teleport to a location.

Spawnable Game Objects

The following is a list of the spawnable game objects that can be used in conjunction with the "spawn()" command:

  Select examples, full lists below  
pineBranch graniteRockSmall pineLog graniteRock
hay peach flintAxeHead appleTree
sapien chicken alpaca mammoth
tinOre copperOre bronzeIngot bronzeChisel

Items

  Items  
aloeLeaf aloeLeafRotten alpacaMeatLeg alpacaMeatLegCooked
alpacaMeatRack alpacaMeatRackCooked alpacaWoolskin alpacaWoolskin_black
alpacaWoolskin_cream alpacaWoolskin_red alpacaWoolskin_white alpacaWoolskin_yellow
apple appleBranch appleLog appleRotten
appleSplitLog appleWoodenPole aspenBigSeed aspenBigSeedRotten
aspenBranch aspenLog aspenSeed aspenSeedRotten
aspenSplitLog aspenWoodenPole balafon bambooBranch
bambooSeed bambooSeedRotten bambooWoodenPole banana
bananaRotten beetroot beetrootCooked beetrootRotten
beetrootSeed beetrootSeedRotten birchBranch birchLog
birchSeed birchSeedRotten birchSplitLog birchWoodenPole
bone boneFlute boneKnife boneSpear
boneSpearHead branchRotten breadDough breadDoughRotten
bronzeAxeHead bronzeChisel bronzeHammer bronzeHammerHead
bronzeHatchet bronzeIngot bronzeKnife bronzePickaxe
bronzePickaxeHead bronzeSpear bronzeSpearHead burntBranch
catfishCooked catfishDead chickenMeat chickenMeatBreast
chickenMeatBreastCooked chickenMeatCooked clay coconut
coconutLog coconutRotten coconutSplitLog coelacanthCooked
coelacanthDead compost compostRotten copperOre
crucibleDry crucibleWet deadAlpaca deadAlpaca_black
deadAlpaca_cream deadAlpaca_red deadAlpaca_white deadAlpaca_yellow
deadChicken deadChickenRotten dirt echinaceaFlower
echinaceaFlowerRotten elderberry elderberryBranch elderberryLog
elderberryRotten elderberrySplitLog elderberryWoodenPole firedBowl
firedBowlBurnMedicine firedBowlFoodPoisoningMedicine firedBowlInjuryMedicine firedBowlMedicineRotten
firedBowlVirusMedicine firedBrick_hay firedBrick_redSand firedBrick_riverSand
firedBrick_sand firedTile firedUrn firedUrnFlour
firedUrnFlourRotten firedUrnHulledWheat firedUrnHulledWheatRotten fishBones
fishFillet fishFilletCooked flagellipinnaCooked flagellipinnaDead
flatbread flatbreadRotten flax flaxDried
flaxRotten flaxSeed flaxSeedRotten flaxTwine
flint flintAxeHead flintHatchet flintKnife
flintPickaxe flintPickaxeHead flintSpear flintSpearHead
garlic garlicRotten gingerRoot gingerRootRotten
gooseberry gooseberryRotten graniteRock graniteRockBlock
graniteRockSmall grass greenRock greenRockBlock
greenRockSmall hay hayRotten lapisRock
lapisRockBlock lapisRockSmall limestoneRock limestoneRockBlock
limestoneRockSmall logDrum mammothMeat mammothMeatCooked
mammothMeatTBone mammothMeatTBoneCooked mammothWoolskin manure
manureRotten marbleRock marbleRockBlock marbleRockSmall
marigoldFlower marigoldFlowerRotten mudBrickDry_hay mudBrickDry_redSand
mudBrickDry_riverSand mudBrickDry_sand mudBrickWet_hay mudBrickWet_redSand
mudBrickWet_riverSand mudBrickWet_sand mudTileDry mudTileWet
orange orangeBranch orangeLog orangeRotten
orangeSplitLog orangeWoodenPole peach peachBranch
peachLog peachRotten peachSplitLog peachWoodenPole
pineBranch pineCone pineConeBig pineConeBigRotten
pineConeRotten pineLog pineSplitLog pineWoodenPole
polypterusCooked polypterusDead poorDirt poppyFlower
poppyFlowerRotten pumpkin pumpkinCooked pumpkinRotten
quernstone quernstone_graniteRock quernstone_greenRock quernstone_lapisRock
quernstone_limestone quernstone_marbleRock quernstone_redRock quernstone_sandstoneBlueRock
quernstone_sandstoneOrangeRock quernstone_sandstoneRedRock quernstone_sandstoneYellowRock raspberry
raspberryRotten redfishCooked redfishDead redRock
redRockBlock redRockSmall redSand richDirt
riverSand rock rockSmall rottenGoo
sand sandstoneBlueRock sandstoneBlueRockBlock sandstoneBlueRockSmall
sandstoneOrangeRock sandstoneOrangeRockBlock sandstoneOrangeRockSmall sandstoneRedRock
sandstoneRedRockBlock sandstoneRedRockSmall sandstoneYellowRock sandstoneYellowRockBlock
sandstoneYellowRockSmall stoneAxeHead stoneAxeHead_graniteRock stoneAxeHead_greenRock
stoneAxeHead_lapisRock stoneAxeHead_limestone stoneAxeHead_marbleRock stoneAxeHead_redRock
stoneAxeHead_sandstoneBlueRock stoneAxeHead_sandstoneOrangeRock stoneAxeHead_sandstoneRedRock stoneAxeHead_sandstoneYellowRock
stoneBlock stoneChisel stoneChisel_graniteRock stoneChisel_greenRock
stoneChisel_lapisRock stoneChisel_marbleRock stoneChisel_redRock stoneHammer
stoneHammerHead stoneHammerHead_graniteRock stoneHammerHead_greenRock stoneHammerHead_lapisRock
stoneHammerHead_marbleRock stoneHammerHead_redRock stoneHatchet stoneKnife
stoneKnife_graniteRock stoneKnife_greenRock stoneKnife_lapisRock stoneKnife_limestone
stoneKnife_marbleRock stoneKnife_redRock stonePickaxe stonePickaxeHead
stonePickaxeHead_graniteRock stonePickaxeHead_greenRock stonePickaxeHead_lapisRock stonePickaxeHead_limestone
stonePickaxeHead_marbleRock stonePickaxeHead_redRock stoneSpear stoneSpearHead
stoneSpearHead_graniteRock stoneSpearHead_greenRock stoneSpearHead_lapisRock stoneSpearHead_limestone
stoneSpearHead_marbleRock stoneSpearHead_redRock stoneTile stoneTile_graniteRock
stoneTile_greenRock stoneTile_lapisRock stoneTile_limestone stoneTile_marbleRock
stoneTile_redRock stoneTile_sandstoneBlueRock stoneTile_sandstoneOrangeRock stoneTile_sandstoneRedRock
stoneTile_sandstoneYellowRock sunflowerSeed sunflowerSeedRotten swordfishDead
tinOre tropicalfishCooked tropicalfishDead turmericRoot
turmericRootRotten unfiredBowlBurnMedicine unfiredBowlDry unfiredBowlFoodPoisoningMedicine
unfiredBowlInjuryMedicine unfiredBowlMedicineRotten unfiredBowlVirusMedicine unfiredBowlWet
unfiredUrnDry unfiredUrnFlour unfiredUrnFlourRotten unfiredUrnHulledWheat
unfiredUrnHulledWheatRotten unfiredUrnWet wheat wheatRotten
willowBranch willowLog willowSeed willowSeedRotten
willowSplitLog willowWoodenPole

Buildings

Buildings spawned with the spawn command are glitched. They function normally, but cannot be removed and trying to rebuild them crashes the game. This is likely because they lack info about what materials they are made from.

  Buildings  
brickKiln brickRoofEnd brickWall brickWall2x1
brickWall2x2 brickWall4x1 brickWallDoor brickWallLargeWindow
campfire canoe compostBin coveredCanoe
coveredSled craftArea dirtRoof dirtWall
dirtWallDoor hayBed mudBrickColumn mudBrickFloor2x2
mudBrickFloor4x4 mudBrickFloorTri2 mudBrickRoofEnd mudBrickWall
mudBrickWall2x1 mudBrickWall2x2 mudBrickWall4x1 mudBrickWallDoor
mudBrickWallLargeWindow path_clay path_dirt path_rock
path_sand path_tile sled splitLogBench
splitLogFloor splitLogFloor4x4 splitLogFloorTri2 splitLogRoof
splitLogRoofEnd splitLogRoofInvertedTriangle splitLogRoofSlope splitLogRoofSmallCorner
splitLogRoofSmallCornerInside splitLogRoofTriangle splitLogShelf splitLogSteps
splitLogSteps2x2 splitLogToolRack splitLogWall splitLogWall2x1
splitLogWall2x2 splitLogWall4x1 splitLogWallDoor splitLogWallLargeWindow
stoneBlockColumn stoneBlockRoofEnd stoneBlockWall stoneBlockWall2x1
stoneBlockWall2x2 stoneBlockWall4x1 stoneBlockWallDoor stoneBlockWallLargeWindow
storageArea storageArea1x1 storageArea4x4 thatchRoof
thatchRoofEnd thatchRoofInvertedTriangle thatchRoofLarge thatchRoofLargeCorner
thatchRoofLargeCornerInside thatchRoofSlope thatchRoofSmallCorner thatchRoofSmallCornerInside
thatchRoofTriangle thatchWall thatchWall2x1 thatchWall2x2
thatchWall4x1 thatchWallDoor thatchWallLargeWindow tileFloor2x2
tileFloor4x4 tileFloorTri2 tileRoof tileRoofInvertedTriangle
tileRoofSlope tileRoofSmallCorner tileRoofSmallCornerInside tileRoofTriangle
torch woolskinBed

Plants

  Plants  
aloePlant appleTree aspen1 aspen2
aspen3 aspenBig1 bamboo1 bamboo2
bananaTree beetrootPlant birch1 birch2
birch3 birch4 coconutTree echinaceaPlant
elderberryTree flaxPlant garlicPlant gingerPlant
gooseberryBush marigoldPlant orangeTree peachTree
pine1 pine2 pine3 pine4
pineBig1 poppyPlant pumpkinPlant raspberryBush
sunflower turmericPlant wheatPlant willow1
willow2

Misc

  Misc  
Animals
alpaca alpaca_black alpaca_cream alpaca_red
alpaca_white alpaca_yellow catfish chicken
coelacanth flagellipinna mammoth polypterus
redfish sapien swordfish tropicalfish
Resources
deadMammoth graniteRockLarge greenRockLarge lapisRockLarge
limestoneRockLarge marbleRockLarge redRockLarge rockLarge
sandstoneBlueRockLarge sandstoneOrangeRockLarge sandstoneRedRockLarge sandstoneYellowRockLarge
Potential Development Leftovers
cactus drumStick flower1 paddle
palm shrub stick
Unclear
haulObjectDestinationMarker plan_move (crashes game!) temporaryCraftArea terrainModificationProxy

Update this List

Paste for i=1,20000 do printType(i) end into the console. This will lag!

Navigate to AppData/Roaming/majicjungle/sapiens/players/<playerid>/worlds/<active world>/logs/ and parse mainLog.log to extract all the "gameObject.XYZ". Remove the "gameObject.", these are all the spawnable entities.

A lot of these are things like "placed_XYZ" (these will end up as their item variant), "place_XYZ" (these will be glitched), and "build_XYZ" (might not do anything). Those prefixes can be used for categorization:

For every "build_XYZ" there will be a "XYZ" which seems to spawn that building as a movable entity (which is fun). For every "placed_XYZ" is an "XYZ" which is a placeable item.

Using that, filter for all build_, extract them, remove the prefix, check all are present in the original list and remove them from it. A command for that might look like cat sapiens | grep "^build_" | sed 's/build_//m' | sort > sapiens_build; comm -23 sapiens sapiens_build | grep -v "^build_" | sort > sapiens2. Repeat for build_, place_ (should be identical to placed_), plant_ (should be identical to sapling_).

After that filtering there are buildings, plants, items, and a few leftovers that are other game entities, like large (minable) rocks, animals, decoration, ...