Page 1 of 1

I need help with custom mech sprites [Healtbar overlapping]

Posted: Thu Mar 22, 2018 12:35 am
by aaronclaros
Hi, i am working on a custom mech sprite, i change the 7 sprites of the mech_punch, but when i test in game the sprites looks is offset of the tile, bellow there is an example, i try to change offset on the script "animations.lua" but when i save the changes, the game doesn't start, any advise??
I know that the sprite is a bit big, but i want to try how it will look in game.
Image
link to image: https://imgur.com/a/j39Yy

Re: I need help with custom mech sprites

Posted: Thu Mar 22, 2018 6:37 am
by inventex
Find the file pawns.lua

Towards the bottom there are all the animations. Just edit pos X and pos Y, increasing or decreasing as desired until for each sprite it looks like it is positioned good.

So you will need to test:
Normal,
Animated,
Broken,
wet,
Wet Broken.

Here is an example from one of my mechs.

Code: Select all

INBN_HammerMech = Pawn:new{
   Name = "Hammer Mech",
   Class = "Prime",
   Health = 3,
   MoveSpeed = 4,
   Image = "INBN_HammerMech",
   ImageOffset = 3,
   SkillList = { "INBN_Slam" },
   SoundLocation = "/mech/prime/rock_mech/",
   DefaultTeam = TEAM_PLAYER,
   ImpactMaterial = IMPACT_METAL,
   Massive = true
}
AddPawn("INBN_HammerMech")

ANIMS.INBN_HammerMech =         ANIMS.MechUnit:new{ Image = "units/player/mech_hammer.png", PosX = -23, PosY = -7 }
ANIMS.INBN_HammerMecha =      ANIMS.MechUnit:new{ Image = "units/player/mech_hammer_a.png", PosX = -23, PosY = -7, NumFrames = 4 }
ANIMS.INBN_HammerMechw =      ANIMS.MechUnit:new{ Image = "units/player/mech_hammer_w.png", PosX = -23, PosY = -7 }
ANIMS.INBN_HammerMechh_broken = ANIMS.MechUnit:new{ Image = "units/player/mech_hammer_broken.png", PosX = -23, PosY = -7 }
ANIMS.INBN_HammerMechw_broken =   ANIMS.MechUnit:new{ Image = "units/player/mech_hammer_w_broken.png", PosX = -23, PosY = -7 }
ANIMS.INBN_HammerMech_ns =       ANIMS.MechIcon:new{ Image = "units/player/mech_hammer_ns.png" }

Re: I need help with custom mech sprites

Posted: Fri Mar 23, 2018 3:14 am
by aaronclaros
inventex wrote:Find the file pawns.lua

Towards the bottom there are all the animations. Just edit pos X and pos Y, increasing or decreasing as desired until for each sprite it looks like it is positioned good.

So you will need to test:
Normal,
Animated,
Broken,
wet,
Wet Broken.



Thanks, i reduce the size of the custom sprite and fix the positions, but now i have a new problem, the healthbar is overlapping the custom sprite, i try to search the script that manage the healtbar, but just find this in "images.lua"

Code: Select all

line 491 Location["combat/icons/icon_healthbar_shadow.png"] = Point(-15,-12)

i try to change this line, but nothing happens
here is a screenshot of the problem:
https://imgur.com/a/0eQBq
did you know how fix this?