Jump to content


[help] modding PlayersPanel.swf


This topic has been archived. This means that you cannot reply to this topic.
8 replies to this topic

Adiya #1 Posted 10 February 2012 - 03:02 PM

    Sergeant

  • Beta Tester
  • 759 battles
  • 473
  • Member since:
    07-17-2010
as we know, some contour icon modders modified playerspanel.swf in order to change the icon direction on the right panel. and some changed icon's opacity (by vanilla, dead player's icon will be grey out. in modified version, the icons keep the same opacity)

i tried to figure out how to do these two modifications with a vanilla playerspanel.swf and a modified one (both are decomplied from SWF files). but have no idea where to begin with.

can anyone tell me where should I look into?

o0SMoOKE0o #2 Posted 11 February 2012 - 06:23 PM

    Lance-corporal

  • Player
  • 14263 battles
  • 93
  • Member since:
    04-01-2011

View PostAdiya, on 10 February 2012 - 03:02 PM, said:

as we know, some contour icon modders modified playerspanel.swf in order to change the icon direction on the right panel. and some changed icon's opacity (by vanilla, dead player's icon will be grey out. in modified version, the icons keep the same opacity)

can anyone tell me where should I look into?

I think you should take a look at the functions (found in PlayersPanel) named :

_setFragsStr
_setVehiclesStr
_setNamesStr

and to be more precize at the part with:

_getHTMLText

If I interpret it correctly depending on your state if will give back specific colors.
States are :

squad (I think this is platoon -> yellow/gold color)
normal (Singe player not in platoon)
teamkiller (Teamkiller -> blue)
VIP (VIP ? <-- I think this is for a new gamemode ?)

if your state is _dead (e.g. normal_dead) an extra variable will be set making that player greyed out.

Also take a look at function setState (found in PlayerListItemRenderer).

Where you will find the _getColorTransform (color depending on your state) and _alpha (alpha level depending if your are alive or dead)

I just hope I dont violate any rules by posting above.

Adiya #3 Posted 11 February 2012 - 08:19 PM

    Sergeant

  • Beta Tester
  • 759 battles
  • 473
  • Member since:
    07-17-2010
the problem is that i can't find any functions you listed above. is that possible that my PlayersPanel isn't decomplied correctly?

o0SMoOKE0o #4 Posted 11 February 2012 - 09:27 PM

    Lance-corporal

  • Player
  • 14263 battles
  • 93
  • Member since:
    04-01-2011
I dont know which decompiler you are using but as far as I know there is no decompiler that will direct output ActionScript code.
(swfmill will output in some sort of XML code and flasm will output into some sort of P-Code)

Above statements can be found when using Sothink SWF Decompiler by looking in the folder 'Action' and 'sprite 103'

If you exported with Sothink you will find that part of the code in the ..\net\wargaming\ingame folder in the 'PlayersPanel.as'

But from my own experience when you 'compile' that FLA back to a SWF with Adobe Flash it will mess the font and the structure of the SWF up.

Adiya #5 Posted 12 February 2012 - 11:12 AM

    Sergeant

  • Beta Tester
  • 759 battles
  • 473
  • Member since:
    07-17-2010
i'm using Sothink.

so is there a way to edit AS only without any decompiling/compiling process?

J1mB091 #6 Posted 12 February 2012 - 12:58 PM

    First Sergeant

  • Beta Tester
  • 17684 battles
  • 1,007
  • [PTS] PTS
  • Member since:
    01-26-2011

View PostAdiya, on 12 February 2012 - 11:12 AM, said:

i'm using Sothink.

so is there a way to edit AS only without any decompiling/compiling process?

I use SWiX for mirroring icons ^^ that shows the swf in xml code and you can edit positions of icons for example.

o0SMoOKE0o #7 Posted 12 February 2012 - 07:05 PM

    Lance-corporal

  • Player
  • 14263 battles
  • 93
  • Member since:
    04-01-2011

View PostAdiya, on 12 February 2012 - 11:12 AM, said:

i'm using Sothink.

so is there a way to edit AS only without any decompiling/compiling process?

As far as I know there is not such a way (but I'm not expert :))

My best bet would be :

* swfmill original SWF to XML (to have a original XML file to edit)
* Export original SWF to FLA with Sothink (to have a source FLA file)
* Make changes in FLA file with Adobe Flash and publish it to SWF (to create a changed SWF file)
* swfmill changed SWF to XML (to have your changes in XML format)
* compare original xml with changed xml. Note the difference between both files (this would be the changes you made in Action Script in XML format)
* make changes in original XML file
* swfmill original XML file to SWF

But like I said I'm not an expert so maybe there are 'shortcuts' but you have to ask the pros :)

locastan #8 Posted 12 February 2012 - 07:16 PM

    First Sergeant

  • Player
  • 10140 battles
  • 2,661
  • [INC] INC
  • Member since:
    08-01-2011

View Posto0SMoOKE0o, on 12 February 2012 - 07:05 PM, said:

My best bet would be :

* swfmill original SWF to XML (to have a original XML file to edit)
* Export original SWF to FLA with Sothink (to have a source FLA file)
* Make changes in FLA file with Adobe Flash and publish it to SWF (to create a changed SWF file)
* swfmill changed SWF to XML (to have your changes in XML format)
* compare original xml with changed xml. Note the difference between both files (this would be the changes you made in Action Script in XML format)
* make changes in original XML file
* swfmill original XML file to SWF

That is a good approach. Keep in mind that most decompilers that output FLA, make lots of mistakes, so either you have to touch up manually or think twice about every difference between original XML and changed XML swfmill gives you. If you want to do it the tedius way, you can decompress the swf with swifty (http://www.buraks.com/swifty/swfc.html) and manually hex edit the actionscript if you want to change only some numeric value. You can then re-compress the resulting swf again and also check up on your actionscript using Sothink. Sothink diplays the AS code right (at least I hope), but somehow fails to put it correctly into the FLA.

o0SMoOKE0o #9 Posted 12 February 2012 - 07:45 PM

    Lance-corporal

  • Player
  • 14263 battles
  • 93
  • Member since:
    04-01-2011

View Postlocastan, on 12 February 2012 - 07:16 PM, said:

Keep in mind that most decompilers that output FLA, make lots of mistakes, so either you have to touch up manually or think twice about every difference between original XML and changed XML swfmill gives you.
True. Especially take note of the 'object id' numbers. E.g. in the original file the Sprite can be 103 while in the exported and republished version it can be 117.

I always checked the original and the republished version of the SWF with Sothink to make sure the structure of the SWF was still intact and to verify if the action script changes were visible.

But still I have a lot of things I dont understand and how specific things are interpreted by WoT (or how to make things visible).

Big thumbs up for the coders that can code in the XML format that swfmill outputs. I tried it and could manage with very basic and simple things, but it took me a long time and a lots of cups of coffee and cigarettes  :blink:

One thing that really helps is the replay function of WoT, as now you can test your edited SWF file in a 'live' environment without the need of playing the game !