Purzelkater

cat as cat can
Veteran
Joined
Feb 20, 2016
Messages
86
Reaction score
69
First Language
German
Primarily Uses

cbam.png


 


Tutorial - Part 1: Installation & Basics




With this tutorial I will give you some guides how CBAM can be used. Well, to be fair, English is not my native language so there may be some misspellings and most screenshots will be on German too. But don't worry, the plugin and the scripts are commented in English and the plugin game language can easily switched.
And if you have questions, feel free to ask and I will do my best to give you an answer.


Installation


Download the latest Plugin version from the Plugin Release forum.


The CBAM system comes with 3 files:

  • CBAM.js: The RPG Maker MV plugin
  • cbam.php: The server side companion script
  • cbamm.php: Notice the 2nd m, it stands for manager. So it's the CBAM Manager script


cbamm00.png

First open cbamm.php on a text editor and change username and password (line 42 and 43) as you like. This is just to protect the CBAM Manager a little bit. Default username is "Admin" without a password. Then you have to move the js plugin file to your projects js/plugin folder and both php files to your server.
Now you should create and initialize your database. Open cbamm.php on a browser, enter your username and password and after login select "Initialize database"! A new file named cbam.sqlite should be created.

cbamm01.png



Depending on your game (plugin) settings, your work with the server has done here.



Some tech-blabla...
To work, your server must have PHP 5.x installed. On my test system I have 5.6 installed, an unfinished version was running with PHP 5.4 too. SQlite3 and PHP PDO support for SQLite (pdo_sqlite) are necessary for the scripts to work out of the box.
Well, I'm using SQlite as database backend because of simplification. There is no need to setup a whole database server like MySQL. But if you like, it should be easy to do, because of using PDO.


Plugin Settings
Let's have a look at the plugin settings you can change on the RPG Maker MV plugin manager and CBAM Manager.

  • gameName: This is the unique identifier of your game. This can be the name of your game or any other labeling you want. All settings and data on the server are matched to this name. You can have several games at the same time managed by CBAM on your server but all this games must have an unique gameName here.
  • gameVersion: The game version must be an decimal number (0.9, 1.0, 1.1, etc.). This version is stored within the savegames on the database. So an older game (client) can't load a newer savegame. This is important to know.
  • gameLanguage: CBAM has a built-in translating function for game text like menu labels, welcome messages, etc. By default you can set the language to "EN" (English) or "DE" (German). If you want you can add new languages easily (I will eplain this in a tutorial later). Beside this, console and server logs and error messages are only on English.
  • url: This is the url where the plugin can find the cbam.php script. Please enter the fully qualified domain name but without a slash "/" and the script name on the end. So if your server address is www.mygameserver.com and you have stored cbam.php on folder rmmv there, just enter "http://www.mygameserver.com/rmmv".
  • allowCreate: This can be set to 1 (yes) or 0 (no) and it's only important if no settings for the game (see gameName property) are saved on the database. If an user starts a game with CBAM, it connects to the server to synchronize the settings. If there is no data on the database and allowCreate is set to 0, nobody can play the game. But if allowCreate is set to 1, the settings from the plugin will be stored for the game on the database and it's possible to join the game (depends on this settings).



IMPORTANT: The following settings are only relevant if no game data is stored on the database (server) and if allowCreate set to 1! This is because this settings will be overwritten with the values from the server database. This allows you (as the admin) to change settings on the fly without to recreate and distribute the whole game again.


