h1k3's Recent Forum Activity

  • New Version 0.2

    Tried to organize the actions and conditions to make a little more sense.

    New expressions:

    StoryFeedPostID - Will equal "Post was published." if last Story post was succesful. Otherwise will equal "Post was not published.". This will change in the near future to be either the postid on success or error message.

    UserPicture- String returning the true url for the user profile picture. Not the graph.facebook.com version.

    New Action:

    Post Story - Post story to users wall or friends wall if you have friends ID.

  • Yes, correct! it should fix when the users were already logged in FB before the game launches if login again is not needed.

    Joannesalfa start the game off with the other three triggers to determine the actual state before determining what to do. For example on verified is where you would switch layouts or activate a logged in specific group on the event sheet. On logged in but not verified would be great to to login action or display game info and post a login button. The Facebook logged out trigger would be great if you want to display a non Facebook login option and a Facebook login button or give info about the game and display a login button or just simply fire the login action. It gives you much more ability at startup to determine what state they are in Facebook so you can display the appropriate info or activate the right actions/layouts. The logged in condition is just useful as you said for posting feed information.

  • New version 0.19 is up.

    New change this release is a new condition:

    "User Is Logged" In Will always be true if user has installed your app and is logged into facebook. Inverted will be true for users who are logged out of Facebook and/or have not yet verified your app.

    Up next scores dialog and additional user data expressions.

    Joannesalfa this is what you wanted right?

    Trust me, Is in logged in it shouldn't be a trigger event. It will break the share "variable" to wall when an user is already logged in FB externally before the game launches.

  • I do realize there is some cleaning up to do. Such as removing those multiple calls to facebooklogout..... But I don't see how that would be making the currentstatus variable both true and false at the same time. Anyone?

  • I've got a condition for is logged in but every 5 seconds(When I call the action) it literally cycles through both true and inverted references.I'm completely stumped as to why this problem is occuring. Can someone please help me figure out what exactly I'm doing wrong here? I have a condition in the edittime as such:

    AddCondition(6,     0, "Is user logged in", "Login/Logout", "Is user logged in", "True if currently being viewed inside Facebook by a logged in user.", "IsLoggedIn");

    The condition in runtime is this:

    Cnds.prototype.IsLoggedIn = function ()

         {

              if(currentstatus == "Validated User"){return true;}

              else if(currentstatus == "Logged In No Install"){return false;}

              else if(currentstatus == "Not On Facebook"){return false;}

              else return false;

         };

    The declaration for currentstatus is at the very top:

    // ECMAScript 5 strict mode

    "use strict";

    assert2(cr, "cr namespace not created");

    assert2(cr.plugins_, "cr.plugins_ not created");

    var currentstatus = "unknown";

    The changing point for this currently is run from two spots, one is under the FB init function, and the second is a called action. Both are identical copies of each other. And here it is:

    FB.getLoginStatus(function(response) {

         if (response["status"] == 'connected') {

          // the user is logged in and has authenticated your

          // app, and response.authResponse supplies

          // the user's ID, a valid access token, a signed

          // request, and the time the access token

          // and signed request each expire

          fbStatus = "Validated User";

          fblogoutcheck = true;

           fbUserID = response["authResponse"]["userID"];

           UserAccessToken = response["authResponse"]["accessToken"];

           UserAccessTokenExpiresIn = response["authResponse"]["expiresIn"];

           UserSignedRequest = response["authResponse"]["signedRequest"];

           if(currentstatus != "Validated User"){currentstatus = "Validated User";fblogoutcheck = true;fbRuntime.trigger(cr.plugins_.FBComplete.prototype.cnds.OnLoggedIn, fbInst);}       

          fbRuntime.trigger(cr.plugins_.FBComplete.prototype.cnds.OnLoggedIn, fbInst);

          fbRuntime.trigger(cr.plugins_.FBComplete.prototype.cnds.OnAPILoaded, fbInst);

          }

          else if (response["status"] == 'not_authorized') {

         fblogoutcheck = false;

           fbStatus = "Logged In No Install";

           fbUserID = 0;

           UserAccessToken = "";

           UserAccessTokenExpiresIn = 0;

           UserSignedRequest = "";

           if(currentstatus != "Logged In No Install"){currentstatus = "Logged In No Install";fblogoutcheck = false;fbRuntime.trigger(cr.plugins_.FBComplete.prototype.cnds.OnNotInstalled, fbInst);}

           fbRuntime.trigger(cr.plugins_.FBComplete.prototype.cnds.OnNotInstalled, fbInst);

           fbRuntime.trigger(cr.plugins_.FBComplete.prototype.cnds.OnAPILoaded, fbInst);

           // the user is logged in to Facebook,

           // but has not authenticated your app

          } else if (response["status"] == 'unknown') {

         fbStatus = "Not On Facebook";

         fblogoutcheck = false;

         fbUserID = 0;

           UserAccessToken = "";

           UserAccessTokenExpiresIn = 0;

           UserSignedRequest = "";

           if(currentstatus != "Not On Facebook"){currentstatus = "Not On Facebook";fblogoutcheck = false;fbRuntime.trigger(cr.plugins_.FBComplete.prototype.cnds.OnFacebookOut, fbInst);}

           fbRuntime.trigger(cr.plugins_.FBComplete.prototype.cnds.OnFacebookOut, fbInst);

           fbRuntime.trigger(cr.plugins_.FBComplete.prototype.cnds.OnAPILoaded, fbInst);

        // the user isn't logged in to Facebook.

    }

    }, true);

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • That seems like a waste of processor using every tick. Do something like is explosion onscreen trigger once move to top.

  • Have you tested this plugin so far Joannesalfa

  • Joannesalfa ohhhhhhhhhhhh you mean before you fire a dialog you want a condition to verify login like

    Is player logged in

    On f key pressed

    Post message to wall

    Ill add that to tonight's upload.

  • Joannesalfa

    I just retread what you said. The event your looking for is there. On app user logged in is what your looking for. It fires once the user is "logged in"

  • The most important about event is "non-trigger; Is user logged in" it means you already logged in before the game starts, it won't work to share some stuff on wall.   

    Joannesalfa the three triggers on there will work to check for API load in the meantime but I am testing an update right now with API loaded and name available conditions. So it should be posted in a couple more hours.

  • New version 0.18:

    Includes three new trigger conditions:

    On App User Logged In: This will trigger whenever a user first accepts permissions(installs your app) or when their status changes to reflect this(user accepted permission on a different browser/machine) Note you need to use the update status action to fetch the users current status.

    On App Not Installed This will trigger whenever a user first removes/denies permissions(uninstalls/rejects your app permissions) or when their status changes to reflect this(user rejected/uninstalled permissions on a different browser/machine) Note you need to use the update status action to fetch the users current status.

    On Facebook Logged Out This will trigger whenever a user is not logged into Facebook in this specific browser window. Users can log out of other Browsers and this will not trigger until the user logs out of Facebook in the current window. Note you need to use the update status action to fetch the users current status.

  • Ashley,

    I'm working on rebuilding the facebook plugin and would gladly add an onfocus/unfocus condition. Can you point me to information on checking for focus or do you have an idea on what to add? I'm thinking it should be a trigger event so when it loses focus it fires the condition(onfocus). Is this in the browser plugin for me to look at by any chance?

    My plugin link

h1k3's avatar

h1k3

Member since 1 Apr, 2012

Twitter
h1k3 has 3 followers

Connect with h1k3

Trophy Case

  • 12-Year Club
  • x5
    Coach One of your tutorials has over 1,000 readers
  • Educator One of your tutorials has over 10,000 readers
  • Email Verified

Progress

15/44
How to earn trophies