News UnrealEd Files Mods FragBU Liandri Archives
BeyondUnreal Forums

Go Back   BeyondUnreal Forums > Unreal Development > Coding

Reply
 
Thread Tools Display Modes
Old 21st Sep 2003, 01:22 PM   #1
SuperDre
Registered User
 
SuperDre's Avatar
 
Join Date: May. 6th, 2002
Location: Helmond.nl
Posts: 254
Accessing Engine.GameEngine?

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)..
SuperDre is offline   Reply With Quote
Old 21st Sep 2003, 01:58 PM   #2
Daid303
MSPA
 
Join Date: Aug. 7th, 2002
Location: The Netherlands (yes, that's Holland)
Posts: 246
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.
Daid303 is offline   Reply With Quote
Old 22nd Sep 2003, 02:24 AM   #3
SuperDre
Registered User
 
SuperDre's Avatar
 
Join Date: May. 6th, 2002
Location: Helmond.nl
Posts: 254
Quote:
Originally Posted by Daid303
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.
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
SuperDre is offline   Reply With Quote
Old 22nd Sep 2003, 04:19 AM   #4
Wormbo
 
Wormbo's Avatar
 
Join Date: Jun. 4th, 2001
Location: Germany
Posts: 5,687
Quote:
Originally Posted by SuperDre
Code:
ge = Gameengine(Findobject('Package.GameEngine'), class'GameEngine');
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'));
__________________
Wormbo's UT/UT2004/UT3 mods | YouTube channel | PlanetJailbreak/JDN | Unreal Wiki | Liandri Archives
Everything you ever wanted to know about replication| UnrealScript security considerations
<elmuerte> you shouldn't do all-nighters, it's a waste of time and effort
<TNSe> nono
<TNSe> its always funny to find code a week later you dont even remember writing
<Pfhoenix> what's worse is when you have a Star Wars moment
<Pfhoenix> "Luke! I am your code!" "No! Impossible! It can't be!"
Wormbo is offline   Reply With Quote
Old 22nd Sep 2003, 04:32 AM   #5
Daid303
MSPA
 
Join Date: Aug. 7th, 2002
Location: The Netherlands (yes, that's Holland)
Posts: 246
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();
	}
Daid303 is offline   Reply With Quote
Old 22nd Sep 2003, 05:10 AM   #6
SuperDre
Registered User
 
SuperDre's Avatar
 
Join Date: May. 6th, 2002
Location: Helmond.nl
Posts: 254
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..
SuperDre is offline   Reply With Quote
Old 22nd Sep 2003, 05:12 AM   #7
SuperDre
Registered User
 
SuperDre's Avatar
 
Join Date: May. 6th, 2002
Location: Helmond.nl
Posts: 254
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..
SuperDre is offline   Reply With Quote
Old 22nd Sep 2003, 05:56 AM   #8
elmuerte
Master of Science
 
elmuerte's Avatar
 
Join Date: Jan. 25th, 2000
Location: the Netherlands
Posts: 1,935
ConnectingClass is hardcoded, like a **** load of other stuff
elmuerte is offline   Reply With Quote
Old 22nd Sep 2003, 05:11 PM   #9
SuperDre
Registered User
 
SuperDre's Avatar
 
Join Date: May. 6th, 2002
Location: Helmond.nl
Posts: 254
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 by SuperDre; 22nd Sep 2003 at 05:14 PM.
SuperDre is offline   Reply With Quote
Old 22nd Sep 2003, 07:39 PM   #10
Wormbo
 
Wormbo's Avatar
 
Join Date: Jun. 4th, 2001
Location: Germany
Posts: 5,687
Quote:
Originally Posted by SuperDre
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..
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.
__________________
Wormbo's UT/UT2004/UT3 mods | YouTube channel | PlanetJailbreak/JDN | Unreal Wiki | Liandri Archives
Everything you ever wanted to know about replication| UnrealScript security considerations
<elmuerte> you shouldn't do all-nighters, it's a waste of time and effort
<TNSe> nono
<TNSe> its always funny to find code a week later you dont even remember writing
<Pfhoenix> what's worse is when you have a Star Wars moment
<Pfhoenix> "Luke! I am your code!" "No! Impossible! It can't be!"
Wormbo is offline   Reply With Quote
Old 23rd Sep 2003, 02:33 AM   #11
SuperDre
Registered User
 
SuperDre's Avatar
 
Join Date: May. 6th, 2002
Location: Helmond.nl
Posts: 254
Quote:
Originally Posted by Wormbo
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.
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?
SuperDre is offline   Reply With Quote
Old 23rd Sep 2003, 02:48 AM   #12
Wormbo
 
Wormbo's Avatar
 
Join Date: Jun. 4th, 2001
Location: Germany
Posts: 5,687
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.
__________________
Wormbo's UT/UT2004/UT3 mods | YouTube channel | PlanetJailbreak/JDN | Unreal Wiki | Liandri Archives
Everything you ever wanted to know about replication| UnrealScript security considerations
<elmuerte> you shouldn't do all-nighters, it's a waste of time and effort
<TNSe> nono
<TNSe> its always funny to find code a week later you dont even remember writing
<Pfhoenix> what's worse is when you have a Star Wars moment
<Pfhoenix> "Luke! I am your code!" "No! Impossible! It can't be!"
Wormbo is offline   Reply With Quote
Old 23rd Sep 2003, 04:01 AM   #13
SuperDre
Registered User
 
SuperDre's Avatar
 
Join Date: May. 6th, 2002
Location: Helmond.nl
Posts: 254
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.
SuperDre is offline   Reply With Quote
Old 23rd Sep 2003, 04:17 AM   #14
Wormbo
 
Wormbo's Avatar
 
Join Date: Jun. 4th, 2001
Location: Germany
Posts: 5,687
Most information are accessible through LevelInfo, GameInfo or GameReplicationInfo.
TRy to find out where the F2 server info gets its details from.
__________________
Wormbo's UT/UT2004/UT3 mods | YouTube channel | PlanetJailbreak/JDN | Unreal Wiki | Liandri Archives
Everything you ever wanted to know about replication| UnrealScript security considerations
<elmuerte> you shouldn't do all-nighters, it's a waste of time and effort
<TNSe> nono
<TNSe> its always funny to find code a week later you dont even remember writing
<Pfhoenix> what's worse is when you have a Star Wars moment
<Pfhoenix> "Luke! I am your code!" "No! Impossible! It can't be!"
Wormbo is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -5. The time now is 11:16 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.

Copyright ©1998 - 2012, BeyondUnreal, Inc.
Privacy Policy | Terms of Use
Bandwidth provided by AtomicGamer