° loginActorId: This is the id of the login and guest actor. This actor has a special function and should not be used as a normal player actor. The face image of this actor will be used on the login screen and the walking sprite for guests.
° maxUsers: Here you can set how many players can join the game simultaneously. If you have allowed player can register themselves this is also the max number of this players.
° partyMode: This setting is important for your game, because it determines who CBAM will manage your player actors and parties. I will explain this on separated tutorials (you can also look at the FAQ).
° afterNewEvent: I you want to execute a common event after a new game has started, you can enter the event number here. This is normaly done for party setup.
° afterLoadEvent: If you want to execute a common event after a player has joined an existing game (has loaded a savegame), you can enter the event number here. This is normaly done to display a welcome back message and switch to the players actor.
° beforeSaveEvent: If you want to... well, I think you know it. ^^ But this event is a little bit tricky because it will be executed only after saved the game on command menu, not on back to title autosave (because the map was closed then).
° allowRegister: You can set this to 1 (yes) or 0 (no). If set to yes, player can only be added on CBAM Manager by the admin. Otherwise a player would be reigstered automatically after entered a new login and password as long as new max user number hasn't exceeded.
° allowPassive: As described in the FAQ with CBAM only one player can be inside the game as the active part. If set this option to 0 (no) only this one person can join the game at the time. All other players must wait until this player has exit the game. If set to 1 (yes), player can login and join the game on passive mode. This means they can load the latest savegame and walk around but they can't save the game. Beside this, what passive player can do and what not is part of your game design.
° allowGuests: Do you want to share your game with others to look? If guests are allowed (set this to 1), every user can join your game without login. As a guest you will be a special actor on the game (see loginActorId). What guests can do and what not is part of your game design. This settings will only be used, if passive players are allowed too.
° allowResetGame: This is an admin only option. If set to 1 (yes), an admin can overwrite all server side settings with the default plugin settings. Be careful with this option.
° allowResetUser: This is an admin onlay option. If set to 1 (yes), an admin can kick the active player from the game. If the player had joined the game at this time, he will be changed to a passive player. This can be usefull if the game has crahed oder the player has quit the game window without exit to title menu.
° firstUserAdmin: This is only be used if the user list of the game on the server is empty. If set to 1 (yes) and allowRegister is set to 1, then the first player who logged in will become a game admin.
° saveOnEnd: This should be set to 1 (yes). If so, every time an active player goes back to title, the game will be saved automatically.
° homepage: Here you can set a link to a (game) homepage. This link can be choosen on the title menu.
° wbMessageActive: CBAM has a build-in welcome message function with default text. With this option you can replace this text by your own without to change the plugin. This is the welcome text for the active player.
° wbMessagePassive: CBAM has a build-in welcome message function with default text. With this option you can replace this text by your own without to change the plugin. This is the welcome text for the passive player.
° wbMessageGuestCBAM has a build-in welcome message function with default text. With this option you can replace this text by your own without to change the plugin. This is the welcome text for your guests.
° logLevel: Here you can set how many informations the plugin will write to the console. Allowed options are 0 (only script errors), 1 (error messages), 2 (error messages and warnings), 3 (error messages, warnings and server response messages) and 4 (give me all).
cbam_mv01.png





Script Commands
CBAM gives you some script commands you can use on your events or own plugins. Feel free to contact me if you need more functions.

  • CBAM.welcomeMessageShow()
    This will open a welcome back message, dependent on the players mode (active, passive, guest).
  • CBAM.gameMode()
    This will return you the current game mode (mainly 2 for passive and 3 for active).
  • CBAM.firstStart()
    If this function returns 1, this is a new started game, instead of a loaded savegame.
  • CBAM.guestActor()
    This returns the id of the guest actor (see loginActorId setting).
  • CBAM.userActor()
    This returns the id of the current player.
  • CBAM.userRole()
    This returns if the current player is a guest (0), a normal player (1) or an admin (99).
  • CBAM.userName()
    This returns the username (login name) of the current user.
  • CBAM.userPaty() or CBAM.userParty(actorId)
    This looking for the party of the given actor. If no actorId was specified the current player actor id is choosen.
    It will return the party id (if you are using HIME Party Manager) or 1, if the player is in the game party.
  • CBAM.serverResponse()
    With this you can get the last server response message, if you want.
  • CBAM.setLeader(partyId, actorId)
    With this function you can set an actor as the leader (first actor) of a party.
  • CBAM.saveGame() or CBAM.saveGame(true)
    You can use this function to save the current game on the database if you are the active player (will be checked before game save).
    If you set the optional parameter to true, you will use the quicksave slot instead of a normal savegame.
  • CBAM.loadGame() or CBAM.loadGame(true) or CBAM.loadGame(true/false,switch)
    You can use this function to load a saved game instantly. Without a parameter the latest normal savegame will be loaded. If the first optional parameter is set to true, the game will be loaded from the quicksave slot.
    As a second parameter you can set a game switch that will be set to true after the game was loaded. This can be used to activate an common event after a game was loaded at runtime.
  • CBAM.timerTick(seconds)
    This function can be used for an CBAM timer. In conjunction with the quicksave slot you can use this for auto-updates / auto-refresh.





