Fortress Forever

Go Back   Fortress Forever > Editing > Mapping > Lua

Reply
 
Thread Tools Display Modes
Old 11-11-2014, 11:42 PM   #1
R00Kie
Kawaii! ルーキー
Lua Team
Wiki Team
Fortress Forever Staff
 
R00Kie's Avatar
 
Join Date: Jan 2008
Location: Nowhere, Kansas
Class/Position: Random
Gametype: CTF
Affiliations: BiG, Kawaii!, MustacheBrigade, GoodFellas
Posts Rated Helpful 82 Times
Arrow Game Rules

Game rules are server-side scripts that modify game play. Some are useful, others pointless fun. If anyone has any questions or problems feel free to post. If someone has an idea they would like implemented on their server, I am willing to help. Enjoy


How to Install
  • game_rules

    Unzip this into your FortressForever/maps/ folder. These are the basic game rules files that will tell the server which scripts you want to run. You can comment out the ones you don't want to use with a double dash "--" in front of that IncludeScript.

    Example:
    Code:
    -- For CTF game mode put the include script here
    if GAMEMODE == "CTF" then
    	-- IncludeScript("game_force_ovd") -- Won't be used
    	IncludeScript("game_auto_balance")
    end
    
    -- For all game modes put the include script here
    IncludeScript("game_afk")
    --IncludeScript("game_spawn_safety") -- Don't use this
    To activate game_rules on your server use the CVAR below. Also make sure it is added to your server config file.
    Code:
    sv_globalluascript game_rules
  • Note: base_ctf & base_ctf4

    These are base files included with Fortress Forever, I added a single variable to them that I can detect for use with other files. Their main function remains unchanged and can be overwritten.

  • Download
    game_rules.zip @Google.Drive


Adding Mods

Put all mods in your FortressForever/maps/includes/ folder and add the appropriate IncludeScript("Game_name") To your game_rules.lua. There is an example above.
  • game_afk - Download Link

    Will send a player to spectator after about 2 minutes of not moving. Can be used on any game mode.
    Code:
    local CHECK_AFK = 30 -- How often in seconds it checks to see if a player is AFK
    local IDLE_TIME = 120 -- How long in seconds it takes to go AFK
    local MESSAGE_TIMER = 10 -- Starts counting down when the timer reaches this number
  • game_spawn_safety - Download Link

    Makes a player Immune to damage for a few seconds after spawning or until they attack another player. Can be used on any game mode.
    Code:
    local IMMUNE_TIME = 3
  • game_auto_balance - Download Link

    Prevents a player from joining a team that will make it unbalanced. Currently set up to only work on CTF with Red and Blue teams. Unknown what will happen if you try to use it on any other game modes.

  • game_force_ovd - Download Link

    Forces an Offense vs Defense game mode. With Blue as Offense and Red as Defense. The Red team will be unable to touch the Blue flag until the player threshold is met. Used on CTF game mode with Red and Blue teams.
    Code:
    local PLAYERS_NEEDED = 10



  • game_ff_armor - Download Link

    Armor-Only friendly fire. Mirror damage or Team only damage available.
    Code:
    TEAM_DAMAGE_ALLOWED = true
    TEAM_DAMAGE = 5 -- Divide damage by this much for less armor removed.
    
    MIRROR_DAMAGE_ALLOWED = true
    MIRROR_DAMAGE = 5 -- Divide damage by this much for less armor removed.
  • game_readyup - Download Link

    Puts players on a ready screen, in which they must type "r" (Or other modified chat message) to indicate they are ready to play. Begins a countdown when all players on both teams are ready. Only works during prematch.
    Code:
    local PrematchTime = 999
    local UsefulTip = "Type 'r' when you are ready to start the match."
    local ChatStrings = { "r", "ready", "start", "go" }  -- Strings to use for a player to accept being ready


  • game_duels - Download Link

    When two enemy players are within melee range of each other and hold "use" simultaneously. They will engage in a one on one duel. They will restock life and ammo. Outsiders can't interrupt them and they cant hurt outsiders until the duel is over. First player to kill the other; wins, or until 30 seconds is up then a random winner is chosen.
    Code:
    local REQUEST_RADIUS = 128
    local FIGHT_TIME = 30
    
    local USE_OBJECTIVEICON = true
    local RESTOCK_PLAYER = true
__________________
Released: [ Island ] [ Rookie ] [ Limbo ] [ Sonic ] [ Tomb ] [ Skydive2 ] [ Bunkerwars ]
Beta: [ Argon ] [ Reflection ] [ Urbantag ]
Lua: [ game_rules ]

Last edited by R00Kie; 11-29-2015 at 03:55 AM.
R00Kie is offline   Reply With Quote


5 members found this post helpful.
Old 12-23-2014, 10:23 PM   #2
DarthMan
 
DarthMan's Avatar
 
Join Date: May 2013
Gametype: Capture the Flag
Posts Rated Helpful 1 Times
Nice but you could improve the ovd lua to also support green and yellow depending on map.(this is not the reason it was removed from Moto's you know , it's because it confused new players)
__________________
FortressForever.MaximGroup.RO - 89.35.173.5:27018
DarthMan is offline   Reply With Quote


