All my tutorials are actually in the Modding Guides announcements ( the relevant updated tutorials anyway )
Ahh ok, I hope they add this one and the next two in there as well.....not seeing this on in there yet. Nevermind, it's there.
Got a question, but I don't know if it really warrants its own thread. When you create a function, what hierarchy is it placed under? For example, i've made LUA scripts for some of my objects, like the Advanced Furnace. Are functions in advanced_furnace.lua available only to the furnace, or all objects? Is there a way to make a function so that all objects could access it?
It will be only for that object. If you want it so that all objects can access that function, place it in a separate lua file and include it in the scripts array for each object that you want to be able to access the function. There is no way to have every object in the database able to access some arbitrary function (AKA A global script/function).
Just to add a little more, when severedskullz says script array inside the object file you will see Code: "scripts" : [ "/objects/wired/landmine/landmine.lua" ], You can add as many scripts as you want Code: "scripts" : [ "/objects/wired/landmine/landmine.lua", "/objects/wired/light/light.lua", /objects/wired/jump/jump.lua" ] So the object utilizes it
Shouldn't this be a LUE tutorial? But seriously, this is awesome. I'll have to look at it in depth later.
Version 1.2 Update Added a small code snippet example for string handling which can have ingame applications (except for the print part - which is just to see it in action for online interpreters) Code: test = "reefpodH_sbno" i, j = string.find(test, "H_sbno") g = string.sub(test,0,i-1) print(g)
Just my 2 cents for improvement on an already great guide: Perhaps providing some examples of situations where each snippet of information would be useful in relation to creating useful mod applications would help people wrap their heads around the information better. Like when a child is learning addition you show them places where it might be useful in addition to how it works.
The practical application will be part of part 3. Which is currently in limbo since one of our writers have gone M.I.A Though will deffinetly looking into finishing it up as soon as possible.
That would be excellent but it may be more useful here and as you go along. Maybe I'm a bit slow but as a beginner with a little bit of coding experience in other languages I found the subject matter kind of difficult to wrap my head around. As someone who wants to just jump into modding feet first I found myself asking while reading "How can I apply this right now?" and "Why is being able to modify strings in so many different ways so important when modding Starbound?" I hope this criticism doesn't make you think I am unappreciative; I just hope that you (as the teacher) can use my (as the student) impressions to help out more idiots like myself. @.@
No issues I always accept all forms of criticism. The biggest issue is you have coding experience, so you have foundations set. For other users they need some ground work before getting their feet wet. Part 3, will be more for you since it starts with the basics in an example basis. Till then though feel free to see a few small code projects which use the tutorials as a reference http://community.playstarbound.com/resources/m-r-mad-doctors-experiements.2834/
Thanks! I do have it I've looked through it a little bit already it's an excellent resource. Is part 2 out already?
Yes, sorry I thought part 2 was linked. Seems for some reason it isn't anymore http://community.playstarbound.com/...-operators-tables-loops-and-statements.89088/
Correct me if I'm wrong, but this is a mistake. EDIT: Didn't notice the space when I was looking at it in tutoprial, my bad,