Modifying a list from another plugin

0 favourites
  • 3 posts
From the Asset Store
Template for scrollable list, fully documented in comment and video
  • I am developing a JWebsocket plugin that I intend to use for a multiplayer game.

    The plugin receives a list of users who are online.

    My aim is to take this list of users and put these users into a "constructs 2 list".

    Now i dont know how to set the elements of the list from within my plugin.

    here's what I want to do:

    Acts.prototype.PopulateUserList = function ()

         {

              this.userarray = [];

              if (!this.websocketClient)

                   return;

              console.log("Got user list into constructs runtime")

              

              

              this.userList = this.websocketClient.fetchUserList();

              for (var i=0;i<this.userList.length;i++)

              {

                   array.add(this.userList.uname);

              }

              

                     // Now I want to access the list which i have created

                     // and populate it with userarray

                     

                     // Basically something like this.runtime.list ?

         };

    Any suggestions or help is highly appreciated.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Ok let me simplify.

    From within one plugin, how can I get reference to another plugin object, and call one of its actions ?

    Also how do I pass parameters for that action ?

    Thanks

  • You should not do this, in principle. Simply expose the data from your plugin, and allow users to display it where they want via the event system.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)