How to start scripting:
GG Tutorials:
http://steamcommunity.com/sharedfiles/filedetails/?id=398177770
https://forum.game-guru.com/thread/212794
Some Basic Lua tutorials:
English:
http://www.lua.org/pil/1.html
Crash Courses:
http://luatut.com/crash_course.html
http://tylerneylon.com/a/learn-lua/
German:
http://lua.gts-stolberg.de/
Some Lua Editors:
Test them all and find your favorite, there is not a best one.
https://notepad-plus-plus.org/ - Here is a syntax highlighting addon for GG:
https://forum.game-guru.com/thread/213931
http://studio.zerobrane.com/ - Has a compile function, so you can find smaller lua syntax mistakes
http://luaedit.sourceforge.net/ - Just another option(I did not use this, but maybe you find it good)
If you have a editor and some basic knowledge you should start with GG functions. Your best friend will be the Prompt("string") command. In programming there is no wrong or right, it counts if it works or not. Of course there is a good commented or optimised version, but you started scripting, so let this be your last optional part of scripting
As a small tipp: Nearly every command is in the global.lua in your scriptbank folder.
Before you say a script do not work, test this:
Go into properties and look for
static Mode = NO (if your entity is now away set: Immobile=Yes)
Always active=Yes (if it now works, you are just to far away)
How to start in a logical row:
1) Simple and advanced text messages, timer events (if you understand that, you can start your Quest system)
2) X-Y-Z axis for player and entities (play with it, read it, change it and so on)(be sure you disable collision for entities if you move them)
3) Test Environment Lua Commands like SetFogBlue(v) and so on(optional)
4) Learn to use GG. Ok how I mean this: GG is in a state where a lot of stuff is included, but you maybe never use it. But you will be no good scripter if you not undertand how to read the global.lua. It has a lot of commands and should know what can be done or not, or how to work around.
After you did this a lot and think you undertstand it
no row)
*) AI expirience with animation
*) Hear what people in the forum want and try to archieve (Inventories, Quest Systems, a complete Environment changer,...)
*) Think what you need and develope it
*) Learn to use functions. If your script should be optimised, use functions. This are commands you write yourself in the script, because it is a calculation, you need a part of a script more often, or your script becomes unclear.
Functions Example:
function CarryObject(e)
AngPlr = math.floor(g_PlayerAngY)
while AngPlr > 340 do
AngPlr = AngPlr - 360
end
while AngPlr < 0.0 do
AngPlr = AngPlr + 360
end
x1 = g_PlayerPosX + 50*math.sin(math.rad(AngPlr))
y1 = g_PlayerPosY - 25
z1 = g_PlayerPosZ + 50*math.cos(math.rad(AngPlr))
GravityOff(e)
CollisionOff(e)
RotateToPlayer(e)
ResetPosition(e,x1,y1,z1)
SetPosition(e,x1,y1,z1)
end
Of course this is no tutorial, but for all beginners it should give a small way to orientate oneself.
Happy learning
My dream is to develope games, which makes fun when I create it and fun when other people play it.