Announcement

Collapse
No announcement yet.

Facebook Progress...

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • replied
    any issues with the latest version of udk?

    Leave a comment:


  • replied
    Hi, Showster, I found my local log:

    [0018.31] Warning: StaticLoadObject for Class Log LogGameEngine couldn't find object in memory!

    I'm sure that there was something missed in login's method!

    Leave a comment:


  • replied
    Hey guys, Thanks to you guys I have gotten very close to having facebook working with my app. Unfortunately, there is an issue. After the app pops me over to facebook to inform me of the authorization and ask permission, I hit ok, and it says "Safari Cannot open the page because the address is invalid." I'm not sure where I need to put what in order to get past this point. Any ideas? Thanks.

    Edit: After hitting ok, I am directed to https://m.facebook.com/dialogue/oauth?refid=0

    Perhaps there is something with refid being 0 that is the problem, that's all I can think of at this time.

    Leave a comment:


  • replied
    Yes, I put a variable into it for keeping between levels.

    The code likes this:
    Code:
    class LogGameEngine extends GameEngine;
    
    var MicroTransactionBase MicroTrans;
    
    DefaultProperties
    {
    }
    And then add the following to \UDK\Engine\Configs\Mobile\MobileEngine.ini:
    Code:
    [Engine.Engine]
    GameEngine=LOG.LogGameEngine
    LOG is my project name.

    Maybe I ought to try your Viewport method.

    Leave a comment:


  • replied
    I had that on my Ipod... using the Viewport method, I put some code in the class and it seemed to solve it...

    Did you put anything in your GameEngine class?

    Leave a comment:


  • replied
    Thanks login! Your method prevented my old crash, but created a new crash...

    It was successful on Mobile Previewer, crash happened on my iPod Touch 4G once I replaced "GameEngine" with my own GameEngine class in .ini file.

    The error message is:
    Code:
    UE3SYS:CRASH:
    Core/Inc/UnClass.h(1319):
    Assertion failed: Class ConstructObject called with a NULL class object
    Is something missed???

    Leave a comment:


  • replied
    Maybe login can share how he connected to the GameEngine class. Perhaps that will have less side effects.
    The GameEngine tweak is just for avoiding crash when reloading a map.

    Its actually really simple, you just need to inherit from GameEngine and add in the new class all the variables you need to keep even when transitioning between levels:

    Code:
    class IOS_GameEngine extends GameEngine;
    
    var MicroTransactionBase MicroTrans;
    
    DefaultProperties
    {
    }
    then make that class your default engine class. The initial reference to the GameEngine class is made on UDK\Engine\Configs\BaseEngine.ini
    But if you add the following to Configs\Mobile\Engine.ini it will work

    Code:
    [Engine.Engine]
    GameEngine=IOSShared.IOS_GameEngine
    BTW, IOSShared is the name of the project were the IOS_GameEngine class is created

    Thats all I did for having it work. During the Store inialization I did this:

    Code:
    function StartStore()
    {
    	local IOS_GameEngine mEngine;
    	mEngine = IOS_GameEngine(Class'Engine'.static.GetEngine());
    	if (mEngine==none) return;
    
    	if ( mEngine.MicroTrans == none)
    	{
    		mEngine.MicroTrans = class'PlatformInterfaceBase'.static.GetMicroTransactionInterface();
    	}
          .........
    }
    Thats an example for the in app purchases, but I guess that it can be adapted to the facebook singleton as well to avoid the crash.

    Leave a comment:


  • replied
    This is from my DefaultEngine.ini

    [Engine.PackagesToAlwaysCook]
    +Package=EnvyEntry
    +Package=Cloud2


    [Engine.StartupPackages]
    +Package=FX_HitEffects
    +Package=UDKFonts
    +Package=UTGame
    +Package=Cloud2 <- my .u file not .upk
    +Package=DinoUIAlwaysLoaded <- my .upk file for my viewportclient I had some images for transitions and stuff in there

    [Engine.PackagesToForceCookPerMap]
    .Map=UDKFrontEndMap
    .Package=UDKFrontEnd
    .Package=UI_FrontEnd_Art
    .Package=Cloud2

    I also made sure that stuff was in my UDKEngine.ini and checked all the others to make sure it had it as loading at startup.

    If it increases your file size that sucks do you have a .u * .upk that share the same name? It could be loading all of your assets by mistake perhaps.

    Maybe login can share how he connected to the GameEngine class. Perhaps that will have less side effects.

    All the best

    Greg

    Leave a comment:


  • replied
    i'm glad it worked for you
    I'm still trying the GameViewportClient way, can you explain what do you mean here exactly?

    and I had to add the code package to the Engine.StartupPackages section.
    i placed in that section the name of my game's folder inside my Src folder but i'm not sure it was like that, 'cause the facebook worked on my ipad but in the ipod crashed at startup.
    Also after setting that in the StartupPackages my game went from 400 MB to 200 MB and in the ipad is working so fast but with weird things happening, so i'm not sure if that's what you meant there.

    Leave a comment:


  • replied
    I love you Juan!, that did the trick working facebook huzzah!

    If anyone gets stuck with crashing facebook hopefully this thread has the answers for you If my work allows it I'll write a tutorial or something

    All the best folks

    Greg

    Leave a comment:


  • replied
    Hi Showster, thanks for sharing that code, i'll try it now, 'cause i tried the GameEngine aproach but couldn't get it to work.

    By the way, i think your problem is your plist, it looks wrong i think you're closing the tags wrong, here's how my plist looks like:

    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
    <plist version="1.0">
    	<dict>
    		<key>UIFileSharingEnabled</key>
    		<true />
    		<key>CFBundleIdentifier</key>
    		<string>com.YourCompany.GameNameNoSpaces</string>
    		<key>CFBundleName</key>
    		<string>MyUDKGame</string>
    		<key>CFBundleDisplayName</key>
    		<string>UDK Game</string>
    		<key>CFBundleURLTypes</key>
    		<array>
    			<dict>
    				<key>CFBundleURLSchemes</key>
    				<array>
    					<string>fbMYAPPID</string>
    				</array>
    			</dict>
    		</array>
    	</dict>
    </plist>

    Leave a comment:


  • replied
    That appears to have worked a treat Login!!!! I couldn't figure the GameEngine.uc way, so I used GameViewportClient and sub classed from that which works the same way as its not changed on level loaded. A note for anyone who wants to use this, you'll have to put your GameViewportClients name into all the inis and I had to add the code package to the Engine.StartupPackages section.

    Code:
    class CloudGameViewportClient extends GameViewportClient;
    /** Facebook Setup */
    var FacebookIntegration Facebook;
    
    var bool bIsFBAuthenticating;
    function SetupFacebook()
    {
    	// added facebook junk
    	Facebook = class'PlatformInterfaceBase'.static.GetFacebookIntegration();
    	Facebook.AddDelegate(FID_AuthorizationComplete, OnFBAuthComplete);
    	Facebook.AddDelegate(FID_FacebookRequestComplete, OnFBRequestComplete);
    	Facebook.AddDelegate(FID_WebRequestComplete, OnWebRequestComplete);
    }
    
    function OnFBAuthComplete(const out PlatformInterfaceDelegateResult Result)
    {
    `log("facebook auth'd"$Result.bSuccessful);
    bIsFBAuthenticating = false;
    }
    
    function OnFBRequestComplete(const out PlatformInterfaceDelegateResult Result)
    {
    }
    
    function OnWebRequestComplete(const out PlatformInterfaceDelegateResult Result)
    {
    }

    I linked the gameviewport stuff in the setupzones function on the player controller just because really... Again not sure if its a good idea but it works I've got some redundant code for authorisation that needs removing. I use the PostFacebook function via the console at the moment to post data on walls, it only works if I remove Epic's default authorisation code.

    Code:
    class CloudPC2 extends SimplePC;
    
    var bool facebookgregauthorized;
    var CloudGameViewportClient GVC;
    var bool bIsFBAuthenticating;
    
    simulated function PostBeginPlay()
    {
    	super.PostBeginPlay();
    }
    
    /**  */   
    function SetupZones()
    {
    	super.SetupZones();
    	GVC = CloudGameViewportClient(LocalPlayer(Player).ViewportClient);
    	GVC.SetupFacebook();
    }
    
    exec function postfacebook()
    {
    	local array<string>Params;
    	local array<string>Params2;
    
    	//if (!GVC.Facebook.IsAuthorized())
    	if (!GVC.Facebook.IsAuthorized())
    	//if (facebookgregauthorized == false)
    	{
    	GVC.Facebook.Authorize();
    	if (facebookgregauthorized == true)
    	{
    	Params.AddItem("scope"); Params.AddItem("email,publish_stream,publish_actions,read_stream");
    	Params.AddItem("client_id"); Params.AddItem("203395029739848");
    	Params.AddItem("redirect_uri"); Params.AddItem("http://www.google.com");
    	Params.AddItem("response_type"); Params.AddItem("token");
    	GVC.Facebook.FacebookDialog("oauth", Params);	
    	//facebookgregauthorized = true;
    	}
    	}
    	else
    	{
    	// post to wall
    	Params2.AddItem("message"); Params2.AddItem("Shouldn't see this");
    	Params2.AddItem("link"); Params2.AddItem("www.google.com");
    	Params2.AddItem("picture"); Params2.AddItem("http://yourkidsartsucks.com/wp-content/uploads/2011/10/Funny_Art_223.jpg");
    	Params2.AddItem("name"); Params2.AddItem("Yes, hotness");
    	Params2.AddItem("caption"); Params2.AddItem("This is an post");
    	Params2.AddItem("description"); Params2.AddItem("I'm playing with posting to wall from UE3. Enjoy this mightily.");
    	Params2.AddItem("to"); Params2.AddItem(GVC.Facebook.FriendsList[2].Id);
    	GVC.Facebook.FacebookDialog("feed", Params2);	
    	}
    }

    I still can't get it to authorize properly can do it manually but I'd love for it to work nicely like your experience Juan. I wander if its becuause of my .plist or something. I've modified the file located C:\UDK\UDK-2012-01\UDKGame\Build\iPhone\UDKGameOverrides.plist

    Heres mine

    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
    <plist version="1.0">
    	<dict>
    		<key>UIFileSharingEnabled</key>
    		<true />
    		<key>CFBundleIdentifier</key>
    		<string>com.YourCompany.GameNameNoSpaces</string>
    		<key>CFBundleName</key>
    		<string>MyUDKGame</string>
    		<key>CFBundleDisplayName</key>
    		<string>UDK Game</string>
    	</dict>	
    	<key>CFBundleURLTypes</key> 
    <array> 
        <dict> 
            <key>CFBundleURLSchemes</key> 
            <array> 
                <string>fbMYAPPID</string> 
            </array> 
        </dict> 
    </array> 
    </plist>
    The facebook app I made on the facebook developers website is just a generic created app it has no code in it really, did your work anything into yours Juan?

    Oh the only other settings I think I've played with is in the defaultengine.ini

    Again heres mine

    [FacebookIntegration]
    AppID=MYAPPID
    +Permissions=email
    +Permissions=read_stream
    +Permissions=publish_actions
    +Permissions=read_stream
    +Permissions=publish_stream


    This is a bit of a monster post apologies but hopefully some of it might help others or show that I'm doing some daft stuff

    Regards and gluck!

    Greg

    Leave a comment:


  • replied
    Oh that sounds very reasonable login, thanks for that tip, could you tell me how do I implement the GameEngine class? I mean where would I define it? I guess it's in some of the .ini files. If it does, doesn't give you any other problem when setting a different GameEngine class?

    Leave a comment:


  • replied
    I haven't added facebook to my game yet, but I did In App Purchases. When using the code provided on the cloudgame to set microtransactions to work, it crashes as well when switching into another map.

    I tracked the bug down, and found that there is a problem with the singletons provided. So that if you call this function

    MicroTrans = class'PlatformInterfaceBase'.static.GetMicroTransa ctionInterface();

    you get the microtrans singleton that should remain the same during the entire game, however if you close the map and open any other map and request for that singleton again, it crashes later on.

    To solve the issue I implemented my own GameEngine class and stored a reference into that singleton. As the GameEngine class is not destroyed when the maps gets switched then I don't have to ask for that singleton again and therefore the game no longer crashes when switching maps.

    I haven't tested facebook integration but I think the problem maybe resolved in a similar way.

    Hope it helps.

    Leave a comment:


  • replied
    wow yeah it looks like it's just taking any random thing in memory and crashes...

    So it's probably a bug?, who could confirm this?

    Leave a comment:

Working...
X