SRB2 Message Board  

Go Back   SRB2 Message Board > Archived > Outdated Releases (2.1.X) > Lua (2.1.X)

Thread Tools
Map Finish Command Execution Lua Script Details »»
Map Finish Command Execution Lua Script
Version: v1.1.1 (Final Version for SRB2 2.1), by chaoloveicemdboy chaoloveicemdboy is offline
Developer Last Online: Jul 2020

Category: Version: SRB2 Rating:
Released: 11-19-2019 Last Update: Never Favourites: 0
Scripts Re-Useable Content

The Map Finish Command Execution Lua script allows you to execute console commands when you finish the level.

All the configs must be in the MFCE folder located inside of the SRB2 home folder. The MFCE setup config is executed on map change by the server, and does not support the prepareCommandsForClients command since it is only used to set certain server settings if you have this Lua script loaded that you would not want to be loaded otherwise. The file name for the MFCE setup config is mfce-setup.cfg Both the MFCE server and client configs are executed when a player finishes the level, but the MFCE server configs are server-sided, while the MFCE client configs are client-sided. The file names for the MFCE server configs are mfce-server-Cluster([local]serverClusterData.ID)-([global]gamemap)-Tag([global], while the file names for the MFCE client configs are mfce-client-Cluster([local]serverClusterData.ID)-([global]gamemap)-Tag([global]

The prepareCommandsForClients command can take any number of commands, and only works if used inside of a MFCE server config, and it is used to execute commands on all clients. The setClusterData command is used to set the server cluster ID, and server cluster name, which are both strings, but it is recommended that the server cluster ID is all lowercase and has no spaces.

Map Finish Command Execution v1.1.1:
* The commands exitgame and quit can no longer be used as arguments for the prepareCommandsForClients command
* Final version for SRB2 2.1.25

Map Finish Command Execution v1.1.0:
* Rewrote the MFCE Lua script to support server side command execution on map finish
* Removed the executionmode
* Replaced the serverid with the setclusterdata command which sets both the id and name of the server cluster
* Added the showclusterdata command
* Removed the setcommandbuffer command
* Added the preparecommandsforclients command, which will only work if used inside of MFCE server configs
and this command is used to execute commands on all clients on a specific server cluster
that finish a specific level using a sector with a specific tag
* Added MFCE setup config, which is called mfce-setup.cfg and is executed on map change
* Added MFCE server configs, which are called mfce-server-Cluster([local]serverClusterData.ID)-([global]gamemap)-Tag([global]
* Changed the name of MFCE client configs to mfce-client-Cluster([local]serverClusterData.ID)-([global]gamemap)-Tag([global]

Map Finish Command Execution v1.0.0:
* Initial release


Download Now

File Type: zip MFCE (3.4 KB, 43 views)


Click image for larger version

Name:	srb20000.gif
Views:	422
Size:	1.65 MB
ID:	23087  

Show Your Support

  • The author of this addon has given explicit permission for its content to be re-used and/or reproduced.

Old 11-19-2019   #2
Probably Responsible
D00D64's Avatar

Welcome to releases! Though, it'd be best to have a GIF of your example in action, so we have a visual example of this happening too.
D00D64 is offline  
Old 11-19-2019   #3

Originally Posted by D00D64 View Post
Welcome to releases! Though, it'd be best to have a GIF of your example in action, so we have a visual example of this happening too.
I'll do that after I release MFCE v1.1.0 since it is already almost complete. It only took less than a day to make MFCE v1.0.0 as well with how small MFCE is.

Edit: Due to real life stuff that I need to do and wanting to polish up the next update for MFCE, MFCE v1.1.0 won't come out until next week, and as a result, I'm going to take a GIF or too of MFCE v1.0.0 in action.

Last edited by chaoloveicemdboy; 11-19-2019 at 08:01 PM.
chaoloveicemdboy is offline  
Old 11-27-2019   #4

MFCE v1.1.0 has been delayed till I finish and release the MFCE Config Creator v1.0.0.
chaoloveicemdboy is offline  
Old 11-30-2019   #5

Sorry for the triple post, but with my extreme boredom and 2.2 coming out really soon, I've decided to change up MFCE v1.1.0 again while finally figuring out how to make the player number added by 1 unnecessary for server configs without breaking them and bug testing this Lua script again. As a result, MFCE v1.1.0 is no longer delayed and has been released, and MFCE Config Creator is officially, permanently canceled, but this may or may not be the last version of MFCE, which is currently unknown.

Edit: I re-uploaded the zip file, because I forgot to include the MFCE config folder, which contains the test MFCE configs.

Edit 2: I found a Lua error that occurs if you use the exitgame command as an argument in preparecommandsforclients, then try to use another argument after that particular argument. As a result, I'm going to have to fix this, and MFCE v1.1.1 is going to be the last version due to it being a nightmare to work with.

Edit 3: Change of plans since I came up with an idea that will actually work as a workaround for not being other able to join other servers after finishing the level effectively making MFCE useful for its intended purpose, which means that there will be a MFCE v1.2.0 for SRB2 2.2, and MFCE is not as big of a failure as I thought it was.

Last edited by chaoloveicemdboy; 12-07-2019 at 03:56 PM.
chaoloveicemdboy is offline  

Thread Tools

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

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