Old 12-25-2014, 06:21 AM   #3
R00Kie
Kawaii! ルーキー
Lua Team
Wiki Team
Fortress Forever Staff
 
R00Kie's Avatar
 
Join Date: Jan 2008
Location: Nowhere, Kansas
Class/Position: Random
Gametype: CTF
Affiliations: BiG, Kawaii!, MustacheBrigade, GoodFellas
Posts Rated Helpful 82 Times
Agreed, I'd like to add support for all teams. If someone wants to add a script on their server full time I'd be happy to try to help them modify it to their needs.
__________________
Released: [ Island ] [ Rookie ] [ Limbo ] [ Sonic ] [ Tomb ] [ Skydive2 ] [ Bunkerwars ]
Beta: [ Argon ] [ Reflection ] [ Urbantag ]
Lua: [ game_rules ]
R00Kie is offline   Reply With Quote


Old 12-26-2014, 05:41 PM   #4
truplaya
 
Join Date: Jan 2008
Posts Rated Helpful 12 Times
I would like to see more organized and possibly forced pub play as well especially when it comes to new comers not understanding the dynamics of the game and the objectives for a given map whether mostly on CTF maps. Pub games are 60% of the time "snoresville" (word of HIR), "I agree." (cake).

Currently in pubs, many new players have no sense of what the objective is and they run around the map in yard and their own base and hardly hold to the objective and teamwork. They choose classes that aren't optimal to win the game and we have snoresville.

To help assist in organizing a quality pub game, I would like to experiment with OVD only maps that have no blue base except for a blue cap. I would also like to create a team switch in OVD mode at the halfway time on a given map.

Moto-- robust has a half map destroy edit he created. It only has a red base, yard and blue cap in the blue base. The rest of the blue base is walled off. This map setup along with objective info at game join would assist in keeping new players on the objective hopefully.

I think that an objective info page upon joining is very important to tell players what to do and suggest what classes to choose and well as other server info.

As far as class restrictions go for offense and Defense I don't know if I want to address this yet because of the possible new changes that were gonna see in the new update making more classes balanced and acceptable in competitive play. I also don't want to kill the artistic element that a versatile engy can bring (matt). Or an offensive sniper or D snipe (the King). Its just hard when you have no frontline D and a full health offensive demo / soldier / HW or engy comes into your base just to spam you out when u are D and it just doesn't feel right . Also some maps like well depend on offensive demos to open grates / walls etc.. So we cant really restrict classes easily seemingly.

BUT WHAT I DO THINK WOULD BE SO COOL IS....if in OVD mode, at the half way time mark in the map, teams would switch. So if you were on blue and your team only scored 100 caps, the halfway mark would hit and u would switch to D and have to hold the offensive team 90 to win.

I really like the forced OVD mode on motos, but a problem with pub OVD at the moment is you never feel like you've won really there's very little measurement to decipher the winning team. Most OVD rounds are just like 230 - O there is no real baseline for judgment about what team really won, its just kind of a sit through and just stop the scouts / meds over and over.... It's just hard to tell who really won a game...makes it feel mindless + mundane.... The team switch at the mid round might help determine a winner for the round, motivating players more....

Last edited by truplaya; 12-26-2014 at 06:51 PM.
truplaya is offline   Reply With Quote


1 members found this post helpful.
Old 12-26-2014, 08:34 PM   #5
R00Kie
Kawaii! ルーキー
Lua Team
Wiki Team
Fortress Forever Staff
 
R00Kie's Avatar
 
Join Date: Jan 2008
Location: Nowhere, Kansas
Class/Position: Random
Gametype: CTF
Affiliations: BiG, Kawaii!, MustacheBrigade, GoodFellas
Posts Rated Helpful 82 Times
Making teams switch at halfway wouldn't be too hard. So both teams have a chance to play offense and defense in an OvD manner. Which is probably a good idea because sometimes it does just feel you are running to your death with no point. Perhaps adding an objective notice when you spawn would be helpful for new players. The objective icons can tricky when you add them, you want to give players information on how to play but not too much information. Like where the flag is at ALL times is probably too much information. But where it spawns at would be useful to a new player.

As far as decompiling an entire map just to get rid of the blue base to make OVD easier to understand for new players seems like a hassle and a waste of time. I could do something similar with lua without the need of ripping apart current maps only for OVD mode. Currently I just prevented players from touching the flag. But I could prevent them from entering the wrong base entirely, given that locations are set up correctly. With Default maps they probably are. If Moto is interested in adding something like this to his server, well, all these other scripts were basicly made for his server so all he needs to do is ask. lol
__________________
Released: [ Island ] [ Rookie ] [ Limbo ] [ Sonic ] [ Tomb ] [ Skydive2 ] [ Bunkerwars ]
Beta: [ Argon ] [ Reflection ] [ Urbantag ]
Lua: [ game_rules ]
R00Kie is offline   Reply With Quote


