|
Hyper.nl Unreal Services The forum of Hyper.nl Unreal Services and the semi-offical resource for Winged Unicorn's Unreal mods
|
View previous topic :: View next topic |
Author |
Message |
Hyper
Joined: 24 Jan 2004 Posts: 1227 Location: Middelburg, The Netherlands
|
Posted: Sat Nov 20, 2004 8:04 pm Post subject: [Enhanced] Unreal server browser lay-out |
|
|
My two projects Enhanced Unreal server browser and GoldGuardian have been updated. No big changes, only some fine-tuning to handle the new Unreal servers.
I also found a way to improve the lay-out of the browser with a small "exec" script. It's not very usable yet, because it only works if executed after the browser is opened. When you have idea's to improve this and/or change it permanently, feel free to post them here. Please note that client-side mutators possibly won't work to do this because they are not allowed on many Unreal servers :(
Screenshot original lay-out
UT-style lay-out
News message on frontpage
Download the enhanced Unreal server browser
The lay-out script _________________ Alter your reality...forever.
Hyper.nl Unreal Services
unreal://hypercoop.tk
Last edited by Hyper on Sat Nov 20, 2004 8:50 pm; edited 1 time in total |
|
Back to top |
|
|
TheEmperorStalwartUK
Joined: 11 Feb 2004 Posts: 261
|
Posted: Sat Nov 20, 2004 8:29 pm Post subject: |
|
|
Hyper the EUSB's archive is currupt ;)
PS What is "news message on frontpage"? _________________ StalwartUK |
|
Back to top |
|
|
Hyper
Joined: 24 Jan 2004 Posts: 1227 Location: Middelburg, The Netherlands
|
Posted: Sat Nov 20, 2004 8:37 pm Post subject: |
|
|
TheEmperorStalwartUK wrote: | Hyper the EUSB's archive is currupt ;)
|
Re-uploaded and verified
Quote: |
PS What is "news message on frontpage"?
|
The same message as this one but then on the frontpage. _________________ Alter your reality...forever.
Hyper.nl Unreal Services
unreal://hypercoop.tk |
|
Back to top |
|
|
TheEmperorStalwartUK
Joined: 11 Feb 2004 Posts: 261
|
Posted: Sat Nov 20, 2004 8:43 pm Post subject: |
|
|
Hyper wrote: | Re-uploaded and verified. |
Good, i've downloaded it :)
Hyper wrote: | The same message as this one but then on the frontpage. |
Oh thought it was something to do with Microsoft FrontPage _________________ StalwartUK |
|
Back to top |
|
|
Zombie
Joined: 27 Jan 2004 Posts: 295
|
Posted: Sat Nov 20, 2004 10:15 pm Post subject: |
|
|
You should be able to load a mutator on the client running process, but I've never done anything like that before. Basicaly a mutator that enter's those 2 commands might do the trick. You'd probably have to put the "?Mutator=" entry on the client startup process similar to that of a server's.
Unreal.exe Unreal.unr?Mutator=?EUSBMute.EUSBMutator
The mutator would probably only work one time before you joined your first server, but that wouldn't matter since the browser classes normaly don't refresh unless you joined a server that totaly replaces your console objects.
-Zombie |
|
Back to top |
|
|
Oblivion[CW]
Joined: 28 Jan 2004 Posts: 59 Location: Chizra, Nali Village, Na Pali
|
Posted: Sun Nov 21, 2004 12:55 am Post subject: |
|
|
Updated my site. |
|
Back to top |
|
|
Hyper
Joined: 24 Jan 2004 Posts: 1227 Location: Middelburg, The Netherlands
|
Posted: Sat Nov 27, 2004 12:07 am Post subject: |
|
|
Zombie wrote: | You should be able to load a mutator on the client running process, but I've never done anything like that before. Basicaly a mutator that enter's those 2 commands might do the trick. You'd probably have to put the "?Mutator=" entry on the client startup process similar to that of a server's.
Unreal.exe Unreal.unr?Mutator=?EUSBMute.EUSBMutator
The mutator would probably only work one time before you joined your first server, but that wouldn't matter since the browser classes normaly don't refresh unless you joined a server that totaly replaces your console objects.
-Zombie |
Okay, don't laugh, I did a try:
First I describe what I think the mutator should to do:
1. It waits for an UWindowTabControl to load in memory.
2. It changes the broperty bMultiLine=False from the UWindowTabControl to bMultiLine=True
3. The mutator destroys itself but leaves the setting to true. (To avoid trouble with HackBusta / UProtect etc.)
I looked at a number of example mutators, and found this one which might be useful because it also changes a few settings of a class.
Unfortunately, my (absolute) lack of programming/uscript knowledge let's me strand here:
Code: |
class EUBrowser extends Mutator;
var bool bNewMultiLineSetting;
Function ModifyUWindowTabControl(UWindowTabControl other)
{
Local SomeObject myUWindowTabControl;
myUWindowTabControl = UWindowTabControl(other);
if (myUWindowTabControl != None)
{
myUWindowTabControl.bMultiLine = bNewMultiLineSetting;
}
}
defaultproperties
{
bNewMultiLineSetting=True
}
|
What should I use instead of "SomeObject"? I used "UWindowTabControl" in the first try, because it's the UWindowTabControl that needs to be changed. But when I do that, the compiler gives me an error:
Quote: |
E:\Unreal\EUBrowser\Classes\EUBrowser.uc(10) : Error, Cast from 'UWindowTabContr
ol' to 'UWindowTabControl' is unnecessary
Failed due to errors.
History: CompileError <- TryCompile <- FScriptCompiler::CompileScript <- (Class
EUBrowser.EUBrowser, Pass 1, Line 10) <- CompileScripts <- CompileScripts <- Com
pileScripts <- CompileScripts <- CompileScripts <- DoScripts <- UEditorEngine::M
akeScripts <- UMakeCommandlet::Main
Exiting due to error
|
Is there a programmer here who knows how to get this variable changed automatically? _________________ Alter your reality...forever.
Hyper.nl Unreal Services
unreal://hypercoop.tk |
|
Back to top |
|
|
Zombie
Joined: 27 Jan 2004 Posts: 295
|
Posted: Sat Nov 27, 2004 5:01 am Post subject: |
|
|
What will call the function you wrote? Otherwise the statements within the function will never be executed. At lot of the casting and referencing you're trying to do would just turn up as 'None' since you're trying to use the parameter 'Other' which doesn't seem to be setup from anywhere else. Although least you got some basic script structure. :)
I went ahead and wrote a mutator for you that should do the job. A compiled package and the UC sourcecode is included. Feel free to change the scripted log lines in the sourcecode to better fit what you want as well as the package/class names.
EUSBMute.zip
Command-line: Unreal.exe Unreal.unr?Mutator=EUSBMute.EUSBMutator
It will produce about 6 Accessed None ScriptWarnings because of a step required to setup the browser changes. It's still fine though however. I'll also remind you that the second "bmultiline" command probably will not work on classic clients. There seems to be no variable to set in the specific tabcontrol class in classic versions so it has no effect.
As for understanding the UScript sourcecode included, here is a breakdown of it. Ignore the Destroy function for now since it's not important to focus on. The main process all occurs within 'auto state InitEUSB'. When all beginplay events are finished being called the next step after gameplay already begins is going to a specified auto state. When the mutator automicaly hops to this state it will check both BeginState() function and the Begin label to execute the code specified with it. In this case the Begin label is used to set the timer within the current state with a call of SetTimer(0.1, False);. This means the timer will call the Timer function 100 miliseconds after entering the InitEUSB state and execute it only one time. Now take a look at how I searched and found the local client player (yourself) in order to grab the console. You'll see why the console needs to be accessed below. It will loop (for loop) thru all the level's pawns at gamestart until it finds a playerpawn (should only be you since this is client-side ran). Once it finds a valid spawned playerpawn that isn't None, it will then check if it's player controlled AND if it's console is not None. Afterwards with some typecasting it will then make the player's console create a root window so that the server browser window is also created with it (follow the UWindow processes to see why). Following the root creation, it will then make the authoritive machine running the mutator (you the client player) execute the 2 console commands needed to alter the browser window display. By now all that was needed to be done is done so it breaks the loop and the function 'Destroy()' is called outside the loop following it that removes the mutator.
Best Wiki references in my opinion on learning a lot of UScript:
Chain of events at Level Startup: http://wiki.beyondunreal.com/wiki/Chain_Of_Events_At_Level_Startup
Classes: http://wiki.beyondunreal.com/wiki?action=browse&id=Class_Syntax&oldid=Class
Variable Syntax (declaring variables): http://wiki.beyondunreal.com/wiki/Variable_Syntax
Function Syntax (different types of functions): http://wiki.beyondunreal.com/wiki/Function_Syntax
Variable Types (int, bool, float, vector, rotator, byte, string, name, etc.): http://wiki.beyondunreal.com/wiki/Variable_Type
Flow syntax (such as FOR loops, DO While, switch statements, if/else statements, etc.): http://wiki.beyondunreal.com/wiki/Flow_Syntax
Actor functions (such as ConsoleCommand, SetTimer, PreBeginPlay, PostBeginPlay, etc.): http://wiki.beyondunreal.com/wiki/Actor_(UT)/Functions
Global functions (very useful information on using important functions): http://wiki.beyondunreal.com/wiki/Global_Function
Iterators (learn about iterator functions and there usage): http://wiki.beyondunreal.com/wiki/Iterator
States (stuff about 'auto'): http://wiki.beyondunreal.com/wiki/State
Replication (LOTS to read about this, takes time for most to grasp): http://wiki.beyondunreal.com/wiki/Replication
Typecasting (how to access variables on specific classes): http://wiki.beyondunreal.com/wiki/Typecasting
Code Optimization (doing things right!): http://wiki.beyondunreal.com/wiki/Code_Optimization
Compiler Errors (descriptions and solutions to many types of errors): http://wiki.beyondunreal.com/wiki/Compiler_Errors
This is here for the sake of the Enhanced Server Browser stuff>>
WindowConsole: http://wiki.beyondunreal.com/wiki/WindowConsole
The rest can be looked up on your own, like the stuff in specific classes such as GameInfo, Mutator, Inventory, Pawn, PlayerPawn, ScriptedPawn and so on.
-Zombie |
|
Back to top |
|
|
Hyper
Joined: 24 Jan 2004 Posts: 1227 Location: Middelburg, The Netherlands
|
Posted: Sat Nov 27, 2004 2:28 pm Post subject: |
|
|
Thanks for your time.
Well, it looks it's a bit more complicated than I originally thought. (I might have known. )
But anyways, I can confirm that Unreal 226f does not have the bMultiLine option. It gives a 'unrecognised property' error. I used theUnrealScript Documentation to find that value, but it seems to be based on Unreal Gold (UPak is there too)
I tried your mutator in Unreal Gold but it does not work yet. I think the problem is that the commands are executed too early:
Code: |
if (PlayerPawn(P).Player != None && PlayerPawn(P).Player.Console != None)
|
There is no check to see if the class UWindowTabControl is loaded. Maybe the commands are executed at the time the player is there or when the player opens the console. For what I tried with the console commands, it only works when the Unreal server browser is opened.
Addition: I added some log output like above, to see if and when the commands get executed:
Code: |
if (PlayerPawn(P).Player != None && PlayerPawn(P).Player.Console != None)
{
WindowConsole(PlayerPawn(P).Player.Console).CreateRootWindow(None);
ConsoleCommand("set ubrowser.ubrowsermainwindow windowtitle Enhanced Unreal Server Browser");
ConsoleCommand("set ubrowser.UWindowTabControl bmultiline true");
log("----------------------------------------------------------------------------------",'EUSB');
log(" Commands are executing...",'EUSB');
log("----------------------------------------------------------------------------------",'EUSB');
break;
}
|
This gives the following output:
Quote: |
EUSB: ----------------------------------------------------------------------------------
EUSB: Enhanced Unreal Server Browser Initiated...
EUSB: EUSB by Hyper.nl -- Website: www.hypercoop.tk
EUSB: ----------------------------------------------------------------------------------
ScriptLog: Creating root window: UMenu.UMenuRootWindow
Log: Loading: Package UWindowFonts
EUSB: ----------------------------------------------------------------------------------
EUSB: Commands are executing...
EUSB: ----------------------------------------------------------------------------------
|
This means that the commands get executed before the Unreal server browser is loaded. (It gets executed directly after start.) _________________ Alter your reality...forever.
Hyper.nl Unreal Services
unreal://hypercoop.tk |
|
Back to top |
|
|
Zombie
Joined: 27 Jan 2004 Posts: 295
|
Posted: Sat Nov 27, 2004 7:02 pm Post subject: |
|
|
Odd...I tested the mutator earlier and it seemed to work fine for me, but this was in v226f. It immediatly created the root at startup and when I opened the browser window it showed "Enhanced Unreal Server Browser" in the title bar. That whole step of creating the root window is supposed also create the UWindowTabControl in time for the following console commands to work. You can test to see if the title bar works for you at least in v226f or v225f if you have them installed.
Looking at your logs it seems you have "UMenu.UMenuRootWindow" instead of "UWindow.UWindowRootWindow" created. That is probably why you have different results. According to the Gold UWindow sources SB gave me Gold users should still be creating the "UWindow.UWindowRootWindow" for the UPakConsole. Since I don't have a Gold version copy I can't directly test things out. I'll have to get back to this later, at the moment I have some things to do.
-Zombie |
|
Back to top |
|
|
Zombie
Joined: 27 Jan 2004 Posts: 295
|
Posted: Mon Nov 29, 2004 6:11 am Post subject: |
|
|
Yea, since players on Gold versions go thru different menuing system and use a different root window it will not create the UBrowserMainWindow immediatly. As far as I've looked Gold versions load the browser at UMenuMultiplayerMenu.LoadUBrowser function. When classic versions create the UBrowserRootWindow it will then also create the UBrowserMainWindow in the process and set it as a child to the root. You can go ahead and try your own experiements, specialy because you have a Gold version testbed.
One thing you could do is cut out all the script inside the Timer function and just leave the 2 commands behind. Then adjust the timer to SetTimer(1.0,True);. It will not work the first time the browser is created and opened, but when you re-open it all should be as you want it since the timer will constantly be performing the 2 commands.
-Zombie |
|
Back to top |
|
|
Hyper
Joined: 24 Jan 2004 Posts: 1227 Location: Middelburg, The Netherlands
|
Posted: Mon Nov 29, 2004 7:38 pm Post subject: |
|
|
Okay, this works. It keeps executing the commands every x seconds until Unreal connects to an online server. Then it nicely removes from memory so it does not conflict with anti-aimbot tools.
A problem is still that the first time the UBrowser is loaded it does not work, because opening the Unreal Gold menu stops the mutator from executing. When you close the ubrowser and the unreal gold menu, and re-open them it works.
Now my question is: Is there a command to open (and maybe close) the ubrowser? I learned UT has a "menucmd" command to squickly access items from the menu, but it does not work in gold.
The idea is to let the mutator open the browser (and eventually close and re-open it)
and then execute the console commands to set bmultiline to true.
Code: |
// EUSBMutator.
class EUSBMutator expands Mutator;
function Destroyed()
{
local Mutator M;
if (Level.Game.BaseMutator == Self){Level.Game.BaseMutator=NextMutator;}
else
{
for (M=Level.Game.BaseMutator; M!=None; M=M.NextMutator)
{
if (M.NextMutator == Self)
{
M.NextMutator=NextMutator;
break;
}
}
}
super.Destroyed();
}
auto state InitEUSB
{
simulated function Timer()
{
ConsoleCommand("set ubrowser.ubrowsermainwindow windowtitle Enhanced Unreal Server Browser");
ConsoleCommand("set ubrowser.UWindowTabControl bmultiline true");
log(" Executing commands",'EUSB');
}
Begin:
SetTimer(2.0, True);
log("----------------------------------------------------------------------------------",'EUSB');
log(" Enhanced Unreal Server Browser layout Initiated...",'EUSB');
log(" EUSB by Hyper.nl -- Website: www.hypercoop.tk",'EUSB');
log(" EUSB mutator by Zombie",'EUSB');
log("----------------------------------------------------------------------------------",'EUSB');
End:
}
defaultproperties
{
}
|
_________________ Alter your reality...forever.
Hyper.nl Unreal Services
unreal://hypercoop.tk |
|
Back to top |
|
|
Zombie
Joined: 27 Jan 2004 Posts: 295
|
Posted: Wed Dec 01, 2004 4:27 am Post subject: |
|
|
There is a command called "showubrowser" that will create and open the browser window, but the command only works correctly in the right client state. I don't think it's worth it to continue fooling around with automating it any further, specialy since this is all for 2 simple commands. However if you can see a good way to create the browser manualy at gamestart on Gold clients correctly so you can issue the commands then give it a try. If you want ...just try out some variations of creating the root window by changing the RootWindow variable from the player's console before creating the root. I'm not sure what would happen if a Gold client created UBrowserRootWindow before the set commands instead.
-Zombie |
|
Back to top |
|
|
Hyper
Joined: 24 Jan 2004 Posts: 1227 Location: Middelburg, The Netherlands
|
Posted: Wed Dec 01, 2004 6:49 pm Post subject: |
|
|
The ShowUBrowser command only works if you use the ubrowser.ubrowserconsole, not the upak.upakconsole from UGold.
I almost found a solution by changing the console rootwindow. This works nice and when you press esc it opens the ubrowser. But the command to restore the normal Unreal Gold menu rootwindow has no effect. Once changed to ubrowser.ubrowserrootwindow it keeps opening the ubrowser with esc, no matter what the rootwindow is set to.
For now I made it that the mutator opens the Unreal Gold menu, where the user has to manually open the ubrowser and close them again. Now the mutator executes the commands and opens the unreal menu. after this the mutator destroys itself using your destroy function.
Code: |
// EUSBMutator.
class EUSBMutator expands Mutator;
var int count;
function Destroyed()
{
local Mutator M;
if (Level.Game.BaseMutator == Self){Level.Game.BaseMutator=NextMutator;}
else
{
for (M=Level.Game.BaseMutator; M!=None; M=M.NextMutator)
{
if (M.NextMutator == Self)
{
M.NextMutator=NextMutator;
break;
}
}
}
super.Destroyed();
}
auto state InitEUSB
{
simulated function Timer()
{
local Pawn P;
if(count < 2)
{
for(P=Level.PawnList; P != None; P=P.NextPawn)
{
if (P.bIsPlayer && PlayerPawn(P) != None)
{
if (PlayerPawn(P).Player != None && PlayerPawn(P).Player.Console != None)
{
WindowConsole(PlayerPawn(P).Player.Console).LaunchUWindow();
ConsoleCommand("set ubrowser.ubrowsermainwindow windowtitle Enhanced Unreal Server Browser");
ConsoleCommand("set ubrowser.UWindowTabControl bmultiline true");
//break;
count++;
log(" Count is " $count,'EUSB');
}
}
}
}
if(count == 2)
{
// [DISABLED > does not work] ConsoleCommand("set UWindow.WindowConsole rootwindow UMenu.UMenuRootWindow");
//log(" Normal Unreal Gold menu restored",'EUSB');
Destroy();
/* From my brief testing on other servers destruction isn't totaly
neccessary. The mutator doesn't seem to stay as a loaded object
once the player leaves to connect to a remote server. However it's
probably safe to destroy it anyway.
*/
}
}
Begin:
log("----------------------------------------------------------------------------------",'EUSB');
log(" Enhanced Unreal Server Browser Initiated...",'EUSB');
log(" EUSB by Hyper.nl -- Website: www.hypercoop.tk",'EUSB');
log(" EUSB mutator by Hyper.nl based on concept by Zombie",'EUSB');
log("----------------------------------------------------------------------------------",'EUSB');
// [DISABLED > can not be undone] ConsoleCommand("set UWindow.WindowConsole rootwindow ubrowser.ubrowserrootwindow");
SetTimer(0.1, True);
End:
}
defaultproperties
{
}
|
_________________ Alter your reality...forever.
Hyper.nl Unreal Services
unreal://hypercoop.tk |
|
Back to top |
|
|
Zombie
Joined: 27 Jan 2004 Posts: 295
|
Posted: Wed Dec 01, 2004 7:11 pm Post subject: |
|
|
When changing RootWindow you are basicaly only changing the string variable that is stored on the console to be used during the creation of the actual Root object. If you are trying to set the root back to what it was then you have to change RootWindow and then set "Root = None" and "bCreatedRoot = False" or just use WindowConsole's ResetUWindow() function which whips out both ConsoleWindow+Root. You can even call CreateRootWindow again after changing RootWindow so that the default Root is put in place. However the problem that I foreseen before this is that when you whip/replace the Root it will probably destroy any object references of the MainBrowserWindow the next time you re-open things.
-Zombie |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|