Escape Simulator

Escape Simulator

Thoroniul's LUA Tutorial
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.
Lycos 24 Feb, 2023 @ 5:26am 
Can you please give me the code for this function?
Lycos 24 Feb, 2023 @ 5:25am 
Yes, that’s what i mean.
Thoroniul  [author] 23 Feb, 2023 @ 4:29pm 
There is the eyeball on the ceiling that does this.
Lycos 22 Feb, 2023 @ 11:12am 
Yes, I mean an object that always looks at the closest player. Like a camera following the player.
Thoroniul  [author] 22 Feb, 2023 @ 10:45am 
I wonder what specifically you mean by "from the rotation". Do you mean tracking a players rotation?
Lycos 21 Feb, 2023 @ 4:25am 
Hello, can you please give me a code example for an object that follows the next player from the rotation? So the way you solved it with the camera.
Thoroniul  [author] 9 Oct, 2022 @ 7:58am 
I have already fixed the activator, forgot to post it here.
Thoroniul  [author] 22 Sep, 2022 @ 7:31pm 
I'm aware that some examples stop working because activators calls with lua have changed.

I will attempt to have free time and fix it later, and merge my display logic lua map with this one.

https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=2844437720
Thoroniul  [author] 28 Jun, 2022 @ 7:23am 
<3
Zesty Mordant 20 Jun, 2022 @ 3:07pm 
Awesome reference!
Thoroniul  [author] 14 Jun, 2022 @ 10:00am 
If you have any questions feel free to ask here in a thread, or on the discord.
Tarmo 14 Jun, 2022 @ 2:48am 
Thank you for making this, I was looking for something like this.
Thoroniul  [author] 12 Jun, 2022 @ 3:55pm 
Glad it was helpful to you.
namo_krub 12 Jun, 2022 @ 10:17am 
Thank you so much!! very useful for learning lua-script