Resource icon

[Reusable] Map Finish Command Execution 2.0.1

This thread contains content that may be reused, modified, or ported by anyone.
Map Finish Command Execution has been completely rewritten to be client-sided and much simpler, since I got better at understanding how net-safety works and it was too difficult to use before the final rewrite. You'll no longer have to use hard-to-explain commands to add commands to a command buffer that gets executed when you complete the level, and instead local IO is used when you complete the level to load the console script and execute the commands from it. To use this Lua script, create a console script that is named Map<extended map number>-Tag<exit sector tag>.cfg and make sure that the console script is stored in luafiles/client/MFCE, then when you finish a level with that specific extended map number using an exit sector with that specific tag, then that console script will be executed after the config data has been read successfully.

Example
Create a file in luafiles/client/MFCE and name it Map01-Tag0.cfg, for example, then open it up with any text editor. After that, type echo "Hello World!" into the file, then save the file. Load up SRB2 2.2.5 or 2.2.6, then add MFCE v2.0.1, then load up Greenflower Zone Act 1 and complete the level. A message that says "Hello World!" should be printed in the console after you have completed the level.

Changelog
Map Finish Command Execution v2.0.1:
* MFCE is now supported for game sessions other than netgames
* Replaced PlayerQuit hook with GameQuit hook to reset the MFCE local table when you exit outside of game sessions that are not netgames
* The MFCE local table is now nil for the dedicated server, because the dedicated server is not a player
* Now supports SRB2 2.2.5/2.2.6

Map Finish Command Execution v2.0.0:
* Rewrote the MFCE Lua script completely from scratch to use client-sided IO so a ton of commands that were no longer required were removed
* MFCE server configs have been permanently removed due to evil host concerns
* MFCE client configs are now console scripts named Map<extended map number>-Tag<exit sector tag>.cfg that are stored in luafiles/client/MFCE
* Now supports SRB2 2.2.3/2.2.4

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]player.mo.subsector.sector.tag).cfg
* Changed the name of MFCE client configs to mfce-client-Cluster([local]serverClusterData.ID)-([global]gamemap)-Tag([global]player.mo.subsector.sector.tag).cfg

Map Finish Command Execution v1.0.0:
* Initial release

Screenshot
attachment.php

STJr and any other entity has permission to port Map Finish Command Execution to future versions if I have not been active in the community for at least 6 months. Please note I may ask them to take the ports down if I return after such an event has occurred, and they must give me credit.
 
Last edited:

Who is viewing this thread (Total: 1, Members: 0, Guests: 1)

Top