Fortress Forever

Go Back   Fortress Forever > Editing > Mapping > Lua

Reply
 
Thread Tools Display Modes
Old 04-07-2013, 07:23 PM   #1
ddm999
worst ff player eu
 
Join Date: Jun 2012
Location: South Yorks., England
Class/Position: o - no, d - scout
Gametype: IvDZ
Posts Rated Helpful 18 Times
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)

Last edited by ddm999; 04-10-2013 at 11:29 AM. Reason: Updated to v0.3 :D
ddm999 is offline   Reply With Quote


Old 04-08-2013, 02: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 02:24 AM.
squeek. is offline   Reply With Quote


Old 04-08-2013, 03:35 PM   #3
ddm999
worst ff player eu
 
Join Date: Jun 2012
Location: South Yorks., England
Class/Position: o - no, d - scout
Gametype: IvDZ
Posts Rated Helpful 18 Times
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.

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.
__________________
gg ff not ded
ff very much alive

Last edited by ddm999; 04-08-2013 at 06:22 PM.
ddm999 is offline   Reply With Quote


Old 04-08-2013, 07:26 PM   #4
Elmo
Gets tickled by FF
Fortress Forever Staff
 
Elmo's Avatar
 
Join Date: Jun 2007
Location: UK
Class/Position: Med Solly HW
Gametype: Any/CTF
Posts Rated Helpful 41 Times
very cool and I heartily commend your efforts!
__________________
Support FF:
Done: ff_monkey
Done: ff_bases
Done: ff_warpath
Forever Doing: ff_medieval (beta#99999999)
Elmo is offline   Reply With Quote


Old 04-08-2013, 11:28 PM   #5
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.
Quote:
Originally Posted by ddm999 View Post
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.
__________________
#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
squeek. is offline   Reply With Quote


Old 04-10-2013, 03:50 PM   #6
ddm999
worst ff player eu
 
Join Date: Jun 2012
Location: South Yorks., England
Class/Position: o - no, d - scout
Gametype: IvDZ
Posts Rated Helpful 18 Times
Thumbs up 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).
__________________
gg ff not ded
ff very much alive
ddm999 is offline   Reply With Quote


Reply


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

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 05:04 AM.


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