[DiscordArchive] Quick question on Eluna and getting scripts going. Seems easy enough, but I have limited knowledge o
[DiscordArchive] Quick question on Eluna and getting scripts going. Seems easy enough, but I have limited knowledge o
Archived author: Nadroj • Posted: 2024-06-29T20:08:09.169000+00:00
Original source
Quick question on Eluna and getting scripts going. Seems easy enough, but I have limited knowledge on SQL and reading code. I want to try to place the multivendor in the game, but I don't understand which npc_vendor value I should use from the servers data? I seemingly found the list, but I have no idea where these vendors correspond to. Is there another source I should be using to place a vendor in the proper spot?
Archived author: Revision • Posted: 2024-06-29T20:10:25.324000+00:00
Original source
The entry for npc_vendor doesn't matter as much as it sounds. Yes, you need one, but which one doesn't matter. You specify the entry to (simply put) tell it what list of items to sell. You can specify any of them, no matter if they're in use or not, and you can add your own and specify that. You don't use any creature other than the one you create for your script. You can use an entry from npc_vendor that's already in use and it doesn't ruin whoever is using it unless you change it, then it would change for all of the ones who use it obviously.
![[Image: image.png?ex=690c587a&is=690b06fa&hm=126...971166b01&]](https://cdn.discordapp.com/attachments/1255602330431127753/1256703916213538867/image.png?ex=690c587a&is=690b06fa&hm=1263602ce521dcb5210c3350f123a37fef942dee64080a4d166e521971166b01&)
Archived author: Nadroj • Posted: 2024-06-29T20:12:42.102000+00:00
Original source
If I'm understanding you correctly, the LUA script creates a npc for me, but I need to attach it to the world somehow for the script to run. So by navigating to this place in SQL database, I can just choose one of those and edit the LUA before recompiling the server?
![[Image: image.png?ex=690c587a&is=690b06fa&hm=126...971166b01&]](https://cdn.discordapp.com/attachments/1255602330431127753/1256703916213538867/image.png?ex=690c587a&is=690b06fa&hm=1263602ce521dcb5210c3350f123a37fef942dee64080a4d166e521971166b01&)
Archived author: Revision • Posted: 2024-06-29T20:13:54.254000+00:00
Original source
The Lua script doesn't create the NPC for you unless you add a query for the SQL insert. You specify the creature the script belongs to within the script but it has to exist to begin with. If you create it yourself or add queries to the Lua script is irrelevant.
Archived author: Revision • Posted: 2024-06-29T20:14:07.422000+00:00
Original source
You don't have to compile anything.
Archived author: Nadroj • Posted: 2024-06-29T20:14:27.918000+00:00
Original source
Oh, because LUA is a script language that executes when asked?
Archived author: Revision • Posted: 2024-06-29T20:14:38.720000+00:00
Original source
You can use `.reload eluna` in-game (or `reload eluna` in the worldserver terminal) to reload Lua changes and `.reload npc_vendor` when changing vendor items.
Archived author: Nadroj • Posted: 2024-06-29T20:14:40.265000+00:00
Original source
Opposed to a config file that only loads when the server is restarted
Archived author: Revision • Posted: 2024-06-29T20:15:08.407000+00:00
Original source
C++ scripts (i.e core changes and modules) are compiled into the binary, which is why it requires a compile when changing them. Eluna uses Lua script separate from the core and can be reloaded.
![[Image: image.png?ex=690c596c&is=690b07ec&hm=b08...12865047d&]](https://cdn.discordapp.com/attachments/1255602330431127753/1256704931658993745/image.png?ex=690c596c&is=690b07ec&hm=b08065d32b30b0a1a93969a1410711fa9c51a40d4bbe365e69d3ebb12865047d&)
Archived author: Nadroj • Posted: 2024-06-29T20:16:44.217000+00:00
Original source
I kinda get it, thank you.
So by replacing the commetned parts to look like this, coresponding with my screenshot above, it should just work?
![[Image: image.png?ex=690c596c&is=690b07ec&hm=b08...12865047d&]](https://cdn.discordapp.com/attachments/1255602330431127753/1256704931658993745/image.png?ex=690c596c&is=690b07ec&hm=b08065d32b30b0a1a93969a1410711fa9c51a40d4bbe365e69d3ebb12865047d&)