Scripts / [SOLVED] Lost my Lua

Author
Message
bumblepuppy
2
Years of Service
User Offline
Joined: 13th Apr 2022
Location: Another Dimension
Posted: 15th May 2023 03:21
Fairly long time lurker here, first post that I've had to write because there's usually an answer, but this time I can't seem to find one.

Is there a way to find the name of the lua script that's attached to each entity, in a list, search function, or anything like that? I've created a map and put a script on an entity early on, but now I've added so many entities that I can't find the entity I attached the original script to. This may seem like a noob mistake, but that's because I am a noob. I've been putting entities I can't miss in newer maps I'm creating, but can I rectify this early mistake somehow or do I have to just search through the haystack for the single needle? I've seen that there's a list of entities that appears in the mapbank file for a map, but it doesn't look like it has the scripts attached (it could be that I just haven't seen them though, as I didn't want to mess around with too much code). I think you get the idea - dumb noob loses place.

If anyone can help with my rookie mistake, it'd be much appreciated!

The author of this post has marked a post as an answer.

Go to answer
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 15th May 2023 20:11
Edit the script and add the following line to the _main function:

PromptLocal( e, "Here I am: " .. GetEntityName( e ) )

Run test game and go hunt it down.
Been there, done that, got all the T-Shirts!
PM
smallg
Community Leader
19
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 15th May 2023 22:24
This post has been marked by the post author as the answer.
if you still can't find it you could also use
SetFreezePosition(g_Entity[e].x,g_Entity[e].y,g_Entity[e].z)
TransportToFreezePositionOnly()
to teleport the player to the object running the script in the game.

but no, there's no real easy way to find specific objects outside of test game in classic
lua guide for GG
https://steamcommunity.com/sharedfiles/filedetails/?id=398177770
windows 10
i5 @4ghz, 8gb ram, AMD R9 200 series , directx 11
bumblepuppy
2
Years of Service
User Offline
Joined: 13th Apr 2022
Location: Another Dimension
Posted: 18th May 2023 13:31
Many thanks to both of you legends! Will try it asap!

Login to post a reply

Server time is: 2024-12-21 15:50:19
Your offset time is: 2024-12-21 15:50:19