Forum

> > CS2D > General > Enabling lua in maps
Forums overviewCS2D overviewGeneral overviewLog in to reply

English Enabling lua in maps

6 replies
To the start Previous 1 Next To the start

old Enabling lua in maps

bollanog
User Off Offline

Quote
Hello good afternoon I am new to the use of Lua scripts, I want to use the trigger_if in the map but in the documentation it tells me that I have to enable the automatic loading of map scripts by setting mp_luamap to 1, which I don't know how I haven't found any tutorials on how to do it. Could you explain to me how to enable it? Thanks in advance.

old Re: Enabling lua in maps

Bowlinghead
User Off Offline

Quote
Lua Scripts allows the game to be altered more advanced than using settings.

mp_luamap is a serversetting, which you can enable by the developer console cs2d cmd mp_luamap .

old Re: Enabling lua in maps

bollanog
User Off Offline

Quote
Thanks Bowlinghead for responding, excuse me could you tell me or explain how I do it since I try but it doesn't work for me I don't know if I'm doing it wrong. Could you show me step by step please?

old Re: Enabling lua in maps

Bowlinghead
User Off Offline

Quote
If you run your server in your client/game:
-> New Game
-> More settings
-> set 'mp_luamap' to 1

If you use a dedicated server:
(you should have a config.cfg or server.cfg)
-> Search for 'mp_luamap' and set it to 1
-> or manually add it. (mp_luamap 1)
this file should include many other mp_, sv_, commands.


As an alternative you can use this as a luascript: (save the highlighted text as a xxx.lua file and drop it into your autorun folder (should be around sys/lua/autorun/):
1
2
3
4
5
6
--untested
function enableLuaMap() 
	parse("mp_luamap 1")
	parse("changemap "..map("name"))
end
enableLuaMap()
I dont know if this script works properly though

old Re: Enabling lua in maps

Komo the Cat
User Off Offline

Quote
I think you can just say in the console "mp_luamap 1" and restart the game using "restartround", it should use lua as the priority to make the map work.
To the start Previous 1 Next To the start
Log in to replyGeneral overviewCS2D overviewForums overview