Fortress Forever

Fortress Forever (https://forums.fortress-forever.com/index.php)
-   Lua (https://forums.fortress-forever.com/forumdisplay.php?f=44)
-   -   Using Custom Lua Scripts (https://forums.fortress-forever.com/showthread.php?t=14487)

trepid_jon 02-06-2008 06:07 PM

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.

sv_mapluasuffix

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, and...you 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 Klanope...at 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.

Dr.Satan 02-06-2008 08:11 PM

That's pretty sweet!

GeoKill-----> 02-06-2008 09:07 PM

That Sounds great b/c some class restrictions didn't work in all maps. I was thinking of adding restriction to Aardvark with 2 snipers/engy but I didn want restrictions on Hunted/Dustbowl/Conrfield/Palermo, etc.. Now I could do it in the Lua

So I'll shall experiment with this, Thank You

trepid_jon 02-06-2008 09:39 PM

Yeah, this is also good for mappers who want to test out new lua stuff without getting rid of the default scripts.

squeek. 02-06-2008 09:55 PM

Quote:

Originally Posted by trepid_jon
Yeah, this is also good for mappers who want to test out new lua stuff without getting rid of the default scripts.

ff_aardvark_BATTLESHIPS? Nevermind, that probably uses a different bsp with different entities.

trepid_jon 02-06-2008 10:49 PM

Yeah, I guess I should mention something about how you can only use existing entities and brushes. Be cool if we'd finally get lua around to creating entities, though...

Circuitous 02-15-2008 01:48 AM

I added this thread to the Lua section, as well as the Server section.

I dunno if they're two seperate threads or one omnithread. I'll find out shortly.

Edit: Seperate threads. Oh well.

trepid_jon 02-15-2008 02:14 AM

YOU SON OF A BITCH!

Haha, oh well indeed.

Could do that uh...move but leave a shadow or whatever.

Delete the one in server, and then move this one...leaving the forwarding link.

But would it be a sticky in both places?

Circuitous 02-15-2008 02:24 AM

...

I think that's worth a try.

Circuitous 02-15-2008 02:26 AM

It unstickied the redirect. Lame.


All times are GMT. The time now is 09:25 PM.

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