Page 1 of 1

HOWTO: Customize TASClient for your own mod

Posted: 30 May 2009, 03:39
by Satirik
I've done quite a few things to allow mod makers to customize their TASClient for their installer, here are the things you can do :

TASClient parameters :
  • -server url:port
  • -inifile tasclient.ini
  • -menu
  • -menumod "mod name" (directly shows the mod's menu)
  • -menudev (get SP skin files from Spring\Interface instead of *.ssk)
  • -debug
  • -ignoreversion (ignore server version incompatibility)
  • -ignoreredirects (ignore lobby server redirections)
  • -log
  • -no3d (no 3d map preview)
TASClient config files customization
  • you can make your own skin using the skin editor
  • you can customize the splashscreen picture, labels pos/color, news urls, registry path etc by adding a TASClient.ini next to the TASClient.exe. TASClient.ini example:
    [General]
    RegistryKey=\Software\TASClient
    AutoUpdateURL=http://tasclient.no-ip.org/TASClient_update_v5.txt
    [News]
    NewsURL=http://www.google.fr
    ScrollingNewsRSSFeed=http://news.google.com/?ned=fr&output=rss
    [SplashScreen]
    DisableFadeIn=1
    Image=springlobby5.jpg
    InfoLabelX=10
    InfoLabelY=230
    InfoLabelColor=0000FF
    VersionLabelX=360
    VersionLabelY=230
    VersionLabelColor=00FF00
    [WidgetDB]
    ManagerURL=http://spring.vsync.de/luaManager/lua_manager.php
    [SpringDownloader]
    ServiceURL=http://zero-k.info/ContentService.asmx
    RapidURL=http://packages.springrts.com
    [Spring]
    RelayHostManagerName=RelayHostManagerList
  • you can change the scrolling news design, it's just html and css, check : Lobby\ScrollingNews\*.* the page.html is the generated one with the news item don't edit it (unless you like working for nothing)
  • you can change/set every options to a default value by registering a .reg file when installing tasclient, like not displaying the news, or highlighting words, or not joining main or auto join a special channel
  • you can add default groups to your installer you just need to change the groups.ini
  • you can add/change the filter presets and quick join options so new players will quick join your mod or only stable version of a mod or whatever you want
  • you can edit the tips, the first value of each tip line is the window where it will be shown, there are default tips, battle form tips and replay form tips
  • you can change the default selected server with the -server serverurl.com:port to the lobby
  • you can actually make your own lobby as default ... just by copying config files and registry to your installer or whatever (wow that's the biggest news ever ... I know I know).
Single player customization : as you already know, TASClient use IE for it's SP mode. Yeah IE sucks, but it was my only choice. Other browser are not available for delphi or only in sucky beta version (or im not aware of them).
  • the TASClient SP supports a campaign and mission system with full html briefing, it allows you to make something that looks like a real SP game, but you're limited by html and css and IE. You can install the flash plugin for IE in your installer too and add flash to it ... never done that but it's an option. If you want to know more about it, just ask.
  • the whole SP skins are full html/css/javascript, you can extract them : lobby\SPTheme\*.ssk (it's 7-zip). If you want to make a nice interface with dynamic size it won't be easy but you can do it ... i did it for the default one. It has functions to play music and sounds (not using javascript but tasclient). It can store settings from one session to another.
  • you can include a special skin in you mod file. You just have to put the html/css/javascript files in the SPTheme/IE dir of the mod
  • i can provide a simple basic skin example
  • if you need help to make your own skin, or if you need new tags ... just ask
  • to launch TASClient in SP mode directly, just add the -menu parameter
  • to help you developping your skin, you can use the -menudev parameter. It will load the skin from the Spring\Interface dir instead of the skin files. And it will allow the F5 refresh key to easily check the new changes
Python scripting customization : the python integration in tasclient is not complete yet, but you can do a lot of things with it
  • if you need something to make your script that doesn't exist ... just ask me i'll see what i can do
  • you can make powerful script with only few lines thanks to aegis' handlers, like adding a new command just by making a cmd_COMMANDNAME(parameters) function for example
  • you can hide battles to the user using script (there is an example in the subf dir hidding the autohosts battles). You can use it to only show the battles with your mod or whatever. User filters will apply uppon it but even if disabled, the hidden battles from script won't be visible. Of course they will still be able to join hidden battles using the player context menu (play with), but you can block that by intercepting the outgoing join and canceling it.
  • you can change the server list
  • you can sniff every incoming command, and change or cancel it before the lobby handles it. you can also add action after the lobby has handled it.
  • you can sniff every outgoing command and change or cancel it
  • you can make the lobby download a map or a mod and get the progress
  • you can get lot of info from the lobby like players, maps, mods, replays etc, in dictionnary like users['username']['Battle']['Players']['username2']['country'] (pretty easy to use)
  • you can add your own commands like /downloadbestmap
  • you can change the interface, move controls, hide them, add new ones, put events on them, delete them, change their properties etc
  • to easily edit the control properties, or make a new form, or touch the interface, you can use the "poweruser window" : CTRL+SHIFT+F8 and save what you've done to a python script, and then edit it to add code. WARNING : the poweruser window is for powerusers ... don't expect it to handle all the crap you can make with it
  • you can add a webbrowser whereever you want and use it to improve the interface. For example, you could add a map with planets for planetwars, then add an event on the "onnavigate" event, put special keywords in the <a> url tags of the pages so it automaticaly loads the map corresponding to the selected planet
  • you can easily add a timer just by making a timer_NBOFSECONDSINTERVAL() function
  • you can add your own icons to players like your own ranking system with rank icons
  • you can call TASClient published methods, like a OnClick event on any button or menu item
  • you can change all pictures used in the lobby (ranks, connection states, bot icon etc)
  • to know more about the scripting possibilities read the lobby\python\api.txt file
TASClient hacks
  • you can edit the sound files using reshack
If you have any questions ...

I know TASClient is not crossplatform and it uses IE and it sucks blabla no need to post to say that :)

Re: HOWTO: Customize TASClient for your own mod

Posted: 30 May 2009, 04:34
by 1v0ry_k1ng
TASclient kicks springlobby in the dick

Re: HOWTO: Customize TASClient for your own mod

Posted: 30 May 2009, 06:07
by smoth
wow, cool satirik!

Re: HOWTO: Customize TASClient for your own mod

Posted: 30 May 2009, 12:56
by imbaczek
good job.

btw, if you haven't noticed, spring's --config option is finally fixed. i remember you wanted it working some time ago.

Re: HOWTO: Customize TASClient for your own mod

Posted: 30 May 2009, 14:58
by zwzsg
Cool! I had already done half of this with some dirty Hexedit and ResHack. Where is the download link to newest TASClient? Is there a way to swap your SP mode with my own SP launcher? If a player install two customised TASClients, would they clash?

Re: HOWTO: Customize TASClient for your own mod

Posted: 30 May 2009, 18:45
by Satirik
so now it's --config "filename" ? it supports "" ? it didn't before and the screen resolution wasn't used ...

with scripts you can hide the SP button and replace it with a new one launching whatever you want ... if that's what you're talking about

Re: HOWTO: Customize TASClient for your own mod

Posted: 30 May 2009, 20:16
by imbaczek
re --config, yes, it supports "path with spaces\stuff", not sure if it's --config "..." or --config="...", easy enough to test, though.

Re: HOWTO: Customize TASClient for your own mod

Posted: 31 May 2009, 12:30
by Neddie
Game or mod.

Re: HOWTO: Customize TASClient for your own mod

Posted: 01 Jun 2009, 05:50
by zwzsg
Satirik wrote:with scripts you can hide the SP button and replace it with a new one launching whatever you want ... if that's what you're talking about
Need more details on how to do that. Had a look at some \lobby\python\scripts\*.py, but am clueless about how to add and remove button with them.

Re: HOWTO: Customize TASClient for your own mod

Posted: 01 Jun 2009, 06:18
by Satirik
to hide the button you just have to set its visible property to false and to add a button check the api.txt, im not sure (never tested) but you could also replace the "onclick" event of the actual button by a python function ... to check the control name,properties and events use the poweruser window : CTRL SHIFT F8

gonna check if it likes when you override an event

edit: yep it works, i'll add a read only textbox with the selected control path in the poweruser windows cause it's a pain to get a control path by hand

Code: Select all

import lobbyscript

api = lobbyscript.Callback()
gui = lobbyscript.GUI()

def onSPButtonClick(Sender):
	print Sender #do whatever you want here like launching your own app

def _init():
	gui.AddEvent('MainForm.SinglePlayerButton', 'OnClick', 'test', 'onSPButtonClick')
don't forget to replace the 'test' by the name of your file (mine was 'test.py')

Re: HOWTO: Customize TASClient for your own mod

Posted: 01 Jun 2009, 06:40
by zwzsg
Thanks, gonna try.

Shouldn't TASClient.ini be in \lobby\var instead of Spring root?

I've never done any python, sorry for my newbiness, what is the syntax for: Run Kernel_Panic_3.3_Launcher.exe ? :P

I googled up:
import os
os.system("c:\\dir\\dir\\app.exe")
But it doesn't seem to want to work.

Edit: Nevermind, I need to stop forgetting what I'm specifically told not to forget.

Code: Select all

import lobbyscript

api = lobbyscript.Callback()
gui = lobbyscript.GUI()

def onSPButtonClick(Sender):
   import os
   os.spawnl(1, "Kernel_Panic_3.3_Launcher.exe")

def _init():
   gui.AddEvent('MainForm.SinglePlayerButton', 'OnClick', 'SPisKPL', 'onSPButtonClick')
Works! Thanks!

Why does it show http://www.springinfo.info/tasclient.php/ into TASClient, but when I replace it by http://springrts.com/wiki/Kernel_Panic or http://www.moddb.com/games/kernel-panic then it shows it in an I.E. outside TASClient? Edit: Weird, it works with the .ini method, not when I hard code it.

Re: HOWTO: Customize TASClient for your own mod

Posted: 03 Jun 2009, 00:10
by Satirik
because every onnavigate event are canceled to open a browser ... the main news browser can't show anything but the first page

Re: HOWTO: Customize TASClient for your own mod

Posted: 10 Sep 2009, 01:06
by Satirik
updated the first post few times now so it might interest someone

Re: HOWTO: Customize TASClient for your own mod

Posted: 13 Apr 2015, 13:29
by 8611
the "official" opinion is that TASclient is not maintained anymore
viewtopic.php?f=64&t=33300#p568568