Fortress Forever

Go Back   Fortress Forever > Editing > Mapping > Lua

Reply
 
Thread Tools Display Modes
Old 03-30-2014, 02:58 PM   #1
KubeDawg
Nade Whore
Server Owner
Beta Tester
 
KubeDawg's Avatar
 
Join Date: Sep 2007
Location: Oklahoma
Class/Position: Scout/Soldier
Gametype: CTF/TDM
Affiliations: blunt. Moto
Posts Rated Helpful 128 Times
Class Limiter

So I've been trying to get a new map to work properly but it would seem that my server.cfg file keeps getting in the way of the lua file for my map.

In my LUA file, I currently have all classes disabled except for Engineer and I'd like that class to be unlimited so anyone can choose Engineer. However, when I load my map it only allows 3 maximum Engi's per team which is the limit I have in my server.cfg file.

Shouldn't the LUA file take precedence? I mean it allows me to disable classes outright with no problems but as soon as I have a class limit set in my server.cfg file, it takes over.

Here's the code I'm using. I should mention it's in the includes part of my LUA file, originally called base_ctf, I made a copy of it called base_ctf_sg_battle so the original would not get modified. I attempted just bypassing this file altogether by putting this code directly in my map's LUA file to see if that might fix the problem but it does not.

Code:
function startup()

	SetGameDescription( "Capture the Flag" )
	
	-- set up team limits on each team
	SetPlayerLimit(Team.kBlue, 0)
	SetPlayerLimit(Team.kRed, 0)
	SetPlayerLimit(Team.kYellow, -1)
	SetPlayerLimit(Team.kGreen, -1)

	-- CTF maps generally don't have civilians,
	-- so override in map LUA file if you want 'em
	local team = GetTeam(Team.kBlue)
	team:SetClassLimit(Player.kEngineer, 0)
	team:SetClassLimit(Player.kScout, -1)
	team:SetClassLimit(Player.kSoldier, -1)
	team:SetClassLimit(Player.kMedic, -1)
	team:SetClassLimit(Player.kSpy, -1)
	team:SetClassLimit(Player.kPyro, -1)
	team:SetClassLimit(Player.kDemoman, -1)
	team:SetClassLimit(Player.kHwguy, -1)
	team:SetClassLimit(Player.kCivilian, -1)

	team = GetTeam(Team.kRed)
	team:SetClassLimit(Player.kEngineer, 0)
	team:SetClassLimit(Player.kScout, -1)
	team:SetClassLimit(Player.kSoldier, -1)
	team:SetClassLimit(Player.kMedic, -1)
	team:SetClassLimit(Player.kSpy, -1)
	team:SetClassLimit(Player.kPyro, -1)
	team:SetClassLimit(Player.kDemoman, -1)
	team:SetClassLimit(Player.kHwguy, -1)
	team:SetClassLimit(Player.kCivilian, -1)
end
__________________
Moto's Funhouse | Dallas, TX - 74.91.114.247:27015

ff_plunder - Complete
KubeDawg is offline   Reply With Quote


Old 03-30-2014, 09:00 PM   #2
the_cake
Beta Tester
 
Join Date: Jul 2008
Posts Rated Helpful 144 Times
Do map specific cfgs work in ff?

You make a FortressForever/maps/cfg/mapname.cfg file and put what you want in it.

I think they changed it to ModName/cfg/mapname.cfg in later versions.
the_cake is offline   Reply With Quote


Old 03-31-2014, 09:35 AM   #3
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 the_cake View Post
Do map specific cfgs work in ff?

You make a FortressForever/maps/cfg/mapname.cfg file and put what you want in it.

I think they changed it to ModName/cfg/mapname.cfg in later versions.
Yep, use a map cfg.

FortressForever/cfg/mapname.cfg

Making the Lua class limits take precedence to 'solve' this would mean that the server cvars would never do anything.
__________________
#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.; 03-31-2014 at 09:37 AM.
squeek. is offline   Reply With Quote


Old 03-31-2014, 02:16 PM   #4
KubeDawg
Nade Whore
Server Owner
Beta Tester
 
KubeDawg's Avatar
 
Join Date: Sep 2007
Location: Oklahoma
Class/Position: Scout/Soldier
Gametype: CTF/TDM
Affiliations: blunt. Moto
Posts Rated Helpful 128 Times
Ok thanks. Is there anything specific I need to have in this cfg file other than the code I posted?

And squeek, I think that would be how it should work, server.cfg would still always be there (UNLESS) the map lua first specifies the limit. What would be the negative cost if that were the case?
__________________
Moto's Funhouse | Dallas, TX - 74.91.114.247:27015

ff_plunder - Complete
KubeDawg is offline   Reply With Quote


Old 04-01-2014, 01:57 AM   #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 KubeDawg View Post
Ok thanks. Is there anything specific I need to have in this cfg file other than the code I posted?

And squeek, I think that would be how it should work, server.cfg would still always be there (UNLESS) the map lua first specifies the limit. What would be the negative cost if that were the case?
But the map Lua always specifies the limit, even if it's just the default limit of 0. There might be a decent way to resolve conflicting class limits, but simply having the Lua setting take precedent is not the solution (especially if you want a Lua limit of 0 to override the server cvar settings, which would mean the server cvars would become useless).

Map cfgs work just like any other config and is loaded after the default server.cfg. A single "cr_engineer 0" line inside cfg/mapname.cfg will only affect that map as long as you have the default cr_engineer setting in server.cfg.
__________________
#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-01-2014 at 02:00 AM.
squeek. is offline   Reply With Quote


Old 04-01-2014, 05:39 AM   #6
KubeDawg
Nade Whore
Server Owner
Beta Tester
 
KubeDawg's Avatar
 
Join Date: Sep 2007
Location: Oklahoma
Class/Position: Scout/Soldier
Gametype: CTF/TDM
Affiliations: blunt. Moto
Posts Rated Helpful 128 Times
Ok, thanks.
__________________
Moto's Funhouse | Dallas, TX - 74.91.114.247:27015

ff_plunder - Complete
KubeDawg is offline   Reply With Quote


Old 04-02-2014, 12:00 AM   #7
the_cake
Beta Tester
 
Join Date: Jul 2008
Posts Rated Helpful 144 Times
Quote:
Originally Posted by squeek. View Post
But the map Lua always specifies the limit, even if it's just the default limit of 0. There might be a decent way to resolve conflicting class limits, but simply having the Lua setting take precedent is not the solution (especially if you want a Lua limit of 0 to override the server cvar settings, which would mean the server cvars would become useless).
team:ForceClassLimit()?

This would also unbreak hunted on servers with a sniper limit.
the_cake 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 01:48 AM.


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