View unanswered posts | View active topics It is currently Wed Dec 25, 2024 7:01 pm



Reply to topic  [ 10 posts ] 
 Sprite issues 
Author Message
User avatar

Joined: Thu Oct 04, 2012 9:21 pm
Posts: 105
Location: Chile
Reply with quote
Post Sprite issues
So I kinda got distracted from the mod I was developing and ended up making a Krogan unit:

Image

I have some questions about sprites.

Is there a way to make the "helmet" part appear in front of the head sprite without attaching it to the head? If
I attach it to the head, it moves with it and that's not what this needs.

Currently, the head has DrawAfterParent = 0 and the helmet thing is attached to the unit itself so it stays in place. The issue is when you aim downwards and upwards... the sprites just don't look right.

Edit: One cheap way to "solve" this would be to restrict the aiming capabilities of the unit, like it happens with turrets. It won't be able to aim too high or too low. Krogans are bulky that way. :P

Edit2: If I end up releasing this as a mod, I think I will have to make a new head, though. I found it somewhere but I couldn't contact the person who made it. He's been offline for more than 2 years.

Also, is there a way to make a sprite attached to the head appear behind it? I made a heavily damaged version of the head I want it to be behind it so when the real head gibs, the damaged one takes its place. I've been playig with the DrawAfterParent string but the piece always appears in front. :(


Fri Dec 16, 2016 2:39 pm
Profile
User avatar

Joined: Sun Jan 28, 2007 10:32 pm
Posts: 1609
Location: UK
Reply with quote
Post Re: Sprite issues
Chiko wrote:
So I kinda got distracted from the mod I was developing and ended up making a Krogan unit:

Image

I have some questions about sprites.

Is there a way to make the "helmet" part appear in front of the head sprite without attaching it to the head? If
I attach it to the head, it moves with it and that's not what this needs.

Currently, the head has DrawAfterParent = 0 and the helmet thing is attached to the unit itself so it stays in place. The issue is when you aim downwards and upwards... the sprites just don't look right.


For the Zone Troopers in the GDI Mod, the suit "helmet" piece is attached to the torso, but the whole assembly is large enough that the exposed head can't clip out of the helmet. This won't work as well with krogan for obvious reasons.

What you could do instead is have the head as a dummy object as well, so that it won't tilt independent of the body either. Current builds can have damage multipliers set on parts, so it should be easy enough.

Quote:
Also, is there a way to make a sprite attached to the head appear behind it? I made a heavily damaged version of the head I want it to be behind it so when the real head gibs, the damaged one takes its place. I've been playig with the DrawAfterParent string but the piece always appears in front. :(


Use the damaged version as the real head, and overlay the intact version like a helmet. Easy.


Wed Dec 21, 2016 6:00 am
Profile YIM
User avatar

Joined: Thu Oct 04, 2012 9:21 pm
Posts: 105
Location: Chile
Reply with quote
Post Re: Sprite issues
Arcalane wrote:
For the Zone Troopers in the GDI Mod, the suit "helmet" piece is attached to the torso, but the whole assembly is large enough that the exposed head can't clip out of the helmet. This won't work as well with krogan for obvious reasons.

What you could do instead is have the head as a dummy object as well, so that it won't tilt independent of the body either. Current builds can have damage multipliers set on parts, so it should be easy enough.
Hmm... that could work. I have no idea how to set those damage multipliers so I'll do some searching.

Currently, the clipping only happens when they jump into prone position or when something hits them hard enough to knock them down.


Arcalane wrote:
Use the damaged version as the real head, and overlay the intact version like a helmet. Easy.
There is one tiny problem with that, though. The damaged head will also be displayed in the buying menu. I just made the head and torso parts really resistant to gibbing. The head will never explode so the empty space in the helmet thing should never be exposed.


Wed Dec 21, 2016 1:52 pm
Profile
User avatar

Joined: Sun Jan 28, 2007 10:32 pm
Posts: 1609
Location: UK
Reply with quote
Post Re: Sprite issues
Chiko wrote:
There is one tiny problem with that, though. The damaged head will also be displayed in the buying menu. I just made the head and torso parts really resistant to gibbing. The head will never explode so the empty space in the helmet thing should never be exposed.


True. Hm.

You might be able to attach some scripting to the head so that it changes sprite frame after taking a certain amount of damage? Would need one of the Lua guys to weigh in here.


Wed Dec 21, 2016 4:17 pm
Profile YIM
User avatar

Joined: Thu Oct 04, 2012 9:21 pm
Posts: 105
Location: Chile
Reply with quote
Post Re: Sprite issues
Your first idea worked like a charm, Arcalane! This is what I did:

I made A fake attachable head that does not move and I put the heavily damaged one behind it. It bleeds and all but the actor does not take health damage when the part is hit. However, I did a little searching and read about the BreakWound string. So when the part is destroyed, the heavily damaged head is revealed and the actor starts to lose health rapidly, dying seconds later.

Image
The krogan still fights during this so it's pretty awesome to see it fighting till its last breath. xD

