Thread: (Beta) FF Gun Game
View Single Post
Old 04-08-2013, 01:17 AM   #2
squeek.
Stuff Do-er
Lua Team
Wiki Team
Fortress Forever Staff
 
squeek.'s Avatar
 
Join Date: Mar 2007
Location: Northern California
Class/Position: Rallygun Shooter
Gametype: Conc tag (you just wait)
Affiliations: Mustache Brigade
Posts Rated Helpful 352 Times
Send a message via AIM to squeek.
Cool idea. However, there are better ways to allow maps to implement the script without having to edit the map's Lua directly.

sv_globalluascript is a server variable that will load a script on every map load from maps/globalscripts/<scriptname>.lua.

sv_mapluasuffix is another server variable that will load the Lua file from maps/mapname__<suffix>__.lua if it exists. For example, you could create a ff_dm__gungame__.lua and then have server owners use sv_mapluasuffix gungame to load it.

You can also use Lua tables to clean up your code (and remove the 20 weapon limit). Here's a quick rewrite (untested):


Glad to see someone making original Lua scripts.
__________________
#FF.Pickup ยค Fortress-Forever pickups

My Non-official Maps
Released FF_DM_Squeek - FF_2Mesa3_Classic - FF_Siege_Classic
Beta FF_Myth - FF_Redlight_Greenlight

Sick of the people on the internet, always moanin'. They just moan.
- Karl Pilkington

Last edited by squeek.; 04-08-2013 at 01:24 AM.
squeek. is offline   Reply With Quote