Jump to content

How i can add 2 gamemods inside one single server


Ahmedos

Recommended Posts

  • Moderators
16 hours ago, Ahmedos said:

I mean Multi Game Mode

The generic answer is, you need to create a resource that serves as manager
> and rewrite each gamemode, so that their usage can be scoped(data/elements/events) for specific players.

Best is to get inspiration from an already existing Multi Game Mode resource. Since this is really a lot of work and complexity. Explaining the process from A to B would take too much of my time (sorry).

  • Thanks 1
Link to comment
5 hours ago, IIYAMA said:

The generic answer is, you need to create a resource that serves as manager
> and rewrite each gamemode, so that their usage can be scoped(data/elements/events) for specific players.

Best is to get inspiration from an already existing Multi Game Mode resource. Since this is really a lot of work and complexity. Explaining the process from A to B would take too much of my time (sorry).

yeah, i got it, but the problem is if i want to load some resources for specific players -as a gamemod- everytime when the player join the gamemod the resources restarting and even the server side resources.

Link to comment

Resources do not run "for specific players". Each resource runs for all players and on both server and the client. Nothing to start/stop/restart on player join - you do it when starting up the server, just like with ordinary gamemodes.

It's just that the gamemodes have to be modified so that instead of doing stuff on the global level, they would do it in their own scopes. For example, if the gamemode executes some code in onPlayerJoin event, you have to modify it to execute that code when the player enters that gamemode instead. Likewise, if the gamemode does something in onPlayerQuit, it has to be done when the player leaves the gamemode - which could be when the player quits, or when they switch to a different gamemode. If the gamemode calls getElementsByType to retrieve all elements of a particular type in the server, it has to pick out its own elements only, to avoid acting on another gamemode's elements.

Link to comment
9 hours ago, FlorinSzasz said:

u can make a big gamemode with more minigames or split the gamemodes in dimensions one gamemode is in dimension 0 and another one is in 1 or 2 or etc u got my point i think.

 

 

18 hours ago, DiSaMe said:

Resources do not run "for specific players". Each resource runs for all players and on both server and the client. Nothing to start/stop/restart on player join - you do it when starting up the server, just like with ordinary gamemodes.

It's just that the gamemodes have to be modified so that instead of doing stuff on the global level, they would do it in their own scopes. For example, if the gamemode executes some code in onPlayerJoin event, you have to modify it to execute that code when the player enters that gamemode instead. Likewise, if the gamemode does something in onPlayerQuit, it has to be done when the player leaves the gamemode - which could be when the player quits, or when they switch to a different gamemode. If the gamemode calls getElementsByType to retrieve all elements of a particular type in the server, it has to pick out its own elements only, to avoid acting on another gamemode's elements.

thanks both of you gave me good ideas

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...