The real head is smaller, and I hid it the best I could behind the actor but you can still see a couple of pixels when the actor is going prone or has been knocked back but it's just a detail that can be fixed.


Edit:
I added a 1 in EmissionDamage and now the fake head takes damage when it bleeds so it's even better now.

Also, I made them really heavy and added a bit of Sharpness to their body parts so they can kill by jumping over actors or if you jet-propel forward and hold down the arrow key, they will do a headbutt attack that will knock someone's weapons sometimes or just kill them if there's a wall behind them.


Edit2:
Oh man, I had to increase the gibbing resistance of its torso even more... explosives gib it and it makes them drop all its heads, lol.

I also made its heavily damaged head unable to be hit so it doesn't expose the helmet hole. The real head is hidden in there so if the Krogan somehow survives the fatal breakwound, a bullet that goes thru the area will hit the real head and kill it instantly.


Edit3:
Dammit, explosives would still gib the torso area and the only thing that seems to prevent it is the missioncritical string. The problem with that is the actor will never settle when activated. I tried some lua thing to deactivate it when the actor is dead but I can't make it work.

I tried attaching the heads into a single one but having the GetsHitByMOs = 0 in the main object prevent the attached ones to have that setting to 1.

I also tried to make a very durable material for the torso with high gibbing resistance and structutal integrity, AND I also made a fake torso in front of it that works like the fake head, so when it break, the actor will get the fatal breakwound. But even with all this, the entire torso would still gib, releasing the fake heads.


Edit4:
I gave up on the indestructible torso but I found workaround. I managed to set up a lua that gibs all but the heavily damaged head when they are detached from the torso. Phew...

I'll do some more tests and pixel editing when I get back home from work and if everything is working ok, then I'll probably release this unit as a mod.


Edit5:
Hmm... I made a helmet for it but maybe it would make it too OP:
Image
It still needs some pixel adjustments to make it fit better in the slot.

The helmet turns it into a walking tank and it can make the krogan survive even a rocket to the face.


Wed Dec 21, 2016 5:07 pm
Profile
User avatar

Joined: Thu Oct 04, 2012 9:21 pm
Posts: 105
Location: Chile
Reply with quote
Post Re: Sprite issues
I just found the perfect fix for the head icon issue! It was a pretty simple lua thing. I just needed to add an extra head sprite with nothing in it and then attach a lua file with "self.Frame = 2" on a "function Create(self)" command. So the head is shown in the menu but when the unit is spawned, it will swap to the empty head. =D


Tue Jan 03, 2017 5:45 am
Profile
User avatar

Joined: Thu Oct 04, 2012 9:21 pm
Posts: 105
Location: Chile
Reply with quote
Post Re: Sprite issues
Oh noes... I just noticed the head icon thing is somehow flawed.

Code:
function Create(self)
   self.Frame = 2
end


It works all right and it does what it's supposed to do but not always for some reason. Sometimes, the lua doesn't change the frame to the second one. Is this a lua bug of some kind? Is there another way to achieve this or to somehow force an actor to always execute the code?


Thu Jan 12, 2017 5:31 pm
Profile
User avatar

Joined: Mon Oct 11, 2010 1:15 pm
Posts: 594
Location: Finlandia
Reply with quote
Post Re: Sprite issues
Make a failsafe check on function Update(self) that tries to change the Frame to 2 if it's still not 2.


Thu Jan 12, 2017 5:48 pm
Profile
User avatar

Joined: Thu Oct 04, 2012 9:21 pm
Posts: 105
Location: Chile
Reply with quote
Post Re: Sprite issues
4zK wrote:
Make a failsafe check on function Update(self) that tries to change the Frame to 2 if it's still not 2.

Something like this?
Code:
function Create(self)
   self.Frame = 6;
end

function Update(self)
    if self.Frame ~= 6 then
      self.Frame = 6;
   end
end


I tried this one before but it didn't work:
Code:
function Create(self)
   self.Frame = 6;
   self.IconTimer = Timer();
end

function Update(self)
    if self.IconTimer:IsPastSimMS(1) then
      self.Frame = 6;
   end
end



EDIT1:
I believe it is a bug... I tried leaving just the function Update and it works but after mission and mission in campaign mode or after repeated custom scenarios, the lua stops doing its job. It's weird because it only happens like half the time and not to every actor using the lua.


EDIT2
Found another code that looks like it should work but it also does so at first.
Code:
function Create(self)
   self.Frame = math.ceil(math.random(6,6))
end


Thu Jan 12, 2017 8:19 pm
Profile
User avatar

Joined: Thu Oct 04, 2012 9:21 pm
Posts: 105
Location: Chile
Reply with quote
Post Re: Sprite issues
Le bad news... I tried lots of ways but I just couldn't find the cause. I'll have to just remove the code and the head being used as Icon. It will look ugly but I'll have to just use the "hidden" head version. :(


Sat Jan 14, 2017 8:28 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 10 posts ] 

Who is online

Users browsing this forum: No registered users


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by STSoftware for PTF.
[ Time : 0.114s | 15 Queries | GZIP : Off ]