Frequently Asked Questions
Q: Is this some kind of MMO?
A: Definitive no. Period. A basic feature of a MMO (or just online multiplayer) is, several player can join and play the game simultaneously. This ist not the intention for this plugin.


Q: What does "asynchronous multiplayer" mean?
A: This type of game can be described as a turn-based multiplayer gameplay between two or more players that can check in and play their turn when it's convenient. Similar to play-by-mail games and, more electronically, play-by-email or play-by-post forum games.
Typical examples are trading card games or tabletop/board games.
   
Q: How will "asynchronous multiplayer" work on CBAM?
A: With CBAM all players concerned on a game will share the same savegame. Every player who joins the game will load the same, latest saved game. Although several player can join the game and load the same savegame on the same time, only one of them has the ability the save the game too. Moreover every player can have it's own actor on the game.
Important: After the game was joined and the savegame was loaded, all players "play" their own game stand-alone. One player doesn't notice any others until the game was saved and new loaded.


Q: What's the matter with this party modes?
A: The simplest mode (0=none) is just a savegame sharing. On this mode, CBAM will not make any change on players party. However, it's the best way for a real multiplayer experience too. But later on that.
With the re-group mode (1) the player party will new sorted every time a player joins the game. The members of the party are the same but the players actor will become the leader (first person) of the party.
Only one actor (2) goes one step further and kicks all actors from the player party except the players one.


Q: Your where talking about a "real multiplayer experience"?
A: Yes, CBAM can highly benefits from the incredible HIME Party Manager. If you add this plugin to your project too, every player can have it's own player party. Every player can be on a different place on a different map but other players can see them there. And players can merge there parties too. CBAM can activate the current player actor party every time a player joins the game.


Q: Why cloud based?
A: Well, of course you could save a game and send it to the next player like on good old play-by-email games. But CBAM makes it easier. All savegames are stored on one server. Wherever you are you can play the game immediately (if you have an internect connection). And without server side storage keep the savegame up-to-date would be a pain, believe me.


Q: What's the difference between active, passive and guest mode?
A: Only one player can be an active player at the same time in the game. Not before this player has left the game (or the admin has taken this state) another player can join the game as an active player. Only the active player has the ability to save the game - even if you try to execute the save function, the server will check if you are realy the active player right now.
Beside the active player several other players can join the game at the same time but they are all passive players then. As a passive player they can't save a game and have lesser options on the ingame command menu. But as passive player you can move around the map as you like (by default).
A guest is a user who has joined the game without login. As guest has no access to the command menu (only back to title is an option) and of course a guest can't save a game. Like passive players there can be several guest on the game at the same time.
It's possible to disable passive player and/or guests.


Q: Who needs an admin?
A: By default an admin has some special rights on the game. As an admin you can kick the active player (e.g. if the game was crashed). If the player has joined the game at this time he becomes an passive player.
As an admin your are able to restart a game (overwrite the savegame with a new once) or rewrite the server settings of a game. Because the admin state can be checked on the game it can be used on game events too, if you like.


Q: What's about security?
A: We are talking about cheating here. Well, RPG Maker MV was not made to be a high securtiy multiplayer engine. And with some knowledge it's easy to get a whole bunch of information from a game. And I'm sure CBAM has security gaps as big as an aircraft carrier in this case. But like a game on a table with friends, I hope others will play fair.



Following Tutorials

  • Basic setups with party mode 0, 1 and 2: done
  • Use CBAM together with the incredible HIME Party Manager: done
  • How to use this quicksave thing : done
  • The Guide to the CBAM Manager
  • Expand the plugin
 
Last edited by a moderator:

Purzelkater

cat as cat can
Veteran
Joined
Feb 20, 2016
Messages
86
Reaction score
69
First Language
German
Primarily Uses

Tutorial - Part 2: Basic Setup with Party Mode #0






With this tutorial I will show you some basic functions of the CBAM plugin in conjunction with the CBAM Manager. All game screenshots are in German but I will give you the English translations and you can set the language of the plugin to EN on your game so you will see english messages at all.




As noted we will use CBAM with party mode 0. To be fair, without any additional events or plugins, CBAM on this mode is just like a cloud based savegame database. But I will use this to give you an overview how CBAM works. I suppose you have copied both php scripts onto your server and the plugin is in your project folder. The database should be initialized too.


