How to create your own gamemode?

Report bugs of MFPS 2.0 here
Post Reply
User avatar
Rofel
Contributor
Contributor
Posts: 49
Joined: Tue May 28, 2019 10:56 pm

How to create your own gamemode in MFPS?
User avatar
InCodeWeTrust
Contributor
Contributor
Posts: 18
Joined: Wed Mar 27, 2019 10:05 am

To create a new game mode you will actually create it, which would require you to code the logic.
User avatar
Slava
New Member
New Member
Posts: 2
Joined: Tue Oct 22, 2019 11:38 am

InCodeWeTrust wrote:To create a new game mode you will actually create it, which would require you to code the logic.
How to build it into the system?
User avatar
InCodeWeTrust
Contributor
Contributor
Posts: 18
Joined: Wed Mar 27, 2019 10:05 am

Slava wrote: Mon Oct 28, 2019 11:04 am
InCodeWeTrust wrote:To create a new game mode you will actually create it, which would require you to code the logic.
How to build it into the system?
That all depends on what it is. For instance something simplier -> I wrote my own vital slider controller for various vitals like stamina health armor etc.

This required some hooks into these scripts:
bl_PlayerUIBank.cs
bl_PlayerHealthManager.cs

and for example: I changed the HealthBar type from Image to my new script PlayerStatSlider to hook into it. I try not alter the code base directly and if I do minimal to provide links to my mods to manipulate MFPS. This way you can update without losing too much of your own mods.

To approach a gamemode, I would first look at how one is currently handled. IE: Gunrace -> This is one of the simpliar game modes to examine and look at to approach creating your own. You need to create UI for this new game mode and add it to every game scene. Add it to lobby script and game data if needed for options and a game mode script that runs that gamemode for points or kills or whatever your tracking.

You really need to understand how MFPS works under the hood before you can extend it. Good news its coded pretty clearly and a big community behind it so if you get stuck I am sure you can just ask.
Post Reply