Fortress Forever

Go Back   Fortress Forever > Editing > Mapping > Lua

Thread Tools Display Modes
Prev Previous Post   Next Post Next
Old 02-06-2008, 07:07 PM   #1
Ray Ray Johnson
Fortress Forever Staff
trepid_jon's Avatar
Join Date: Feb 2005
Location: Dallas, TX
Class/Position: D Civilian
Gametype: Rocket Jousting
Affiliations: EAFD
Posts Rated Helpful 78 Times
Send a message via ICQ to trepid_jon Send a message via AIM to trepid_jon
Arrow Using Custom Lua Scripts

A Fortress Forever feature most server admins don't know about has the potential to be a very powerful and fun feature.


That cvar allows you to keep the default lua script, but have any number of alternate lua versions that you can easily use without renaming/deleting/overwriting/whatever.

All you do is set sv_mapluasuffix to whatever text you want before loading a map, and FF will attempt to load an alternate lua file (mapname__suffix__.lua - 2 underscores on each side of the suffix) for that map. If the alternate lua file isn't found, the default lua file (mapname.lua) will load.

This cvar is archived, so you can set it to something you commonly use without doing any kind of micromanagement. The default value is 0, so use that to reset the gameplay. And it should go without saying, but no suffix can be 0.

For instance, hunted's lua script (and therefore, gameplay) will be different in 2.0. However, you'll be able to use sv_mapluasuffix "classic" to load the old lua script from 1.11 if you feel like playing the old way for whatever reason. If ff_hunted__classic__.lua isn't included with 2.0 for some reason, you'll still be able to at least find it here on the forums.

But for another example, let's say you set sv_mapluasuffix to "pong" because you have an alternate version of ff_cz2.lua that somehow lets people play pong. Instead of getting rid of the default cz2 lua file, all you need is an alternate lua file to be named ff_cz2__pong__.lua with that cvar set. Then maybe you also make a pong version of crossover, so you would then need ff_crossover__pong__.lua. And so on.

Also, maybe you have an ovd version of the crossover lua. You just need ff_crossover__ovd__.lua and sv_mapluasuffix to be "ovd" and you're all set.

Annnnnnd, maybe you also have a reverse ctf version of the crossover lua (could be the easiest alternate lua to make, so maybe we should do this and include them with FF 2.0?). Just set sv_mapluasuffix to "rctf" and make sure you have an ff_crossover__rctf__.lua file.

An example of another use would be a massive customization pack...say uh...called Klanope. And you want to change every map's gameplay, items, just wanna change a lot. So you create new flag/backpack/health/armor/whatever models, new sounds, and stuff like that. Pretty much everything lua uses. Then you could put everything but your new lua files in a klanope folder for accessibility, and you could have a whole bunch of ff_mapname__klanope__.lua files. People would install this...well, they'd essentially install this mod of our mod and set their server's sv_mapluasuffix to "klanope"...and suddenly their FF has been modified into least in terms of map entities and gameplay.

Keep in mind, you're pretty much limited to editing the existing entities in a bsp. Not like you could add a 3rd base to crossover or something like that.

Good times to be had, that's what I say.
Support FF:
trepid_jon is offline   Reply With Quote


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

All times are GMT. The time now is 09:06 AM.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2021, vBulletin Solutions, Inc.