As you can see on the following screenshot, we have created a normal map with a default player party.

map01.png



Then we will activate the plugin. It's important to set the right gameName (for this tutorial wie just use "Tutorial 2" - how ceative, I know) and partyMode. Also you have to set the url, gameVersion and all other parameters.

settings01.png




settings02.png



Let's have a look on our server. Open the cbamm.php script on your browser. After you have logged in, you can see there are no games yet. Don't be worry. We will let the game add to the database by itself. Just be safe you have set allowCreate to 1.

cbamm01.png



Now we start our game the first time. If the game is able to connect the server you will see the extended title menu and some additional information. On the bottom left you can see the gameName and current version of your game/client.

title01.png




Just a little translation of the new title menu:
Anmelden = Login
Gastzugang = Guest access
Optionen = Options
Impressum = Credits (this will open a given homepage link)
Beenden = Exit/Quit



If we go back to our server now, wie can see the game was added to the database. Yeah!

cbamm02.png




cbamm03.png



Let's look at the game settings. Wow, here you can see (nearly) all the the same settings you have seen on the plugin itself before. That's right, because we had needed this settings to setup our game on the database for the first time. After that, all this settings will be loaded from the database now.
Remember: From now on, all this settings will be loaded from the database, no matter what you have set onto your plugin.


But the advantage is you can change all this settings on the fly without to release a new game version.

cbamm04.png



After we have our game added on the server database we can make a login. Because we have allowed user can register themselves, a player can just enter an username and password and will be added as a new user to to game. So let's do it!

title02.png



title03.png

After we have choosen Anmelden (Login) on the title menu, the login window will popup. We have set actor #1 as login actor so we will see the face image of actor #1 on the login window too. Well, we irgnore this and enter our username. After we hit "OK" the next input window for the password will be shown.


Surprise! We are logged in on our game now. You can see this because on the bottom right and the title menu has changed. Instead of login and guest access wie see logout (Abmelden), admin menu (Admin) and continue (Fortsetzen) now.

title04.png



Do you remember, our game was newly added to the database and the user table should be empty. But after the first login was made, a new player was added to our game on the database. And as you could see on the title menu, this player was equipped with admin rights.

cbamm05.png





We make a little jump now and will join the game. As you have seen on the title menu, there is no new game button anymore. This is because only the admin can restart the game (this is, what "new game" means). So if a player hit continue a new game will be started if no savegame was on the database or just the last savegame would be loaded.
Okay, as said we have joined our game now - aaaaand... there is nothing special Even if we open the command menu, there has nothing changed too.

game01.png




game02.png





Now it's time to see how CBAM handles multiplayer by default.


So we open another game window and login as Mausi, as you can see on the bottom right again. Because mausi is a normal player, no admin menu was shown on the title screen.

title05.png




title06.png



If we look on our CBAM Manager again, we can see there are 2 players now and - that's important - Purzel is as active user in the game.

cbamm06.png



When Mausi joins the game at this time, she will be a passive player. So if Mausi opens the command menu she has very limited options (mostly she can quit the game back to the title menu).

game03.png



At the last step we will exit the game with Mausi and Purzel just by hitting back to title. If we look on our CBAM Manager savegame list, we will see, only Purzel has made a savegame (Purzel was the active player, as you know).

cbamm07.png





Okay, let's make a break at this point. On the next tutorial I will show you some improvements we can make with the other party modes.
 

Purzelkater

cat as cat can
Veteran
Joined
Feb 20, 2016
Messages
86
Reaction score
69
First Language
German
Primarily Uses

Tutorial - Part 3: Let's have a (one) Party






Okay, after the last tutorial we know how to setup a game with CBAM and see it on the CBAM Manager. But... well... this was a little bit unimpressive, I would say. Now we will expand our game so we can have some better multiplayer experience.



We will start with CBAM plugin settings. I have changed the game name to "Tutorial 3" so the database will hold all data (settings, savegames, player) additionally and separated from the last game on tutorial 2.
And we will change the party mode to 1 too. Now the loginActorId will become important too.

plugin01.png



After we have activated party mode 1 we will open the database and make some changes on the actors. Because we have set actor #1 as actor for login and guests, we change the face image (this will be shown on the login/password screen) and the walking animation. Because guest can walk around the map like ghots I have choosen an suitable one.
Important: Actor #1 will not be used for the players anymore. Even if you add this actor on the party.