Old 12-26-2014, 09:02 PM   #6
truplaya
 
Join Date: Jan 2008
Posts Rated Helpful 12 Times
To compliment these ideas we could have player initiated votes for clan mode/ovd mode, and free for all pub mode. I think that would please the masses more as well. I like the idea of flexibility. Yea rookie I'm excited if we could get pubs more constructive and organized or at least just motos. I also like how you can adjust map boundaries with lua as well if that would be more simple. Where's moto , wat does he think?
truplaya is offline   Reply With Quote


Old 05-31-2015, 06:40 AM   #7
R00Kie
Kawaii! ルーキー
Lua Team
Wiki Team
Fortress Forever Staff
 
R00Kie's Avatar
 
Join Date: Jan 2008
Location: Nowhere, Kansas
Class/Position: Random
Gametype: CTF
Affiliations: BiG, Kawaii!, MustacheBrigade, GoodFellas
Posts Rated Helpful 82 Times
UPDATE

UPDATE!!

Check original post.
  • Added Game Rules
    • game_ff_armor
    • game_readyup
    • game_duels
  • Rewrote install instructions.
__________________
Released: [ Island ] [ Rookie ] [ Limbo ] [ Sonic ] [ Tomb ] [ Skydive2 ] [ Bunkerwars ]
Beta: [ Argon ] [ Reflection ] [ Urbantag ]
Lua: [ game_rules ]
R00Kie is offline   Reply With Quote


Old 06-06-2015, 08:08 PM   #8
R00Kie
Kawaii! ルーキー
Lua Team
Wiki Team
Fortress Forever Staff
 
R00Kie's Avatar
 
Join Date: Jan 2008
Location: Nowhere, Kansas
Class/Position: Random
Gametype: CTF
Affiliations: BiG, Kawaii!, MustacheBrigade, GoodFellas
Posts Rated Helpful 82 Times
Updated
  • Game_readyup
    • The available ready list commands now cycle randomly through them all for the tip at the top.
__________________
Released: [ Island ] [ Rookie ] [ Limbo ] [ Sonic ] [ Tomb ] [ Skydive2 ] [ Bunkerwars ]
Beta: [ Argon ] [ Reflection ] [ Urbantag ]
Lua: [ game_rules ]

Last edited by R00Kie; 06-06-2015 at 08:12 PM.
R00Kie is offline   Reply With Quote


1 members found this post helpful.
Old 07-21-2015, 09:58 PM   #9
Fat-Suzy
Server Owner
 
Join Date: Feb 2015
Location: New Zealand
Class/Position: Engineer / Heavy.
Gametype: Capture the Flag
Affiliations: {TALOS}
Posts Rated Helpful 75 Times
Rook, love this script... its been running flawlessly on my server since its launch.. question tho..

How would i go about editing it so forced ovd can be enabled / disabled mid round? Can lua scripts listen for chat "!commands" or listen for commands from the sourcemod menu?

I alse have all of my class limits set in the force ovd script and would like to be able to adjust those values mid game via a command.

Thanks
-Suzy
Fat-Suzy is offline   Reply With Quote


Old 07-21-2015, 11:33 PM   #10
R00Kie
Kawaii! ルーキー
Lua Team
Wiki Team
Fortress Forever Staff
 
R00Kie's Avatar
 
Join Date: Jan 2008
Location: Nowhere, Kansas
Class/Position: Random
Gametype: CTF
Affiliations: BiG, Kawaii!, MustacheBrigade, GoodFellas
Posts Rated Helpful 82 Times
You can make Chat commands with the player_onchat function
Here's a basic example.

Code:
function player_onchat( player, chatstring )
	
	local player = CastToPlayer( player )
	
	-- string.gsub call removes all control characters (newlines, return carriages, etc)
	-- string.sub call removes the playername: part of the string, leaving just the message
	local message = string.sub( string.gsub( chatstring, "%c", "" ), string.len(player:GetName())+3 )
	
        if Message == "/Hello" then
		ChatToAll("HELLO!")
		return false  -- Doesnt actually send the message to chat but still uses the command.
	end

	return true -- Allows players to still chat normally
end
And here is the (almost nothing) Wiki: http://www.fortress-forever.com/wiki...=Player_onchat
__________________
Released: [ Island ] [ Rookie ] [ Limbo ] [ Sonic ] [ Tomb ] [ Skydive2 ] [ Bunkerwars ]
Beta: [ Argon ] [ Reflection ] [ Urbantag ]
Lua: [ game_rules ]

Last edited by R00Kie; 07-21-2015 at 11:35 PM.
R00Kie is offline   Reply With Quote


1 members found this post helpful.
Old 07-22-2015, 01:34 AM   #11
Fat-Suzy
Server Owner
 
Join Date: Feb 2015
Location: New Zealand
Class/Position: Engineer / Heavy.
Gametype: Capture the Flag
Affiliations: {TALOS}
Posts Rated Helpful 75 Times
thanks rookie! ill have a play with this function, im sure i can make something work..
Fat-Suzy 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 02:56 PM.


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