Difference between revisions of "Lua Command Line"

From Sapiens Wiki
Jump to navigation Jump to search
 
(17 intermediate revisions by the same user not shown)
Line 1: Line 1:
{{Stub Notice}}
[[File:Lua.png|220px|thumb|right|The Lua Command Line]]
[[File:Lua.png|220px|thumb|right|The Lua Command Line]]


=Overview=
=Overview=


The '''Lua Command Line''' is an in-game command line tool that allows direct interaction with the Sapiens game engine.  It can be accessed by entering the game chat using '''Ctrl+C''' and then typing '''/lua'''.  Once the command line has started, Lua commands can be executed directly allowing the player to modify various game behaviors.  The Lua Command Line can be exited by typing '''/exit'''.
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 entering the game chat using '''Ctrl+C''' and then typing '''/lua''' and pressing enter.  Once the command line has started (the prompt "chat>" 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=
==Commands==


==completeCheat()==
{| class="wikitable"
|-
! 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:<br>
<code>
<strong>lua></strong>printType("gameObject.wheat")<br>
typeKey:gameObject.wheat = 338<br>
<strong>lua></strong>printType(338)<br>
typeIndex:338 = gameObject.wheat<br>
<strong>lua></strong>spawn(338)<br>
</code>
|-
| spawn([[#Spawnable Game Objects|object]], count)
| Spawn an item in the game.


Enables instant build mode.
To spawn an item in the game type:


==setDebugObject()==
<code>spawn("apple",1)</code>


==setSunrise()==
Please note if the quantity is omitted, 1 will default.  In other words...


Set the game time of day to sunrise.
<code>spawn("apple",1)</code>
 
==setSunset()==
 
Set the game time of day to sunset.


==printType()==
and
 
==spawn(object, count)==
To spawn an item in the game type:
 
<code>spawn("apple",1)</code>


Please note if the quantity is omitted, 1 will default.
<code>spawn("apple")</code>


==tp()==
...produce the same result. [[Lua Command Line#Spawnable Game Objects|List of Spawnable Game Objects]]
|-
| tp()
| Teleport to a location.
|}


== Spawnable Game Objects==


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


flatbread
{| class="wikitable"
deadChickenRotten
|-
flintSpearHead
! 1 || 2 || 3 || 4
burntBranch
|-
marigoldFlowerRotten
| aloeLeaf || aloeLeafRotten || alpacaMeat || alpacaMeatCooked
aspenBigSeed
|-
flaxTwine
| apple || appleRotten || aspenBigSeed || aspenBigSeedRotten
unfiredUrnFlourRotten
|-
bone
| aspenSeed || aspenSeedRotten || balafon || bambooSeed
orange
|-
pumpkinCooked
| bambooSeedRotten || banana || bananaRotten || beetroot
deadAlpaca
|-
sunflowerSeed
| beetrootCooked || beetrootRotten || beetrootSeed || beetrootSeedRotten
log
|-
garlicRotten
| birchSeed || birchSeedRotten || bone || boneFlute
coconut
|-
aloeLeafRotten
| bone_hatchet || boneKnife || boneSpear || boneSpearHead
grass
|-
flaxSeedRotten
| branch || branchRotten || breadDough || breadDoughRotten
echinaceaFlowerRotten
|-
balafon
| burntBranch || chickenMeat || chickenMeatCooked || clay
flint
|-
mudTileWet
| coconut || coconutRotten || deadAlpaca || deadChicken
unfiredUrnDry
|-
woodenPole
| deadChickenRotten || dirt || echinaceaFlower || echinaceaFlowerRotten
aspenBigSeedRotten
|-
gooseberry
| elderberry || elderberryRotten || firedBowl || firedBowlBurnMedicine
echinaceaFlower
|-
rock
| firedBowlFoodPoisoningMedicine || firedBowlInjuryMedicine || firedBowlMedicineRotten || firedBowlVirusMedicine
unfiredBowlDry
|-
apple
| firedBrick || firedTile || firedUrn || firedUrnFlour
dirt
|-
unfiredUrnHulledWheatRotten
| firedUrnFlourRotten || firedUrnHulledWheat || firedUrnHulledWheatRotten || flax
rockSmall
|-
flax
| flaxDried || flaxRotten || flaxSeed || flaxSeedRotten
birchSeed
|-
firedBowlFoodPoisoningMedicine
| flaxTwine || flint || flintAxeHead || flintHatchet
flaxDried
|-
willowSeed
| flintKnife || flintPickaxe || flintPickaxeHead || flintSpear
firedBrick
|-
mudBrickWet
| flintSpearHead || flatbread || flatbreadRotten || garlic
pineConeBig
|-
firedTile
| garlicRotten || giant_bone || gingerRoot || gingerRootRotten
mudTileDry
|-
flaxRotten
| gooseberry || gooseberryRotten || grass || hay
mudBrickDry
|-
quernstone
| hayRotten || log || logDrum || mammothMeat
poppyFlower
|-
bambooSeedRotten
| mammothMeatCooked || marigoldFlower || marigoldFlowerRotten || mudBrickDry
giant_bone
|-
clay
| mudBrickWet || mudTileDry || mudTileWet || orange
branch
|-
aloeLeaf
| orangeRotten || peach || peachRotten || pineCone
firedBowlInjuryMedicine
|-
appleRotten
| pineConeBig || pineConeBigRotten || pineConeRotten || poppyFlower
flintAxeHead
|-
firedUrnHulledWheat
| poppyFlowerRotten || pumpkin || pumpkinCooked || pumpkinRotten
unfiredUrnHulledWheat
|-
bone_hatchet
| quernstone || raspberry || raspberryRotten || rock
gingerRoot
|-
chickenMeat
| rockSmall || sand || splitLog || stoneAxeHead
firedBowlBurnMedicine
|-
gingerRootRotten
| stoneHatchet || stoneKnife || stonePickaxe || stonePickaxeHead
flintHatchet
|-
beetrootSeedRotten
| stoneSpear || stoneSpearHead || sunflowerSeed || sunflowerSeedRotten
firedBowlMedicineRotten
|-
stoneSpear
| turmericRoot || turmericRootRotten || unfiredBowlBurnMedicine || unfiredBowlDry
unfiredBowlMedicineRotten
|-
unfiredBowlVirusMedicine
| unfiredBowlFoodPoisoningMedicine || unfiredBowlInjuryMedicine || unfiredBowlMedicineRotten || unfiredBowlVirusMedicine
raspberry
|-
firedUrnFlour
| unfiredBowlWet || unfiredUrnDry || unfiredUrnFlour || unfiredUrnFlourRotten
pineConeRotten
|-
stoneSpearHead
| unfiredUrnHulledWheat || unfiredUrnHulledWheatRotten || unfiredUrnWet || wheat
pineCone
|-
unfiredBowlFoodPoisoningMedicine
| wheatRotten || willowSeed || willowSeedRotten || woodenPole
beetroot
|-
pumpkin
| woolskin
gooseberryRotten
|}
hayRotten
unfiredBowlInjuryMedicine
peach
wheat
flaxSeed
firedBowl
firedUrn
raspberryRotten
unfiredBowlWet
woolskin
stoneAxeHead
firedUrnHulledWheatRotten
chickenMeatCooked
flatbreadRotten
bambooSeed
beetrootSeed
stoneHatchet
firedBowlVirusMedicine
firedUrnFlourRotten
aspenSeedRotten
deadChicken
orangeRotten
boneSpearHead
sand
pineConeBigRotten
flintPickaxeHead
banana
beetrootRotten
flintSpear
aspenSeed
poppyFlowerRotten
marigoldFlower
unfiredUrnFlour
turmericRoot
flintPickaxe
turmericRootRotten
alpacaMeat
wheatRotten
breadDough
branchRotten
unfiredUrnWet
boneFlute
mammothMeatCooked
willowSeedRotten
coconutRotten
boneSpear
stonePickaxe
stoneKnife
hay
pumpkinRotten
alpacaMeatCooked
mammothMeat
splitLog
bananaRotten
unfiredBowlBurnMedicine
elderberry
sunflowerSeedRotten
logDrum
garlic
birchSeedRotten
breadDoughRotten
flintKnife
elderberryRotten
peachRotten
stonePickaxeHead
beetrootCooked
boneKnife

Latest revision as of 12:17, 9 July 2023

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 entering the game chat using Ctrl+C and then typing /lua and pressing enter. Once the command line has started (the prompt "chat>" 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:

1 2 3 4
aloeLeaf aloeLeafRotten alpacaMeat alpacaMeatCooked
apple appleRotten aspenBigSeed aspenBigSeedRotten
aspenSeed aspenSeedRotten balafon bambooSeed
bambooSeedRotten banana bananaRotten beetroot
beetrootCooked beetrootRotten beetrootSeed beetrootSeedRotten
birchSeed birchSeedRotten bone boneFlute
bone_hatchet boneKnife boneSpear boneSpearHead
branch branchRotten breadDough breadDoughRotten
burntBranch chickenMeat chickenMeatCooked clay
coconut coconutRotten deadAlpaca deadChicken
deadChickenRotten dirt echinaceaFlower echinaceaFlowerRotten
elderberry elderberryRotten firedBowl firedBowlBurnMedicine
firedBowlFoodPoisoningMedicine firedBowlInjuryMedicine firedBowlMedicineRotten firedBowlVirusMedicine
firedBrick firedTile firedUrn firedUrnFlour
firedUrnFlourRotten firedUrnHulledWheat firedUrnHulledWheatRotten flax
flaxDried flaxRotten flaxSeed flaxSeedRotten
flaxTwine flint flintAxeHead flintHatchet
flintKnife flintPickaxe flintPickaxeHead flintSpear
flintSpearHead flatbread flatbreadRotten garlic
garlicRotten giant_bone gingerRoot gingerRootRotten
gooseberry gooseberryRotten grass hay
hayRotten log logDrum mammothMeat
mammothMeatCooked marigoldFlower marigoldFlowerRotten mudBrickDry
mudBrickWet mudTileDry mudTileWet orange
orangeRotten peach peachRotten pineCone
pineConeBig pineConeBigRotten pineConeRotten poppyFlower
poppyFlowerRotten pumpkin pumpkinCooked pumpkinRotten
quernstone raspberry raspberryRotten rock
rockSmall sand splitLog stoneAxeHead
stoneHatchet stoneKnife stonePickaxe stonePickaxeHead
stoneSpear stoneSpearHead sunflowerSeed sunflowerSeedRotten
turmericRoot turmericRootRotten unfiredBowlBurnMedicine unfiredBowlDry
unfiredBowlFoodPoisoningMedicine unfiredBowlInjuryMedicine unfiredBowlMedicineRotten unfiredBowlVirusMedicine
unfiredBowlWet unfiredUrnDry unfiredUrnFlour unfiredUrnFlourRotten
unfiredUrnHulledWheat unfiredUrnHulledWheatRotten unfiredUrnWet wheat
wheatRotten willowSeed willowSeedRotten woodenPole
woolskin