actor01.png



I haven't made any additional changes on the party so if we look at the map we can see the ghost as player actor.

map01.png



Now we start the game and login. How this will work is described in tutorial 2. But as you can see, were are using the placeholder face image for the login screen now. Nice! ^^

title01.png





Some steps later...


As described in tutorial 2 I have added Purzel and Mausi as players for Tutorial 3. Do you remember on the game actor id shown on the database? Because actor #1 was reserved for guests, Purzel has gotten actor #2 and Mausi #3 automatically.


Now it's time to join the game with Purzel. As you can see, actor #1 was removed from the party (because it's only for guests) and now actor #2 is the first actor on the party. And if we open the command menu, we can verify Therese (actor #2) is the leader. So far so good.

map02.png




map03.png



Let's go back to the title screen and join the game with Mausi. Whoops, what's this? Yes, it's the same party as we know but Purzel's Therese is no longer on the first place. Right, because Mausi's actor is #3, Marsha. And if we open the command menu, we can see, CBAM has changed the party so Marsha is the leader now (as long as Mausi is as active player on the game).

map04.png




map05.png



Can we make a try and join the game as a guest? Oh sweet, now we are a little ghost. And if we open the command men... Which menu? Yes, there is no menu for guests but back to title.

map06.png




map07.png





Okay, this looks good. So let's make it to look better!



We will open the database and add a new common event. Just insert a script command:

CBAM.welcomeMessageShow();


event01.png



Then we go to our game settings on the CBAM Manager (do you remeber, settings will be loaded from the database right now) and change "After Load Event" to our common event number. Don't forget to save the changes!

cbamm01.png



That's all.



Now if we join the game with Purzel we will see a nice welcome back message with the right actor face.

map08.png



And because Purzel had joined the game first, Mausi will be a passive player if she joins the game. But she will see the her actor's face image too.

map09.png



As said, Mausi is in passive mode now and if she opens the command menu, she will only see her actor Marsha. This is because only the active player has access to the full party options.

map10.png



At the end we will join the game as a guest again to see if there is a welcome message too...

map11.png





As you have seen, with party mode 1 now we have some litte multiplayer experiences. With mode 1, the party will be re-grouped every time an active player joins the game. Passive player can see their actor and walk around the world, but they have no access to the other party members (by default).
But be careful: All players are on the same party and the active player has full access to all options there.


Party mode 2 is mostly the same but with one important change: Also the active player will only see (and has access to) his actor on the party. This could be a little bit creepy.



But there is a realy good solution, I think: The HIME Party Manager. So on the next tutorial I will use this plugin to make a real multiplayer game with multiple parties for multiple players. Stay tuned!
 

Purzelkater

cat as cat can
Veteran
Joined
Feb 20, 2016
Messages
86
Reaction score
69
First Language
German
Primarily Uses

Tutorial - Part 4: CBAM as it's best






Now we know how CBAM can handle multiple players. It was... well... okay. But at this tutorial I will show you how we can marke our game to become a real asynchronous multiplayer as I know it.


This is the point we need the HIME Party Manager by @Tsukihime


Okay, after the other tutorials you should know the basics now. So we can start with the plugin settings on the Plugin Manager, right?
As you can see I have added HIME_PartyManager plugin before the CBAM plugin. You can leave the Party Manager settings as default. The Default Party ID should be on 1.
On the CBAM plugin we leave loginActorId on 1 too and we choose partyMode 0. Sounds boring was we know after tutorial 2, but the difference will come with the afterNewEvent (1) and afterloadEvent (2). Remember the values you have set there!

plugin01.png




plugin02.png




plugin03.png




plugin04.png



On the next step we will go to the database and change our actors. Because we are using actor #1 for login and guests we can clear the actors name. For a nice looking login screen we have to choose a face image.
More important, set character walking animation to none!

database01.png



Then we go to the system tab on our database an change the default party. The party must fit with our settings on the plugins. So we clear all actors from the party and only add actor #1.

party01.png



If we look on our map now, we have just an empty starting actor event.

map01.png





Now we have to add some common events to make our game any special.


