smoother change-over from unit to wreck
Moderator: Moderators
smoother change-over from unit to wreck
dunno if it asked before, but atmo there is an abrupt change-over from the unitmodell to the wreckmodell when the unit dies, this change-over is mostly hidden within an explosion/smoke. so couldnt there be a better solution - something like morphing?
Re: smoother change-over from unit to wreck
Write your own transition in the Killed function of the script.
Re: smoother change-over from unit to wreck
so its mod-side and not engine-related?
-
- Posts: 916
- Joined: 27 Jun 2009, 01:32
Re: smoother change-over from unit to wreck
The unit always simply will be replaced by a wreck. You can make the model do a breakdance if you want to before it's exchanged by the wreck model but that's it - you currently cannot morph or deform it so the shape will be the same as the one of the wreck...
Re: smoother change-over from unit to wreck
Well, you could if you made sure that the wreck was a form that you could contort the model into using unit-script... but texture would still be a problem, since you want the wreck's skin to be noticably different from the unit skin, and that sudden jump would be hard.Master-Athmos wrote:The unit always simply will be replaced by a wreck. You can make the model do a breakdance if you want to before it's exchanged by the wreck model but that's it - you currently cannot morph or deform it so the shape will be the same as the one of the wreck...
But yes, not enough mods properly mask the transition with explosions.
Re: smoother change-over from unit to wreck
You could write the morphing animation yourself. Place the pieces in the same position as the wreck, and use one the lua function to draw unit with a given texture to smoothly grey it. Sure, that would require some work, but so would implementing it a engine level.
-
- Posts: 916
- Joined: 27 Jun 2009, 01:32
Re: smoother change-over from unit to wreck
So there now is a working command for changing a unit's texture or are you talking of replacing the unit by a dummy one and doing so several times to get an animation effect?
Re: smoother change-over from unit to wreck
couldn't you shade it without swapping the texture?
Re: smoother change-over from unit to wreck
I don't know which way and which command would be best exactly, but I know you can draw the same unit, with pieces placed the same way, with different color, texture, size,...
For instance KDR_11k surrounded units by a green striped texture as KP's firewall graphical effect. Or just take one of trepan's highlight's widget and make it more and more solid.
For instance KDR_11k surrounded units by a green striped texture as KP's firewall graphical effect. Or just take one of trepan's highlight's widget and make it more and more solid.
-
- Posts: 916
- Joined: 27 Jun 2009, 01:32
Re: smoother change-over from unit to wreck
I only can recall a discussion about texture swapping with the result being that this isn't really possible. It was meant to e.g. swap between textures showing a different damage level. If there recently have been added new functions making this feasible please say so...
Re: smoother change-over from unit to wreck
It's not texture swapping, it's redrawing over with another texture. Here is for instance an unit going progressivly grey:


Re: smoother change-over from unit to wreck
that may work, but wouldnt it be easier to implement a command to the engine for that, i mean nearly all mods would benefit from thatzwzsg wrote:It's not texture swapping, it's redrawing over with another texture. Here is for instance an unit going progressivly grey:
Re: smoother change-over from unit to wreck
a generic algorithm that takes as input a model and a wreck model, and creates a nice morph animation from one to the other seems practically impossible to me. if the algorithm only takes the model, and creates a transition animation plus a resulting wreck model (at runtime or at "compile"-time, by the modder), it could be possible, but i guess that would be a really hard thing still.
Re: smoother change-over from unit to wreck
It would be easier for you, because you would not have to do it, but harder for the engine dev, because they would have to do it, and harder for the other mod dev, because they would have to jump through hoop to disable or tweak the automatic system to their need.that may work, but wouldnt it be easier to implement a command to the engine for that, i mean nearly all mods would benefit from that
In fact it would be harder to do at engine level, because the engine would need a generic solution, working for every kind of unit and wreck. It would have to magically invent the transition, the effect, the texture, and in a way that never bugs and always look good no matter how special the unit is.
When done at mod level, you have the liberty to create custom models, add some pieces, modify and supply textures, suited to your units.
If it was done at a mod level, and other modders liked it, they could still copy'n'paste the gadgets and scripts.
Re: smoother change-over from unit to wreck
Clarification, we have death scripts now?
Re: smoother change-over from unit to wreck
Total Annihilation had a death script in the form of the Killed() function in .bos. However, it had one major limitation: it had to be instant. You could not have animation in it because the unit would be removed the next frame anyway.
In Spring, Killed can use wait-for and sleep, the engine will wait for Killed to finish to effectively remove the unit.
In Spring, Killed can use wait-for and sleep, the engine will wait for Killed to finish to effectively remove the unit.
Re: smoother change-over from unit to wreck
And wrecks are still one piece? Ie no opertunity to turn a turret to match it's pre death facing?
-
- Posts: 916
- Joined: 27 Jun 2009, 01:32
Re: smoother change-over from unit to wreck
Well you most certainly can make a wreck consisting of several pieces but you'll have problems to do anything with them as wrecks have no script and no unit-id afaik so I think even Lua might not help here...
Re: smoother change-over from unit to wreck
you could drop multiple wrecks
Re: smoother change-over from unit to wreck
Currently only overall unit heading and speed are inherited to the wrecks, not individual piece positions.
What the engine could do (and what isn't possible lua side now afaik) is inherit piece rotation from the unit and set wreck pieces to the same angles (provided unit and wreck pieces have the same names). Texture transition can be hidden somehow (explosions/smoke/other vfx), but the fact all the wrecks have the same piece positions is quite visible.
What the engine could do (and what isn't possible lua side now afaik) is inherit piece rotation from the unit and set wreck pieces to the same angles (provided unit and wreck pieces have the same names). Texture transition can be hidden somehow (explosions/smoke/other vfx), but the fact all the wrecks have the same piece positions is quite visible.