Escape Simulator

Escape Simulator

31 ratings
Thoroniul's LUA Tutorial
   
Award
Favorite
Favorited
Unfavorite
Type: Logics
Language: English
Themes: Other
File Size
Posted
Updated
57.464 MB
18 May, 2022 @ 3:48pm
3 Jan, 2023 @ 8:02pm
39 Change Notes ( view )

Subscribe to download
Thoroniul's LUA Tutorial

Description
This room provides examples and code to build a working understanding on how to use the LUA editor.


Attributions
Enviroment metal/dielectric roughness test
https://github.com/KhronosGroup/glTF-Sample-Models/tree/master/2.0/MetalRoughSpheres
Ed Mackey
https://creativecommons.org/licenses/by/4.0/


Roughness Test
Ed Mackey
https://github.com/KhronosGroup/glTF-Sample-Models/tree/master/2.0/TransmissionRoughnessTest
https://creativecommons.org/licenses/by/4.0/

Transmission Test
https://github.com/KhronosGroup/glTF-Sample-Models/tree/master/2.0/TransmissionTest
https://creativecommons.org/publicdomain/zero/1.0/

Emission Test
https://github.com/KhronosGroup/glTF-Sample-Models/tree/master/2.0/EmissiveStrengthTest
Ed Mackey
https://creativecommons.org/licenses/by/4.0/

ClearCoat Test
Ed Mackey
https://github.com/KhronosGroup/glTF-Sample-Models/tree/master/2.0/ClearCoatTest
https://creativecommons.org/licenses/by/4.0/

Attentuation Test
https://github.com/KhronosGroup/glTF-Sample-Models/tree/master/2.0/AttenuationTest
https://creativecommons.org/licenses/by/4.0/

Toy Car
https://github.com/KhronosGroup/glTF-Sample-Models/tree/master/2.0/ToyCar
https://creativecommons.org/publicdomain/zero/1.0/

Mosquito in Amber
https://github.com/KhronosGroup/glTF-Sample-Models/tree/master/2.0/MosquitoInAmber
http://creativecommons.org/licenses/by/4.0/

Gram Velvet Sofa
https://github.com/KhronosGroup/glTF-Sample-Models/tree/master/2.0/GlamVelvetSofa
https://creativecommons.org/licenses/by/4.0/

Crow Caw Sound
https://www.freesoundslibrary.com/crow-caw-sound/
https://creativecommons.org/licenses/by/4.0/

24 Comments
Thoroniul  [author] 26 May @ 5:39pm 
@Cpt. flint. Yes, this is possible. If you notice the eye, it always points at the object the viewer is looking at. There is also api.getMainPlayer(), api.getLocalPlayer(), api.getClosestPlayer(Vec3 pos) , Transform[] getAllPlayers(). To get access to different player situations.

https://docs.escapesimulator.com/docs/room-editor/lua-scripting

It is best to join the Pine discord channel for questions pertaining to lua. https://discord.com/channels/449578254433517578/974985136221335583
Captain Flint 26 May @ 4:40pm 
This stuff is next level! Thank you!! I'm not sure if this is covered in the tutorial map, but is it possible to make a moving object track towards a player? I see player tracking is possible, But let's say I had an object that I wanted to move towards the player whatever direction the player is going. Any advice on where to start? Thank you!!
Ph0rx 2 May, 2024 @ 5:04am 
What happened to the "Rough Video" that was attached to this. I remember seeing some rotation code in there that I can't find anywhere else.
donnabeane57 17 Apr, 2024 @ 4:38am 
Thank you! This definitely gets me started!
Thoroniul  [author] 16 Apr, 2024 @ 6:21pm 
To copy just download the room into your own editor, and open the files in ugc.

For more information on lua, you could take a look at the wiki https://docs.escapesimulator.com/docs/room-editor/lua-scripting
donnabeane57 16 Apr, 2024 @ 7:16am 
Could you give me more information on copying? Where is the "workshop option"? if that means the workshop page where I edit my room, the only button there is <CREATE>. I noticed a sign somewhere in the tutorial that indicate I would need some prior knowledge. Could you tell me where to find what I will need to know? All I know about .lua is that it exists and seems to govern movement. I just published my first room. I want to do more and I know this will greatly increase my options for creating more interesting environments as well as possibly more creative puzzles. Please don't dismiss me on the grounds of my lack of knowledge. I am rather intuitive with code and have taught myself quite a bit simply by seeing examples of code and what they do, so I can learn this.
Lycos 25 Feb, 2023 @ 11:14am 
O my god, this i dident know. Thank you so much!
Thoroniul  [author] 24 Feb, 2023 @ 4:22pm 
In the top right corner of the workshop option there is a copy button. This copies the map folder into your own editor UGC enabling one to open the map in their own editor environment. One can open the map file and find the various .lua files.
Lycos 24 Feb, 2023 @ 12:43pm 
Sorry, i have no idea what you mean with copy the map. I have downloaded it, but there is no folder to find for me.
Thoroniul  [author] 24 Feb, 2023 @ 10:46am 
One can copy the map and search in the folder and just read the code directly.