We open the database again and go to the common events. We had set afterNewEvent to 1 so we need event 0001 at first. This event will setup our parties and actors after a new game was startet. What do you want to do in this events can be very different so I only give here an example. The details you can see on the screenshot.
On the event I use HIME Party Manager script commands to create a party for every actor, add the actor(s) to the party and place them on the right map.
After all parties are made, I use the Party.switch script command with the CBAM.userParty function to activate the party of the current player.
The message box at the end ist just a little welcome message.

database02.png



Okay, with common event 0001 we can create our parties for the first time. Now we need an event to switch to the current players party after a player has joined the game. So we go to common event 0002 as we set on afterloadEvent.
Here we use our CBAM.setLeader script command to change the players party so the players actor becomes the leader of this party. This is if more than on player actor will be on the party.
The next script command you know from event 0001 - it will activate the current players party.
Then we will show a nice welcome back message.
As you know we had no walking animation set for actor #1 we need to change this if a guest has joined the game.
Because the guest actor will be moved to the active players location on save we have to move the guest actor to a safe place if a normal player has joined the game.

database03.png




actor01.png





That's all, now let's have a look on our game!


As you can see on the title screen, the name of the game you have set on the database has not to be the same you have set on the CBAM settings (you can see on the bottom left of the title screen).

title01.png



Now wo login as Purzel.

title02.png




title03.png




title04.png



Because it's our first start the continue command (Fortsetzen) will begin a new game - and our common event 0001 will be executed as you can see.

map02.png

