Hi Rez Player
HI-REZ PLAYER MOD
FEATURES:
Replaces the character’s sprite with a more detailed, less robed alternative. Changes are mostly* cosmetic (see KNOWN ISSUES below). See other upload versions of this mod for 2x and 4x scale.
Contains lua code to make high-resolution sprites work. You can change out the images to make your OWN high-resolution sprite mod by just following the simple steps below.
Contains code to increase or decrease the base size of the player altogether, so you can make your own character gigantic or tiny as you see fit. By default, this mod doesn’t change the player’s scale, so that is an unused feature.
KNOWN ISSUES:
Because the API doesn’t allow proper scaling of the arm, the arm is locked into a ‘forward’ position as a hack fix. The wand still tilts and aims fine. This should have only a very, very minor effect on gameplay compared to the vanilla experience (no more than alternate hotspots from custom sprites would).
Player hotspots no longer work. They are hard-coded in to a reasonable position. This means the cape and arm can’t bob up and down as you walk, which is a minor difference compared to the vanilla experience. You can change the hard-coded position in customization step if you want to make your own high-resolution sprite.
Stains aren’t set up (except for the cape). You can still get statuses like wet, or bloody, but they won’t appear on the player’s sprite as stains on the clothing.
If using this as a template to make your own sprite, be warned that dynamic size change doesn’t work. You can’t change the player’s size mid-game with this code. Such a thing would be *mostly* possible to implement, but I haven’t found a way to change the player’s fluid-collision hitbox via lua code.
The player gets extra thick when using a gamepad.
PUBLIC USE:
Feel free to use this mod as you see fit, whether that’s to just make your own high-resolution sprite mod or to improve/upgrade/replace this one. Just make sure to credit ‘branson’ somewhere in it. The files to peruse should appear in the steamapps/workshop/content/881100 folder along with any other installed mods.
How to make your own HI-REZ sprite:
1) Open up init.lua.
A) Line 3 is: "local hi_rez_scale = 4". Change this 4 to however much bigger your sprite is than the original. For example, 4 means that one pixel from the original is expanded into a 4×4 containing 16 pixels.
B) Line 57 is: "ComponentSetValue2(sc, "image_file", "mods/hirezplayer/files/enemies_gfx/playerXL.xml")". Change ‘hirezplayer’ in that path to the folder your mod is in.
C) Line 94 is: "ComponentSetValue2(hotspot, "offset", -2 * hi_rez_scale, -7 * hi_rez_scale)". This manually sets player hotspots to a reasonable position. Feel free to change this.
2) Go to the files/enemies_gfx folder and open up playerXL.xml. This file represents the ‘true’ player sprite, which we make invisible for reasons.
A) It has the following filename: "mods/hirezplayer/files/enemies_gfx/playerXL.png". Replace ‘hirezplayer’ with your mod’s folder.
B) You don’t need to edit the hotspots filename, since using hotspots on a hi-rez player causes problems.
3) Go to the data/enemies_gfx folder and open up player.xml. This file represents the sprite the user will see.
A) If you’re fine with a 4x scale, leave the file as is.
B) If you want a different scale
i) copy in the original player.xml
ii) Add the following as the FIRST LISTED RectAnimation. The frame_height and frame_width here determine your collision box for liquids. If you want to make the player ACTUALLY larger, you’ll need to increase these numbers proportionally (ex: double them for a character that is twice as tall):
<RectAnimation frame_count="6" frame_height="19" frame_wait="0.2" frame_width="12" frames_per_row="8" name="unused" pos_x="0" pos_y="4">
</RectAnimation>
iii) Multiply the frame_height and frame_width of all RectAnimations OTHER THAN THE ONE IN THE PRIOR STEP by your desired scale. The frame_height and frame_width here affects the clipping of your animations.
C) If you’re adding additional animations, append "hr_" to the front. Also add them to the playerXL.xml file in files/enemies_gfx, but in playerXL.xml, do NOT append "hr_" to the front. You’ll never need to apply the "hr_" version of animations manually.
