atomizer / fitting

fitting room for Realm of the Mad God

Home Page:http://atomizer.github.io/fitting

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Knight 'skin'

Xavrion opened this issue · comments

Hey, Xavrion-rotmg player here. I was wondering if you could add in the new oryx knight 'skin' to the fitting room. I realize that it's not an actual skin, but I'm rather stingy when it comes to using dyes and I figured that others may want the same thing.

A lot of stuff currently is hardcoded, including the fact that characters are 8x8 pixels, so there is no straight way to add the 16x16 skins at the moment, sorry! Fear not, the rewrite (whenever it happens) should remedy this.

Well, as-is, the charImage() function could do the job if it were adapted somewhat - that is, if we add yet another parameter, for the sprite size - unless there's more to it than that... (I've admittedly stopped playing RotMG for a while, so I'm not sure about the specifics of how the 16x16 skins are implemented, or how they look ingame)

I found both the 16px skins and their transparency mappings while doing some work for muledump, so I might take a crack at this in the near future.

Can you give me a hint, where this is being handled?
I updated the skins, dyes and sheets.js to the latest deca build and it's all working great.

But I'm struggling to understand this code...
I found out removing the line 443 in main.js will display the 16x16 entries.
if (t.file != 'playerskins') continue // fix pls?
These are hardcoded to the other spritesheet though so they aren't being displayed.
Where is that hardcoded part? I don't really get it...

Expanding t with the variables from that function makes that line read more like the following:

if (skins[cur_class].skins.file != 'playerskins') continue // fix pls?

I don't really remember the history behind that line--it's possible you can safely remove it without adverse consequences? I'll admit, this codebase is pretty unwieldy, being uncommented as it is.

Thanks for the quick response!
The purpose of this line is to hide all 16x16 characters.
In skins.js every character has an entry "file" linking to the spritesheet of the skin.
For 8x8 skins this entry is "file":"playerskins" - for 16x16 this "file":"playerskins16", but this is not being used - somewhere it always accesses the 8x8 sprite sheets & mask.

With the mentioned line commented out, the 16x16 characters will be visible on the website.
But selecting them doesn't work, as somewhere it is hardcoded to the sprite sheet of the 8x8 skins.

Example:
Oryx Set Skin
"file":"playerskins16","id":"Oryx Set Skin","index":"00"
... will actually show the Bandit Rogue skin when clicking on it.
"file":"playerskins","id":"Bandit","index":"0"

You can view the result here: https://gerrudi.github.io/fitting/?5.0..

Update:

Code is still very messy and I have to cleanup/improve a lot of parts+ the "All-at-once preview" for the 16x16 skins isn't working yet. Also I only checked the result on chromium so far.
Aaaand for the future I might add some comments so that maybe others don't have to struggle as much as I did. :P