Because we are using the Party Manager, we can have multiple parties now. So we can see Therese (Purzel's actor #2) and Marsha (Mausi's actor #3) on different places on the map at the same time. But of course only on of them can be active. So Marsha ist just an nice looking event as long as Purzel plays with Therese here.

map03.png




map04.png

As seen on the last screenshot Marsha hasn't move all the time but Therese is on another place now. We go back to the tile menu. This will store a savegame on the database.


Now we will join the game with Mausi. Because we have a savegame now, event 0002 will be executed after the game was loaded. So we switch over to actor #2 for Mausi and see a nice welcome message.

title05.png




map05.png

Do you remember we had added tow actors to party 3? So if Marsha walks around she has an follower on her party.

map06.png




map07.png



Okay, while Mausi walks around and visit map 2 - where actor #5 (party 4) is waiting - we join the game as Purzel the same time. Now Purzel will see his Therese can only be passive.

map08.png




map09.png





At this point it's important to understand what asynchronous multiplayer means: While both players are on the game at the same time, they play two different games, based on the same savegame at the beginning. Because of this, Purzel will see the same (old) map as Mausi has seen as she has joined the game. Then Mausi was walked around with Marsha to map 2. But because she hasn't made a save right now, Purzel will see Marsha on the latest saved location. Now Purzel can move around with Therese without to know what Marsha does. And Mausi doesn't know about Purzel too.
But because only Mausi as the active player can make a new savegame at this time this is no problem.

map10.png





At the end we will join our game as guest again. We see a welcome message too. But because guests actor #1 is no real used actor this actor will be moved to the last location of the active actor on every savegame. So if a guest will join the game he will be shown at the same position as the last active player.

map11.png




map12.png





I really hope you like what's possible with CBAM and the HIME Party Manager. On the next tutorial I will explain the quicksave game function and how you can use it.
 

Purzelkater

cat as cat can
Veteran
Joined
Feb 20, 2016
Messages
86
Reaction score
69
First Language
German
Primarily Uses

Tutorial - Part 5: Quicksave




CBAM comes with 2 tables for savegames.


The main table is "savegame". Every time, a game will be regular saved, a new entry will be added to this table. Added means as ist says: The table holds the current and all previous savegames too. So you are able to get an older savegame back. This will be done on command menu "save", on "back to title" (with SaveOnEnd set to 1) and on the CBAM.saveGame() script command by default.


But there is a second table namend "quicksave" on your database. In different to the normal savegame table this table holds only one - preferably the last - savegame. Every time a savegame will be added to the normal savegame table the quicksave table will be updated with this savegame too.



So why there are this second table then?
Well, because you can use the script command CBAM.saveGame(true) - look at the parameter "true" - to save the game only on the quicksave table.


Okay, understand... but why should I do this?
Because you could use this script command to save your game periodically or on special events. Let's say, you will use a timer to save the game every 5 minutes... as you know, games on the savegame table will be added, not overwritten. So after 1 hour you would seen 12 new savegames on your database. Let's lower the timer to 1 minute and you get 60 savegames per hour. Let's lower the timer from 1 minute to 10 seconds... well, you see the way, I thnik.
So this is the reason for the quicksave table. This table holds only the latest quicksave game - just as a snapshot.



If you want to load a game from the qucksave table now, you have to use the script command CBAM.loadGame(true). Without the "true" the latest regular savegame will be loaded. With "true" it's the game from the quicksave table.
But the loadGame command holds a 2nd parameter: You can add a switch number. This switch will be activated after the game was loaded with the loadGame script command. This can be used to activate an common event.



How can we use this quicksave thing on our games?
Well, my intention was to build some kind of auto-refresh. If an active player walks around the game, wouldn't it be nice, if guest could see this on "quasi" real-time? Because we are only using savegames this can not be a real real-time, as you know.


To do this, we need the active player saves the game periodically and guests load the periodically too.


I have added a now common event to the games database:

database01.png





The event will run parallel as long as switch 1 is on. There are several to execute the script commands periodically. You can use the wait event command to wait a number of frames or you can use the CBAM.timerTick script command. I have merged both of them but that's not necessary.
As you can see, if a guest runs the game, the loadGame command will be executed. But if an active player is on the game, saveGame will be used. Both commands are using the quicksave table (parameter "true").
To hold this event running after the game was loaded, we need to set switch 1 to on again. This will be done with the 2nd parameter "1" on the loadGame command.


Because CBAM will move the guest actor to the active player location every time a game will be saved, the guest will be moved on every load too.


Now we just have to activate switch 1 after a game was joined.


Here you can see how it will work on the game. As said, it's far from real-time and need a fast internet connection.

 

GamerNickk

Warper
Member
Joined
Jul 29, 2016
Messages
3
Reaction score
0
First Language
English
Primarily Uses
N/A
Really good plugin,


got everything to work.


Is this plugin still in development? And will there be registration soon?


Thanks in advance, Nick
 

boszalex

Junior Developer
Member
Joined
Dec 15, 2016
Messages
13
Reaction score
0
First Language
Tag-lish
Primarily Uses
Is it working until now?
 

Purzelkater

cat as cat can
Veteran
Joined
Feb 20, 2016
Messages
86
Reaction score
69
First Language
German
Primarily Uses
This is just a quick response about the state of CBAM plugin.


The last months I was very busy with work and I'm afraid this will not be changed the next months. So I had to stop my work with and for MV, sadly. I don't want to say, CBAM is dead, because I want to use it on my own game(s), but at the moment it's in hibernation. :(


I'm not sure, if CBAM is working with the current version of MV. I have gotten some messages about "unexpected token" from other users. So if anybody is using this plugin with the current version of MV I would be happy to know. :)


So far, kind regards


from Purzelkater
 

qryanjae

Warper
Member
Joined
Jan 30, 2017
Messages
1
Reaction score
0
First Language
tagalog
Primarily Uses
Hello sir, we are using your plugin right now and we experience the unexpected token. But after we change the webhost that supports php up to 7.0 it is working.
 

Zimas

Warper
Member
Joined
Oct 2, 2018
Messages
1
Reaction score
0
First Language
English
Primarily Uses
RMMV
Loved this plugin man, well done!
 
Last edited:
Joined
Jul 5, 2019
Messages
1
Reaction score
0
First Language
VN
Primarily Uses
RMMV
why [CBAM] <--snip--> see post below
 
Last edited by a moderator:

Kes

Veteran
Veteran
Joined
Aug 3, 2012
Messages
22,315
Reaction score
11,737
First Language
English
Primarily Uses
RMVXA
@nguyenbamanh111 This is an English language site and only English can be used in public posts. I have, therefore, removed the contents of your post. Please use the Edit button on your post and re-type your query. Use Google translate if your English is not good enough.
 

Latest Threads

Latest Posts

Latest Profile Posts

I am SO HYPED to share this trailer with everyone when its done. I almost want to tear up i had no idea how far i came along with Fallen Feather in these last 3 years.
how it looks from the top
Hike was successful guys! I made it to the top!
Add Film-like Visual Effects During Test-Play, Deploy Games with Electron | RPG Maker News #69

brain broken as soon as i figure out whats wrong with my game im taking a long nap

Forum statistics

Threads
112,184
Messages
1,066,440
Members
145,784
Latest member
lafa
Top