Forum

> > CS2D > General > Lua Scripting:Help!
Forums overviewCS2D overviewGeneral overviewLog in to reply

English Lua Scripting:Help!

31 replies
Page
To the start Previous 1 2 Next To the start

old Lua Scripting:Help!

2340432z
User Off Offline

Quote
Hi everyone! I need help on understanding lua scripts. You see i have never used lua scripts and they sound very interesting based on the new version of cs2d
0.1.1.4 or w/e it was called. can any1 get me a tutorial? thank you

2340432z

old Re: Lua Scripting:Help!

Admir
User Off Offline

Quote
2340432z has written
Hi everyone! I need help on understanding lua scripts. You see i have never used lua scripts and they sound very interesting based on the new version of cs2d
0.1.1.4 or w/e it was called. can any1 get me a tutorial? thank you

2340432z


http://amx2d.co.cc <-- You can learn it from here.

old Re: Lua Scripting:Help!

Lee
Moderator Off Offline

Quote
absolutely, if you have any questions on lua scripting, just ask away and I'll answer it to the best of my ability. For a quick primer to get you started on Lua (This is very introductory and does not actually apply CS2D at alll, but rather an introduction to the language to get you started) go to

http://amx2d.co.cc/viewtopic.php?f=13&t=24

I will be writing an applied tutorial about integrating Lua with CS2D shortly so stay tuned. Also, if you have any specific questions to ask about Lua, you can always ask it at http://amx2d.co.cc/viewforum.php?f=11 and I'll try my best to answer.

old Re: Lua Scripting:Help!

Night Till Death
User Off Offline

Quote
i got a strange thing! the mods work but when i start the gungame it goes the other way around! it levels up from max lvl to minimum isnt therea way to turn the tables?

old Re: Lua Scripting:Help!

Lee
Moderator Off Offline

Quote
if you're using my mod just login via !login admin password and use @gg_reverse in game to reverse the levels

Alternatively, the gun game default is set on the reversed level from the more powerful weapons to pistols, you can change this in sys/lua/amx2d/settings/gg_levels.cfg

old Re: Lua Scripting:Help!

Night Till Death
User Off Offline

Quote
can you give me a link where i can download your gungame? when ever i search on the site you told all i find is an intorduction thats all!

old Re: Lua Scripting:Help!

Night Till Death
User Off Offline

Quote
strange i have another bug! it looks like my anti virus has deleted the all the lua mods so i had to reinstall cs2d! but now when i put all the files in sys/lua the mods dont work!

old Re: Lua Scripting:Help!

Lee
Moderator Off Offline

Quote
have you changed the server.lua file to

1
2
dofile("lua/amx2d/main.lua")()
main("sys/lua/amx2d")

Also, try opening the console on server load to see if there's any error messages, if there are, report them here and I'll do my best to fix them.

old Re: Lua Scripting:Help!

chuico123
User Off Offline

Quote
can anyone send me a template for a script that allows you to set how much pistols or grenades you can carry? so i can make such a mod, so its like you are using a belt that allows you to carry like 5 HEs, 3 FBs and 2 SGs, if i succefully make such a mod i will give credits if i post it

old Re: Lua Scripting:Help!

Lee
Moderator Off Offline

Quote
chuico123 has written
can anyone send me a template for a script that allows you to set how much pistols or grenades you can carry? so i can make such a mod, so its like you are using a belt that allows you to carry like 5 HEs, 3 FBs and 2 SGs, if i succefully make such a mod i will give credits if i post it


There's a way of doing this indirectly but it'll use some offhand techniques (But then again, since the lua engine just came out, practically all techniques are experimental at the moment) I'll post what I have once I get decently through into it.

old Re: Lua Scripting:Help!

chuico123
User Off Offline

Quote
leegao has written
There's a way of doing this indirectly but it'll use some offhand techniques (But then again, since the lua engine just came out, practically all techniques are experimental at the moment) I'll post what I have once I get decently through into it.


thanks, make it as simple as posible because i dont know much about it, and NTD, im sure someone will help you

old Re: Lua Scripting:Help!

Lee
Moderator Off Offline

Quote
NTD has written
ok thx for that but now i need to replace the samples/"luamod.lua" with mod2d/mods?
or what?


I've changed the name of the director to amx2d so it'll be at

sys/lua/amx2d/main.lua

In addition to that, you will also need to initialize the mod, so the code will be

∗
1
2
dofile("sys/lua/amx2d/main.lua")
main("sys/lua/amx2d")
∗

Also, if you have multiple mod files, starting with the next release you'll be able to have a second parameter to specify which mod you want on.

Quote
thanks, make it as simple as posible because i dont know much about it, and NTD, im sure someone will help you


Will do
To the start Previous 1 2 Next To the start
Log in to replyGeneral overviewCS2D overviewForums overview