In this case, I want to create a commandlet that can decode a save file that has been encoded in-engine. Currently I have to boot-up the game and run a command. It would be nice to just run a single shortcut and do this with a commandlett script. There are lots of other things I’d like to automate too.
I don’t find it hard to believe that the engine simply cannot run without a map loaded. Even if all you want to show is a menu, you still need to load a map, and there’s all that engine relevant stuff that’s in Worldinfo which is tied to a map isn’t it?
I’d just try using the smallest map possible that works for what you need the commandlet to do.
I know it’s still possible to boot up the game and manually type in the commands i need. But when I’m setting up automation pipelines for certain batch tasks, that is not really an option.
And the documentation states that custom commandlets are supported. I feel like I am just doing something wrong with how i’m setting it up, so wanted to check if anyone else is using them.
I’m working on setting one up to start our game with, beings you can only put in 256 characters into the target line. Hopefully i can add more thru the commandlet. I got the class to compile but it is not reconizing my map and its starting a listen server not a dedicated server. I’m having problems with it also. When i get it running properly, i will let you know what i did.
What we are doing at this moment is this. We took and made a shortcut from our exe to the desktop then in that shortcut i put into the target line this.
C:\UDK\UDK-2014-02\Binaries\Win32\FOPB.exe server warehouse2?dedicated=true?GameDifficulty=7?TimeOfDay=5?Weather=1?AdminPassword=ss?Game=Paintball.PBRescuePresident?MaxPlayers=16?NUMPLAY=2? –silent LOG=DEDPaintballLog.txt -ConsolePosX=0 -ConsolePosY=0
Then all i have to do is click that shortcut and it will start a dedicated server.
But what i hate is the target line will only accept 256 characters. So it limits you on what you can put into the target line. I was hoping to make a commandlet to start the dedicated server with. I was hoping to run way more parameters then you can put into the target line. But way its looking this might not work for what i was thinking.
@gamepainters The way I have it configured is that all dedicated server settings are in a custom ini file i created (DefaultDedServerSettings.ini). Then on init game, I apply them, without relying on purely launch params.
In your above example, you can access the query url part of the launch command from unrealscript, but not the other launch params (such as -ConsolePosX, or any of those), as far as i know. I would like to be able to access the entire launch string.
The target line is just for the starting of the 1st map after that the game.ini takes over and it uses everything in that file. I was hoping to get more parameters on the 1st map launch.
@gamepainters I was never able to get it to run the commandlet, as it would always try to load a map with the name of my commandlet that i was passing in the command.
Have you been able to get the commandlet to run? How are you running the commandlet? I was running from a shortcut of UDK.ex with this in the target field:
../UDK.exe HelloWorldCommandlet testParam
Also tried:
../UDK.exe HelloWorld testParam
It always comes up with a warning saying “can’t fin map HelloWorld, would you like to load the default map?”.
no i cant seem to get it to run. It just loads the game as if you were trying to start the game normally as a player. I tried logging the params coming in but nothing, its like main does not run.
I have not been around for last few days. We run the servercommandlet then in the parameters we tell it which kind of server we are going to run. Only way i can think of to get more parameters added is to use a .bat file as Neongho posted above. then you can have as many parameters as you want.
like this in the login function in gameinfo class. Examples below
InPassword = ParseOption ( Options, "Password" );//admin pass
InTeam = GetIntOption( Options, "Team", 255 ); // default to "no team"
Also in the init function in whatever you call your gametypes class that extends gameinfo or in the gametype init function, i think i would gather most in the gametypes base file.
These were in our Base gametypes file.
Also in the base gametype file that extends gameinfo theres a function called
function ProcessServerTravel(string URL, optional bool bAbsolute)
in that you must get your parameters also to send when traveling to next map.
The above code was how we put in our time of day and weather settings parameters.
Also make sure you make the gri vars you will need them later for checks thru out code