Forum

> > CS2D > General > Lua scripting tutorial
Forums overviewCS2D overviewGeneral overviewLog in to reply

English Lua scripting tutorial

51 replies
Page
To the start Previous 1 2 3 Next To the start

old Re: Lua scripting tutorial

ohaz
User Off Offline

Quote
lol, I won't translate it in more than 2 languages. If you can't read the english text, you need to learn english, the english I use is not the hardest. A video about scripting doesn't really help, if you have to write something, you won't learn it by watching a video.
Perhaps I'll translate it to german later, but english is more important, because most cs2d players can't speak german, but most can speak english
@wups: Yeah thx, I'll use that

old Re: Lua scripting tutorial

Night Till Death
User Off Offline

Quote
Great just great.....Lua is going down to hell..........NVM (screw lua).....the all who dont know lua will have to do maps on their own thx a lot!

old Re: Lua scripting tutorial

wups
User Off Offline

Quote
Why not learn english?
Why should TKD translate to other language too, because of you cant english?

old Re: Lua scripting tutorial

ohaz
User Off Offline

Quote
perhaps the cause why I'm not translating it into russia is, that I can't speak russia.

wups, I'm now using your colour code, the clearness is better now, thank you!

old Re: Lua scripting tutorial

horus
User Off Offline

Quote
It stands out so much better now! ^-^
Quote
-- I just explain every little peace, on after another:

This bit has bothered me quite a bit...
@NTD: If you can understand this, then it should be relatively easy for you to understand the tutorial. Everything is a bit simplified for us beginners. ^-^

old Re: Lua scripting tutorial

Zune5
COMMUNITY BANNED Off Offline

Quote
NTD has written
noo.....im not the only russian person who playes cs2d! many russians play it! and the y dont even understand LUA OR ENGLISH!


Can you please stop arguing?
He's not going to translate it, into some random language.
Most players who play this game can't speak English well, and do fine making their own lua scripts.
But others do speak English pretty well, and do fine too.
Your English is good enough, so just read and learn

old Re: Lua scripting tutorial

Lee
Moderator Off Offline

Quote
TheKilledDeath has written
Would be a pleasure to work together with you
About the webdesign. The tutorial is currently just a *.html file, nothing more. So the only real way to make a design is with css and frames?


No frames, just leave the design to me, I've done a few freelancing jobs so I'm pretty confident about this.

old Re: Lua scripting tutorial

wups
User Off Offline

Quote
TKD, waiting for a good array guide too.
I'm really stuck on arrays and don't know how to start or end. :p

old Re: Lua scripting tutorial

ohaz
User Off Offline

Quote
oh well, an array is easy, perhaps i should just add some lines..
1
array = {firstentry, secondentry, thirdentry,...}
the only thing which is different to normal variables is the {} around it and the , between 2 values.
Just leave out the , after the last value.
to fetch out a value of an array use:
array[number] . where number is the number of the entry.
so array[3] would give out : "thirdentry"

old Re: Lua scripting tutorial

sonnenschein
User Off Offline

Quote
TheKilledDeath has written
oh well, an array is easy, perhaps i should just add some lines..
1
array = {firstentry, secondentry, thirdentry,...}
the only thing which is different to normal variables is the {} around it and the , between 2 values.
Just leave out the , after the last value.
to fetch out a value of an array use:
array[number] . where number is the number of the entry.
so array[3] would give out : "thirdentry"

OMFG I KNOW ARRAYS
this is gonna help me alot

EDIT: i've made a test, and it worked WOO.
1
2
3
4
5
6
7
8
9
10
11
12
13
myarray = {"How are you","Im good tnx!","OMFG YOUR GOOD WTF?"}


addhook("say","array_test")
function array_test(id,txt)
	if (txt =="!test1") then
		msg(myarray[1])
	elseif (txt =="!test2") then
		msg(myarray[2])
	elseif (txt =="!test3") then
		msg(myarray[3])
	end
end
edited 2×, last 25.06.09 06:31:16 pm

old Re: Lua scripting tutorial

Fub4r
User Off Offline

Quote
My friend told the lua scripting is for noobs and i won't know how it work...
I really don't understand that,but i think lua scripts are helping us...
Can someone give me a good reasons for him that isn't a noob work?

old Re: Lua scripting tutorial

ohaz
User Off Offline

Quote
Lua isn't very hard, perhaps that's why your friend says that it's noob work. But in fact you can also make very complicated scripts with Lua, so it's not nooby at all
edit:
I began to work on the "finding bugs" part (which is pretty extensive I think...)
edited 1×, last 28.06.09 07:39:02 am

old Re: Lua scripting tutorial

Fub4r
User Off Offline

Quote
When i show blazzingxx hero lua script he shut up...
But i still know he think Cs 1.6. is better than 2d...

Eh... I can't make any lua
I tried to make only joining message and it don't work...
i think i wouldn't script anymore...
I can only make good maps
Maybe i would later know how to make easy script...

Regards,

Maciej (Fub4r)

old Re: Lua scripting tutorial

SQ
Moderator Off Offline

Quote
Fub4r has written
When i show blazzingxx hero lua script he shut up...
Maciej (Fub4r)

My script isnt so special you think
Its still not done in my eyes.
If your friend think thats hard. Then dont believe him.

First you should try to use DC samples for begining.
cs2d_dir/sys/lua/samples/

old Re: Lua scripting tutorial

younes
COMMUNITY BANNED Off Offline

Quote
Fub4r has written
When i show blazzingxx hero lua script he shut up...
But i still know he think Cs 1.6. is better than 2d...

Eh... I can't make any lua
I tried to make only joining message and it don't work...
i think i wouldn't script anymore...
I can only make good maps
Maybe i would later know how to make easy script...

Regards,

Maciej (Fub4r)

don't care ,only people who love cs2d like it others don't, all of my friends think it's stupid but i really don't give a shit about that,and also,i sucked at lua,now i'm ok,thats all coz i downloaded a few scripts from us,and read them modified them learned from them and then i got use to lua , but it still is little hard...

old Re: Lua scripting tutorial

Fub4r
User Off Offline

Quote
You got right i don't have to hear what he say but i still tried to make scripts and they don't work... i think i would left scripting and g back to map makin!

old Re: Lua scripting tutorial

horus
User Off Offline

Quote
You don't need Lua if you've got the right map-making skills.
Unfortunately, I don't have those... so I'll try to learn some Lua.

old Re: Lua scripting tutorial

Fub4r
User Off Offline

Quote
But map don't be the same like good lua...
In Lua you can script "bad word = kick" in map nope...
Hope you see the diffrence...
I tried to use DC samples... And they not work in my scripts...
I just think i'm too noob for scripts
edited 1×, last 03.07.09 12:39:02 pm
To the start Previous 1 2 3 Next To the start
Log in to replyGeneral overviewCS2D overviewForums overview