Page 1 of 2

Advanced Tutorial

Posted: 29 Mar 2014, 14:10
by Emyfour
Hi there, I'm new using the Spring Engine.
I have learnt something about the C++ and followed the Complete Guide by PTSnoop (this one, http://springrts.com/wiki/The_Complete_ ... pring_Game, which is very easy to follow and pretty good for a starter). Then I have played around a bit and made a simple game stealing some LUA files from the Tutorial Game (http://springrts.com/wiki/SpringTutorialGame).
But when I try to script my units or do anything more advanced, I get lost in the C++ and keep making mistakes.

Can you guys make something like an advanced tutorial, which explains you the LUA mechanics, the basic scripting and things like that? Or, if there's already something, can you give me the link? Maybe I'm too dumb to find it.

Thanks and sorry for the mistakes I may have made, English is not my mother tongue.
Bye and Happy Playing :lol:

Re: Advanced Tutorial

Posted: 29 Mar 2014, 14:15
by smoth
That is a big question with broad answers.

First thing you do not use c++ unless you are altering the engine

Everything else is Lua

To understand Lua search programming in Lua the PIL site is all you will need to get started that and show up in #moddev in the lobby!

Good luck have fun!

Re: Advanced Tutorial

Posted: 29 Mar 2014, 17:28
by FLOZi
imho there can be no such thing as its totally dependent on what game design you are trying to implement.

Perhaps a page which links to specific implementations of common RTS tropes (CTF, harvesting, squads etc) might be useful.

(That is basically what http://springrts.com/wiki/CollectionOfStuff tries to be afaics)

Re: Advanced Tutorial

Posted: 29 Mar 2014, 20:08
by Emyfour
FLOZi wrote:imho there can be no such thing as its totally dependent on what game design you are trying to implement.
*mumbles* you're right :)

I'll read that link and I hope I'll understand...
You know I'm that kind of person which always pretends the easy way :lol:
Thanx you all very nice here :)

Re: Advanced Tutorial

Posted: 29 Mar 2014, 20:44
by FLOZi
Best place is #moddev lobby channel for real-time discussions and help 8)

Re: Advanced Tutorial

Posted: 29 Mar 2014, 21:07
by PicassoCT
Why not make a clickable link "Wanna Make Game?" that weblobbys everyone right into the channel of maddev?

Re: Advanced Tutorial

Posted: 29 Mar 2014, 22:20
by smoth
programming in lua
I have the book on my desk, it should help with the parts of lua. The remaining logic parts, aka your game code is your own puzzle to solve. Luckily there are many projects to learn from

Re: Advanced Tutorial

Posted: 29 Mar 2014, 22:39
by FLOZi
Free first edition is more than enough for Spring purposes http://www.lua.org/pil/contents.html

Re: Advanced Tutorial

Posted: 30 Mar 2014, 10:18
by Emyfour
And, just in case, I found a PDF downloader for the second version:
removed

(Don't ask, I don't know if it's legal or not.)

And also this page might be useful

http://www.compileonline.com/execute_lua_online.php

It provides an online environment to test your LUA programs, since I didn't find any that can be installed...

Re: Advanced Tutorial

Posted: 30 Mar 2014, 10:39
by FLOZi

Re: Advanced Tutorial

Posted: 30 Mar 2014, 13:49
by knorke
FLOZi wrote:Perhaps a page which links to specific implementations of common RTS tropes (CTF, harvesting, squads etc) might be useful.
(That is basically what http://springrts.com/wiki/CollectionOfStuff tries to be afaics)
Hm bit different: Idea is to collect interessting things that otherwise might be forgotten. Some things like "unit morphing" is interessting too but so common it is not worth listing...

---

On "advanced tutorial about Lua scripting":
Maybe threads like Mobile Mex or funny dance missiles are interessting start points:
Small scripts with some comments and explaining text. Not real tutorials but maybe the closet that exists.
(Some more are in mentioned wiki page.) Though must look around a bit and often read through off topic blabla.

Reading http://springrts.com/wiki/TestingYourGame will save some time.

Re: Advanced Tutorial

Posted: 31 Mar 2014, 20:59
by gajop
If you know programming, learning Lua will be easy. There are a few concepts you should grasp, such as that there are no classes, but there are metatables, a lot of functions return nil instead of errors, that sort of thing.

Your other programming skills can be applied here, you just need to learn the Spring API, and how we do things.

Re: Advanced Tutorial

Posted: 01 Apr 2014, 01:05
by AF
Emyfour wrote:Hi there, I'm new using the Spring Engine.
I have learnt something about the C++ and followed the Complete Guide by PTSnoop....
Welcome =) and +1 for showing research

Re: Advanced Tutorial

Posted: 01 Apr 2014, 12:43
by zwzsg
I'll say it again: There is no C++ involved when making a game for Spring.

Only LUA.



Old Spring games also have TDF/FBI/BOS, but in new Spring games they can all be replaced by Lua.

Oh, and obviously, 3D models and texture/images are not Lua... But Lua is used for all the text/stat data and logic of the game.

The Spring engine is there to avoid you to deal with C++.

Re: Advanced Tutorial

Posted: 01 Apr 2014, 17:26
by knorke
zwzsg wrote:Old Spring games also have TDF/FBI/BOS, but in new Spring games they can all be replaced by Lua.
Plot twist! :shock: All spring games are old and so each one has some TDF/FBI/BOS.

Looking at engine c++ can still have some uses, but it is situational.

Re: Advanced Tutorial

Posted: 01 Apr 2014, 17:41
by knorke
I found a cob!
https://venture2.projectlocker.com/Gund ... efault.cob

But more importantly: games, not wip stuff that is not playable.

Re: Advanced Tutorial

Posted: 01 Apr 2014, 17:59
by smoth
knorke wrote:I found a cob!
https://venture2.projectlocker.com/Gund ... efault.cob

But more importantly: games, not wip stuff that is not playable.
TDF/FBI/BOS.
I am sorry knorke, is a dll C++?

Re: Advanced Tutorial

Posted: 01 Apr 2014, 21:58
by PicassoCT
a dll is usually a binary? So it should contain compiled machine language.. have i missed something skipreading the thread?

Re: Advanced Tutorial

Posted: 01 Apr 2014, 22:10
by FLOZi
PicassoCT wrote:have i missed something skipreading the thread?
Only tedious hair splitting. :roll:

I was going to say MCL is all lua but then remembered oh crap CEGs. It is fair to say that the vast majority of Spring projects will have at least one OTA format file of some kind; especially those which are long established and therefore prominent within the wider community.

Hopefully that satisfies everyone's burning desire to always be right / pedantic focus on absolute over-interpretations of what people type.

Re: Advanced Tutorial

Posted: 02 Apr 2014, 01:49
by Forboding Angel
Emyfour wrote:And, just in case, I found a PDF downloader for the second version:
removed

(Don't ask, I don't know if it's legal or not.)

And also this page might be useful

http://www.compileonline.com/execute_lua_online.php

It provides an online environment to test your LUA programs, since I didn't find any that can be installed...
Luaedit 2010, while it has an interface that makes baby jesus cry, it can be nice for syntax checking, checking output, etc, but without communicating with spring, something like this can only be so useful.