Fortress Forever

Fortress Forever (https://forums.fortress-forever.com/index.php)
-   Lua (https://forums.fortress-forever.com/forumdisplay.php?f=44)
-   -   (Beta) FF Gun Game (https://forums.fortress-forever.com/showthread.php?t=23858)

ddm999 04-07-2013 06:23 PM

FF Gun Game
 
Now updated to v0.3, adding support for ff_dm_squeek and ff_hunted, 3 new weapon sets, and an easy way to skip weapons on servers with ggDebug enabled (oh, and bug fixes too). To enable Gun Game, type sv_mapluasuffix "gungame" into console.

A Lua script created by myself to add support for Gun Game in FF. When a player completes the Gun Game (got a kill with every weapon), the game restarts and everyone respawns.

To change the weapon set for Gun Game, open the map's Lua file, and change the line:
IncludeScript("name of Gun Game weapon set")

Gun Game weapon sets are located in your /maps/includes/ folder, and have the prefix gungame_

Download link: https://docs.google.com/file/d/0B6Up...xKRWYtcFU/edit

The .zip contains information on editing maps for Gun Game use, the Gun Game script, 6 weapon sets for it, and scripts for ff_dm, ff_dm_squeek, and ff_hunted.

Classes affect max health, max armor, speed and ammo counts.

Stuff to be done:

- Way of showing Gun Game winners on the scoreboard.
- More maps supported!
- Gun Game weapon sets by various people (that aren't me).
- gungame_crosscity_b1 - A DM map designed for Gun Game for around 2 to 6 players. All that remains to be done on crosscity is additional lighting. (and perhaps more places for movement techniques)

squeek. 04-08-2013 01:17 AM

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. :)

ddm999 04-08-2013 02:35 PM

Cheers squeek. I could never get my head round all the weird and wonderful ways that tables work. However, I seem to have noticed a problem that we both missed...

When you get to the next weapon, you don't actually get it until you next die (whoops). Therefore, I've used your script, and placed the weapon recieving inside a function that runs both on spawn, and on kill. And updated my Google Drive with it.

I never knew about sv_globalluascript, but I knew about sv_mapluasuffix. Don't really know why I didn't use it, now that I think about it.

I've got a ton of just random Lua gamemodes scattered in my FortressForever/maps/ folder. Think I've got pickup style OvD CTF, Dual Hunted, and other stuff that wasn't finished. :D

Anyway, as well as making it use sv_mapluasuffix, I've added support for ff_dm_squeek (cause I can). Which doesn't work because I must have been blindfolded when I wrote it.
BTW, why is ff_dm_squeek so badly instantiated? All the doors take up a million lines D:

EDIT: Ah. Shit. Medic only has 50 cells max, as a medkit drop is 10 cells. Meaning he can't place a dispenser or an SG. So the dispenser and SG weapons are pretty useless. Ah, well, people can just change class. Wait. Another thing. The engineer can detonate dispensers. Other classes have to use a console command. That's. A bit iffy. Another thing to change for next Gun Game update.

Elmo 04-08-2013 06:26 PM

very cool and I heartily commend your efforts!

squeek. 04-08-2013 10:28 PM

Quote:

Originally Posted by ddm999 (Post 499027)
Cheers squeek. I could never get my head round all the weird and wonderful ways that tables work. However, I seem to have noticed a problem that we both missed...

Not sure if you're familiar with other programming languages, but Lua tables are basically really flexible associative arrays (the keys can be pretty much any data type). You can read more here: http://www.lua.org/pil/2.5.html

Quote:

Anyway, as well as making it use sv_mapluasuffix, I've added support for ff_dm_squeek (cause I can). Which doesn't work because I must have been blindfolded when I wrote it.
BTW, why is ff_dm_squeek so badly instantiated? All the doors take up a million lines D:
Haha, ff_dm_squeek was my very first Lua script, so I'm sure it's pretty terribly written. There's definitely a lot that could be improved about it.

Quote:

EDIT: Ah. Shit. Medic only has 50 cells max, as a medkit drop is 10 cells. Meaning he can't place a dispenser or an SG. So the dispenser and SG weapons are pretty useless. Ah, well, people can just change class. Wait. Another thing. The engineer can detonate dispensers. Other classes have to use a console command. That's. A bit iffy. Another thing to change for next Gun Game update.
Yeah, the engi buildables might be better to leave out at this point. They aren't really going to be usable by the other classes without some changes to what Lua has access to.

ddm999 04-10-2013 02:50 PM

Updated to v0.3.
 
Quote:

Now updated to v0.3, adding support for ff_dm_squeek and ff_hunted, 3 new weapon sets, and an easy way to skip weapons on servers with ggDebug enabled (oh, and bug fixes too).


All times are GMT. The time now is 02:23 PM.

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