Data Realms Fan Forums http://45.55.195.193/ |
|
Sprite issues http://45.55.195.193/viewtopic.php?f=1&t=46111 |
Page 1 of 1 |
Author: | Chiko [ Fri Dec 16, 2016 2:39 pm ] |
Post subject: | Sprite issues |
So I kinda got distracted from the mod I was developing and ended up making a Krogan unit: 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. 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. |
Author: | Arcalane [ Wed Dec 21, 2016 6:00 am ] |
Post subject: | Re: Sprite issues |
Chiko wrote: So I kinda got distracted from the mod I was developing and ended up making a Krogan unit: 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. |
Author: | Chiko [ Wed Dec 21, 2016 1:52 pm ] |
Post subject: | 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. 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. |
Author: | Arcalane [ Wed Dec 21, 2016 4:17 pm ] |
Post subject: | 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. |
Author: | Chiko [ Wed Dec 21, 2016 5:07 pm ] |
Post subject: | 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. 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: 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. |
Author: | Chiko [ Tue Jan 03, 2017 5:45 am ] |
Post subject: | 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 |
Author: | Chiko [ Thu Jan 12, 2017 5:31 pm ] |
Post subject: | 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? |
Author: | 4zK [ Thu Jan 12, 2017 5:48 pm ] |
Post subject: | 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. |
Author: | Chiko [ Thu Jan 12, 2017 8:19 pm ] |
Post subject: | 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 |
Author: | Chiko [ Sat Jan 14, 2017 8:28 pm ] |
Post subject: | 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. |
Page 1 of 1 | All times are UTC [ DST ] |
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group http://www.phpbb.com/ |