View Full Version : Remedy: A coding question for you
Maddieman
09-04-2002, 10:36 AM
I will keep bumping this thread up until I get a satisfactory answer. graemlins/tinyted.gif
I am aware of the following projectile/death animations:
random 1
random 2
random 3
random 4
shotgun 1
shotgun 2
burning 1
burning 2
grenade 1
falling 1
custom 1
custom 2
(Excluding their equivalent wounded and two handed animations)
I know how to activate the first eight through the projectiledeath cause parameter (in the projectile text files). I can also activate the burning and grenade ones through the P_Explosion command.
However, I'm having difficulty with the falling and custom deaths. I'm correct in thinking that the custom death animations are used for placing corpses in levels; and the falling death animation starts if the enemy hits the ground from a fall, right?
Where is the code for playing the falling animation?
Can I trigger the custom animation outside of MaxEd?
Even better, is there a way to use them in projectile code; so that I can do: If killed by projectile, cause of death = custom/falling?
Finally, is it possible to add custom death causes, or is it integrated into the source code?
I want to use the two animation slots like the shotgun and burning ones, to give me a bit more flexability for my dynamic gibbing engine.
Also, while I've got your attention, could you also look at this problem (http://forums.3drealms.com/cgi-bin/ultimatebb.cgi?ubb=get_topic;f=18;t=001616) too, please?
Any help is appreciated. images/icons/cool.gif
[ 09-04-2002, 10:47 AM: Message edited by: Maddieman ]
Ken_Y
09-04-2002, 04:02 PM
Hey what's up Maddie,
ya I think you got it all right so far. The random and shotgun deaths are triggered with projectiles and the burning and grenade deaths triggered by explosions. But through my experiences, the falling and custom deaths cannot be triggered through the scripts (unless they are undocumented?). I think the falling death is internally triggered based on a character's downwards velocity. Actually, yes I just tested this, you can make an enemy do a falling death animation by bringing them up into the air and then sending them back down at a very high velocity (eg. c_jump(500), and the one or two frames later do a c_jump(-1000)). However, it is not very reliable, it's kind of ugly, and it also doesn't really solve the original problem because there's no easy way to send messages to an enemy character like that (I've found one way, but it's not at all trivial and it's very costly).
Anyways, I guess there's no documented way of using the falling and custom deaths in the way you (and me too!) would like. Also, adding in your own animations and death causes is beyond the scope of the scripting unfortunately graemlins/doh.gif But then again, most of the new things I come across are through experimenting and trial and error with different effects. You never know I guess images/icons/wink.gif
Ken
Maddieman
09-04-2002, 06:06 PM
Thank you, Ken! images/icons/smile.gif
Well, it's as I expected. I guess it can't be done after all. images/icons/frown.gif
This is going to seriously reduce the possibilities of the katana mod - for the time being images/icons/wink.gif
I realised that I can sort of trigger the 'custom' death animations (it apperars that there are two seperate ones) with the C_kill command:
C_Kill ( int animationIndex );
Kills a character immediately (no blending). Use to create dead bodies in the beginning of level. Accepted values: 1 and 2.
<font size="2" face="Verdana, Arial">I think this means I can trigger either animation at will.
But as you said, the main drawback is the inability to send messages to characters outside of the skin/skeleton code.
Well, I'm not going to give up just yet. I'm working on a few ideas to work around the problem, so maybe I will be able to come up with an adquete solution. images/icons/smile.gif
[ 09-04-2002, 06:08 PM: Message edited by: Maddieman ]
Daedalus
09-06-2002, 08:45 AM
Have you tried to execute this C_Kill command via console during game? If it works via the console then you can be pretty sure that you can trigger it within your custom scripts. Ofcourse you have to consider that some commands don't work when executed in certain scripts like e.g. the "globalconfig.txt" script. But the standard rule is: if it works via console then it works via script, too.
[ 09-06-2002, 08:48 AM: Message edited by: Daedalus ]
Maddieman
09-06-2002, 11:08 AM
Thanks, I was going to mention that, however there is a problem.
In the scripts you can only refer to a character with the reciever "THIS" which is fine the console and the skins/skeleton code; but in the projectile code 'this' refers to the projetile - so it wont work.
Thanks anyway. images/icons/smile.gif
LJHalfbreed
03-05-2003, 09:23 PM
Yes, this is a bump from a minorly old thread, but I'm trying to find out something.
Has anyone from Remedy specifically stated "There is no way to implement new death animation sets because of X" or are we just guessing at each other?
I'm just asking because I got a new animation set to 'call' the random death animations with a different projectile. I'm not sure if there is a .h or txt file I'm missing, but it would very likely seem that they allow all the editing/adding of newly defined animations. What would be the file(s) needed to cause the engine to say "Okay, these animations are part of this projectiledeath set"?
I'm scooting through code looking for calls to the various animation ID's, and it's rather rough. It looks like there's a minor bit of code that 'randomizes' the random parts (between the 2 or 4 different animations within the set) to call up the different anims as necessary. Combine the randomizer with the fact that there are an AWFUL lot of calls/ID's flying around that are extremely similar, and you can see the annoyance factor rising exponentially.
Now I'm just trying to figure out something. Why would there be a file like projectileanimID and basically have no real use for it? Somewhere there *has* to be a way, even a hack, to force the engine to notice the new projectiledeath set and it's associated ID numbers.
Case in point:
</font><blockquote><font size="1" face="Verdana, Arial">code:</font><hr /><pre style="font-size:x-small; font-family: monospace;"> #define PROJECTILEANIM_DEFAULT 0
#define PROJECTILEANIM_RICOCHET 1
#define PROJECTILEANIM_EXPLODE 2
#define PROJECTILEANIM_FROZEN 3
#define PROJECTILEDEATH_RANDOM 0
#define PROJECTILEDEATH_SHOTGUN 1
#define PROJECTILEDEATH_BURNING 2 [/code]</blockquote><font size="2" face="Verdana, Arial">This is that file. It's extremely small and rather useless to me. Common sense would dictate that either:
A.) A simple addition of a fourth definition to the end defining a new projectile death and it's ID would work perfectly.
B.) the code is incomplete, and for whatever reason, the falling, grenade, and custom deaths were left out of this list and need to be added before the player-made projectiledeath would work in-game.
My testing has shown that the first solution isn't valid. Using
#define projectiledeath_newanim 3
seems to confuse the engine and force it to use the last known valid projectile death from those available in that file. There is no link between the new projectiledeath and the animations that are assumed to be associated with it.
The second set of testing involved defining the newanim projectiledeath with an ID of 6, allowing room for possible dead ID slots. This solution was also found to be invalid, however, it was a step forward because all calls for projectiledeaths referred ONLY to the randomdeath set. Again, there was no link between the new projectiledeath and the new animations, but the calls were specifically using randomdeath anims.
I'm currently trying to figure this out, because I honestly think that it's possible to allow these animations to work correctly. There could just be an undocumented aspect that we don't know about or was somehow overlooked for whatever reason. I'm using my own resources to look well within the functions being used to try and locate such a instance. Unfortunately, I might possibly be overstepping my EULA agreement with the methods I am using.
So, to protect myself and help those around me, could someone from Remedy explain the above in some aspect and give an answer as to whether it's possible to incorporate new deathanimations as VALID projectiledeath calls?
PLEASE!
Thanks.
-LJ
PS. Does anyone from Remedy come around anymore, or is this just another lost cause I'm fighting for?
SkavenRMD
03-06-2003, 02:58 AM
The projectile death causes are hard-coded into the engine and new causes cannot be added, only existing ones modified. However, every skin can have its own custom death animations.
Maddieman's list of death causes is more or less complete, and his assumption about the Custom deaths is correct: they were mainly used for corpse placement.
The falling animation and falling death cause are automatically called by falling from a height that crosses the falling / death height limit (defined in the scripts). It cannot be called in any other way.
Why is it programmed in this way? It's much faster to hard-code a feature, than make it content-driven. It was one of the decisions that helped to get the game shippable in time.
[ 03-06-2003, 03:05 AM: Message edited by: SkavenRMD ]
Maddieman
03-06-2003, 06:29 AM
Well, I guess that settles that, then.
Thankfully I found a workaround to steal an extra death animation... images/icons/wink.gif
Thanks Skaven.
[ 03-06-2003, 06:32 AM: Message edited by: Maddieman ]
Akari
03-06-2003, 09:27 AM
Of course then again you can make a new skeleton txt file ( maddieman.txt ) then define it in a skin.txt file. That way you can have new death animations. But then it will most likly get rid of the gunned to death ones, but if you want one for a Tenchu Kill then I say do that.
LJHalfbreed
03-07-2003, 12:23 AM
Fantastic! Yet, how depressing.
Skaven: Thank you very much for the quick reply. Much apologies for dragging you in here in the first place.
Okay, that settles it. It's not possible. Such is life.
-LJ
vBulletin® v3.8.0 Beta 3, Copyright ©2000-2008, Jelsoft Enterprises Ltd.