So I've created a really neat Multiplayer Function calling plugin that allows any player (host or peer) to call any function for every player at the same time with a single action call. It ties the officially supported plugins (Function/Multiplayer) together so you don't need to do anything other than add this plugin, create your functions as you normally do and then call them with this plugin instead of the Function plugin to enable calling it on multiple devices at the same time. This allows you to syncronize data with out having to associate objects or build your own method for encoding and decoding multiplayer messages. Just call a function and it happens on every device at the same time.
Example: When Player 1 calls "MoveLeft" on a key press he has the option to send that function call to everyone at the same time so they all call it at the same time and each players screen sees player 1 move left. Or when Player 1 scores a point the host can call a function to update it on everyones device. Simple!
Or in this example When a peer joins a room he calls a function spawn him self on everyones screen and then call a function on everyone elses devices for them to spawn them selves on his screen. 2 lines of code, 2 functions and all players are on the same screen.
Supports calling a function for
- Everyone but him self
- Host Only
- Him self only (Like a normal function)
- Direct To Peer
It has advanced function calling methods as well that allows for triggering a function only once until reset or persisting the function call on the other end until reset. (IE MoveLeft could execute an action that simulates move left from a behavior and is sent only once by the player while hes holding the key down but is continuously called on the other end every tick until you tell it to stop by taking your finger off the key) Provides precision control and reduces bandwidth requirements for smooth movement. I'm sure some of you have seen my multiplayer example capx that uses this theory (not this plugin) that I have posted on other threads that proves this.
It works flawlessly and set up is easy. Simply add the function and on start initialize it with the function.uid and multiplayer.uid and then set a multiplayer trigger for it. Thats it!! you can start calling functions at will from this point on.
HOWEVER Here is where I have a problem. Currently because both Function and Multiplayer are global objects their UID's dont show up as select-able expressions. I had to modify the existing plugins to add it (this is frowned upon and i cant release the plugin if it requires the user to do that). Before i can release this plugin i need a way getting the UID for global objects? I could have missed something but can't seem to find it anywhere and I have scoured the code and event action options with no luck in finding the Function/Multiplayer UID, but does any else know if this can achieved. If a method doesn't exists Ashley would you be willing to put the UID's as select-able expression for the Function and Multiplayer object so i can use them in the event sheet to init my plugin? I would really like to release to this plugin. Thank you