1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. Two Factor Authentication is now available on BeyondUnreal Forums. To configure it, visit your Profile and look for the "Two Step Verification" option on the left side. We can send codes via email (may be slower) or you can set up any TOTP Authenticator app on your phone (Authy, Google Authenticator, etc) to deliver codes. It is highly recommended that you configure this to keep your account safe.

Accessing Engine.GameEngine?

Discussion in 'Programming' started by SuperDre, Sep 21, 2003.

  1. SuperDre

    SuperDre New Member

    Joined:
    May 6, 2002
    Messages:
    254
    Likes Received:
    0
    I'm sorry to have to ask this, but how can I access things like GameEngine.LastURl and GameEngine.GPendingLevel

    And then next question.. LOL.. How/where can I see the PendingLevel or Level properties/methods? (cause I couldn't find them anywhere)..
     
  2. Daid303

    Daid303 MSPA

    Joined:
    Aug 7, 2002
    Messages:
    246
    Likes Received:
    0
    You can always try to find the GameEngine with Allobjects()

    As for those properties/methods, if it's about map switching, looking at one of the current map votes could be a nice idea.
     
  3. SuperDre

    SuperDre New Member

    Joined:
    May 6, 2002
    Messages:
    254
    Likes Received:
    0
    I tried setting it something like: (this is from the top of my head as I'm sitting at the office at the moment)
    Code:
       local GameEngine  ge;
    
       ge = Gameengine(Findobject('Package.GameEngine'), class'GameEngine');
       if(ge.GLever==none)
           Log("Ohno GLever is none");
    
    It was something like above.. Hmm.... Maybe I should try to replace 'Package' with 'Engine'... But then again, maybe I already did that..

    But I'll check out the latest map switching stuff
     
  4. Wormbo

    Wormbo Administrator Staff Member

    Joined:
    Jun 4, 2001
    Messages:
    5,910
    Likes Received:
    35
    The object's name is just "GameEngine" (double quotes because it must be a string variable, not a name variable) and you should check where your function call ends and the casting operator starts.

    Code:
    ge = GameEngine(FindObject("GameEngine", class'GameEngine'));
     
  5. Daid303

    Daid303 MSPA

    Joined:
    Aug 7, 2002
    Messages:
    246
    Likes Received:
    0
    I use this code in my main menu class to add serverpackages. Maybe it helps.
    It's from a main menu. (I'm not going to distubute my mod with it's own ini file because that seems to mess up on some systems)
    Code:
    	if (bFirstRun)
    	{
    //		LOG("First run, fixing up Serverpackages and stuff");
    		foreach AllObjects(class'GameEngine', gEngine)
    		{
    			bAddServerPackage1 = True;
    			bAddServerPackage2 = True;
    			for (i=0;i<gEngine.ServerPackages.Length;i++)
    			{
    				if (gEngine.ServerPackages[i] == "UMS_Code")
    					bAddServerPackage1 = False;
    				if (gEngine.ServerPackages[i] == "UMS_Mutators")
    					bAddServerPackage2 = False;
    			}
    			if (bAddServerPackage1)
    				gEngine.ServerPackages[gEngine.ServerPackages.Length] = "UMS_Code";
    			if (bAddServerPackage2)
    				gEngine.ServerPackages[gEngine.ServerPackages.Length] = "UMS_Mutators";
    			
    			gEngine.LoadingClass = "UMS_Code.UMS_GuiVignette";
    //			gEngine.ConnectingMenuClass = "" //Not even used? the default 'MenuConnecting' class can't even be found.
    			gEngine.DisconnectMenuClass = "UMS_Code.UMS_GuiNetworkStatusMsg";
    			gEngine.SaveConfig();
    		}
    		bFirstRun = False;
    		SaveConfig();
    	}
     
  6. SuperDre

    SuperDre New Member

    Joined:
    May 6, 2002
    Messages:
    254
    Likes Received:
    0
    Hmmm Daid303, you've got something there ;) as there normally is only 1 GameEngine this would also be a good solution..

    And @ Wormbo, thanx, I'll definitly will check out the code I'm really using at the moment, cause I think it's nicer coding to do it with the findobject way as there is only one GameEngine active..
     
  7. SuperDre

    SuperDre New Member

    Joined:
    May 6, 2002
    Messages:
    254
    Likes Received:
    0
    LOL @ daid303 about the ConnectingClass, I've found that out too, Searched the whole damn code, but couldn't find the Class Epic is refering too.. LOL..
     
  8. elmuerte

    elmuerte Master of Science

    Joined:
    Jan 25, 2000
    Messages:
    1,936
    Likes Received:
    0
    ConnectingClass is hardcoded, like a **** load of other stuff
     
  9. SuperDre

    SuperDre New Member

    Joined:
    May 6, 2002
    Messages:
    254
    Likes Received:
    0
    Hmmm,
    Code:
    FindObject("GameEngine", class'GameEngine')
    
    doesn't return anything, while
    Code:
    foreach AllObjects(class'GameEngine', ge)
    {
      Log("ge is none="$(ge==none));
    }
    
    Does work (ge==none)=False

    Weird as hell.

    But Now I have the ge, where can I find info on the Level object, since I can't find anything on UDN or wiki..
     
    Last edited: Sep 22, 2003
  10. Wormbo

    Wormbo Administrator Staff Member

    Joined:
    Jun 4, 2001
    Messages:
    5,910
    Likes Received:
    35
    Do you mean the Level object accessible through any actor's XLevel property or the LevelInfo actor accessible through any actor's Level property? You can find both through AllObjects, but note that there's always an entry level with its own Level and LevelInfo unless your code is executed on a dedicated server.
     
  11. SuperDre

    SuperDre New Member

    Joined:
    May 6, 2002
    Messages:
    254
    Likes Received:
    0
    No I was refering to the GLevel,GEntry properties which are of the Level object type and properties of the GameEngine object. But I can't find any information like what kind of properties/methods the level object has..

    And Any Idea why the findobject wouldn't work but the foreach method does?
     
  12. Wormbo

    Wormbo Administrator Staff Member

    Joined:
    Jun 4, 2001
    Messages:
    5,910
    Likes Received:
    35
    FindObject requires you to specify the exact object name nad that doesn't need to be "GameEngine" in your case. Try logging the GameEngine object you found in the ForEach loop.

    The Engine.Level class doesn't have any UnrealScript code, so you can only access the properties inherited from Object. It's the same with more useful classes like Engine.Input: You can propably use console commands to access certain properties, but you can't use UnrealScript.
     
  13. SuperDre

    SuperDre New Member

    Joined:
    May 6, 2002
    Messages:
    254
    Likes Received:
    0
    Damn, I hoped to use those for retrieving the current Server info.. Cause I want to show some extra server info when loading the map.. And I can't seem to find any other info on how to optain the current server.
     
  14. Wormbo

    Wormbo Administrator Staff Member

    Joined:
    Jun 4, 2001
    Messages:
    5,910
    Likes Received:
    35
    Most information are accessible through LevelInfo, GameInfo or GameReplicationInfo.
    TRy to find out where the F2 server info gets its details from.
     

Share This Page