Forum

> > CS2D > General > CS2D Lua Scripting Tutorial Development
ForenübersichtCS2D-ÜbersichtGeneral-ÜbersichtEinloggen, um zu antworten

Englisch CS2D Lua Scripting Tutorial Development

74 Antworten
Seite
Zum Anfang Vorherige 1 2 3 4 Nächste Zum Anfang

alt CS2D Lua Scripting Tutorial Development

SQ
Moderator Off Offline

Zitieren
Since TheKilledDeath doesn't have time to work on Lua scripting tutorial, I will take his role.

> === Lua Manual Will Include ===
• Many different scripting lessons, not just basic functions.
• A lot of different Lua scripting samples with comments & explanations.
• Further tutorial versions are going to be translated to German Language.

> === You Can Suggest/Request ===
• What scripting examples should it have?
• What lessons should include?
• Should tutorial have more features? What features?

Learn Lua scripting & have fun!

alt Re: CS2D Lua Scripting Tutorial Development

doom15
BANNED Off Offline

Zitieren
you don't even know how much i've been waitin' for somthing like this....Nice ideea.

You should add Some parts when you give Examples like For 'x ' you can use this
Spoiler >


And more parts like this.

alt Re: CS2D Lua Scripting Tutorial Development

SQ
Moderator Off Offline

Zitieren
Probably I will make tutorial about image functions, so you will understand how to use images, sprites.

Also there will be GunGame, SuperHero scripting tutorials.

alt Re: CS2D Lua Scripting Tutorial Development

Flacko
User Off Offline

Zitieren
DaveRodec hat geschrieben
I don't need lessons from you BLazingxx, I need lessons from leegao Object orientated programming in lua for example...


Well dude, in that case you could just STFU because you don't even show a bit of interest.

alt Re: CS2D Lua Scripting Tutorial Development

Flacko
User Off Offline

Zitieren
Heavy hat geschrieben
I think you should explain File IO for saving and loading data. In python it is much easier in my opinion.

It's also easy in Lua, maybe it's just different.
Meanwhile, you can have this two functions that I used.
But first you will need this function by leegao:
1
2
3
4
5
6
7
8
9
10
11
12
function toTable(t,match)
	local cmd = {}
	if not match then
		match = "[^%s]+"
	else
		match = "[^"..match.."]+"
	end
	for word in string.gmatch(t, match) do
		table.insert(cmd, word)
	end
	return cmd
end

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
function writetofile(path, mode, dl, ...)
	local file = io.open(path, mode)
	if file then
		for i,v in ipairs(arg) do
			file:write(v)
			if i<#arg then file:write(dl) end
		end
		file:close()
		return true
	else
		return false
	end
end

function readfromfile(path,dl)
	if not dl then dl = "\n" end
	local file = io.open(path,"r")
	if file then
		local tbl = toTable(file:read("*a"),dl)
		file:close()
		return tbl
	else
		return false
	end
end
Maybe you can guess what they do by yourself
Zum Anfang Vorherige 1 2 3 4 Nächste Zum Anfang
Einloggen, um zu antwortenGeneral-ÜbersichtCS2D-ÜbersichtForenübersicht