• This is a read only backup of the old Emudevs forum. If you want to have anything removed, please message me on Discord: KittyKaev

Lua scripts codestyle (Eluna scripts repo)

Status
Not open for further replies.

Neth

BETA Tester
Hi, I was looking for something to do and came across this, I thought i'd continue the blizzlike scriptings and in the same time learn Lua and see how far I can code without getting bored of it. Anyway my questions are : Is there any codestyle regarding the repo I should follow ? Should I create more folders ( like trinitycore (e.g : EasternKingdoms/AlteracValley, EasternKingdoms/MoltenCore etc...one folder per instance basicly)).

I think that's pretty much it, thanks in advance.
 

Foereaper

Founder
Yup, do it the same way as on the repo, also have a proper description for the name of the script. The way they're done right now they're named the same as trinity's scripts and converted accordingly.
 

Rochet2

Moderator / Eluna Dev
We discussed a little now and there are a few basic rules at the moment that have come up:
Registers should be at the bottom.
You should use a table for example to localize the functions and variables for an AI scirpt, quest script etc. (think of it as a script "class" for the AI), for example see this: https://github.com/ElunaLuaEngine/Scripts/blob/master/Blizzlike/EasternKingdoms/boss_kruul.lua
Fast example in case link broken: local BossName = {}; function BossName.SomeFunc() print("test"); end;
The function names should describe when they are triggered or what they do. For example "OnEnterCombat", "Frostbolt".


If you have any questions about something just ask :3
 
Status
Not open for further replies.
Top