Skip to content

Holy crap. Sometimes they come back.

chimericchimeric Member Posts: 1,163
I've always wanted something like a real Animate Dead spell, but you know how that's impossible, right? Well, I didn't know it quite as confidently, so just to be absolutely sure I went and added this to baldur.bcs:
IF

NextTriggerObject(Protagonist)
See(SecondNearest)
HP(LastSeenBy(Protagonist),0)

THEN
RESPONSE #100

ActionOverride(Protagonist,ReallyForceSpellRES("NIK---",LastSeenBy(Myself)))

END
I wrote "SecondNearest," because I had thought I remembered someone telling me that Nearest without further specifications is always going to be the active creature itself. "NIK---" is a spell I had thrown together, with Dead actor as the target and Raise Dead in the effects. The code, I agree, is crap. Still, I put this in baldur.bcs and had my character walk around the middle of Beregost, which is my experimentation lab, strewn with bodies and equipment of... unsuccessfuls. I had to shoo the other party members away so the hero could maneuver to a point where one of the bodies would be a SecondNearest. It was going to be completely useless, but I gave it a minute of my time...

And Sarevok got back on his feet.

There were a couple of Sarevoks lying around, actually custom creatures, but I like that avatar. And one stood up. And then another one. They walked up to me, just as they had done in their former life. Then... nothing. The spell goes off with a sound, and it rumbled a few more times, but no one else pushed off the pavement. Well, the code is awful, and relying on sight isn't the best idea, and so on and so forth.

Still...

:*

Comments

  • chimericchimeric Member Posts: 1,163
    edited December 2016
    I found out that the Sarevok animation is somehow special. Any creature with that animation can come back from the dead, but none of the variety of others I've tried do. It definitely is the animation - like a yes/no switch.

    I don't even have to choose "Dead actor" for a creature with the Sarevok animation. I can leave it at "Any point within range" ("Living actor" doesn't work) and just put Raise Dead in the effects - or even Current Hit Points Bonus with the "Raise dead" box checked. That's a very interesting box.

    What can be so different about those files? The secret of immortality is in there somewhere. Something about the avatar mechanics of Sarevok lets him come back.

    I know it's not in the ini file of the animation - I had the entire text there replaced from another file, and it made no visible difference vis-a-vis resurrection.

    I also know the game takes account of the creature's death. It counts off the dying creatures by the script name, with NumDead, and if I raise some, the total drops.

    Mysterious.

    :D
    Post edited by chimeric on
  • The implications of this are monstrous .... -ly enticing. Aha. Ahaha. Ahahahaaaaa.

    Seriously, this is absolutely amazing. Necromantic research at its finest (an apt description, really, given that you're working with twenty year old code). Perhaps, in time, this animation effect could become a much more interesting Animate Dead spell than the standard one, which mysteriously summons skeletons out of the ground.
  • chimericchimeric Member Posts: 1,163
    edited December 2016
    Thank you. It was purely a lucky accident that the creature I tried to resurrect had the Sarevok animation, but everything I learned about it afterwards was from experimentation. I can add now that the animation - or any dead creature with that animation - behaves as if it is not really dead. It even runs scripts, at least some. I was able to get it to join the party (with the force join mechanism from "Do anything"), and it appeared with 0 hp. I did not notice any special or suspicious features about the creature itself in the GAM file.

    If raised and killed again, and kicked out of the party, a Sarevok can be resurrected again by targeting the body, and so on ad infinitum; like all creatures who had been in the party he receives the standard "So do you want me back in the party?" dialogue afterwards. But if killed with a Kill opcode or forced to do a Kill(Myself) action, the creature dies forever. This suggests that whatever makes the Sarevok animation special has something to do with hit points. Either he never goes below 0 hp and/or he "subsists" at 0 hp.

    I should also correct myself: regular corpses, without this sarevocity, are not seen or detected. They do not count as Nearest, SecondNearest or anything else. The spell that I had set up to go off automatically and make a noise was simply fired off too quickly by the engine. The game does that. But it was only thrown at the Sarevoks...

    But this is as far as I can take this myself. I've never poked inside creature animations and don't know how they work. There are people around here who have, so they are better placed to look at what makes Sarevok tick.
  • ArdanisArdanis Member Posts: 1,736
    That's the engine stuff, as far as I'm aware. Centeol was/is another bugged animation.
  • Hmmm. So if his sarevocity could be extracted and injected into other sprites ...
  • chimericchimeric Member Posts: 1,163
    edited December 2016
    That's the idea. The important part is that the creature with this feature does count as dead, so it shouldn't ruin any triggers. And, @Ardanis, let's not rush and call everything we don't understand "engine stuff" or, what is the same thing, "the will of God on high," shall we? If people did that consistently, we would still live in caves... Who is Centeol and what is the problem with it?

    Edit: Just now I was going through the different animations, killing and raising them one by one to see if anyone else will come back as Sarevok does. It's too much work this way, but I discovered that Volo is immune to killing with Ctrl+Y. He doesn't notice it, even though the bottom window declares the creature's death - and this can be done any number of times.

    I don't want this thread to go off course and turn into shoulder-shrugging about all of the irregularities of the IE and animations in particular, and then end nowhere. I mention these things because there has to be an explanation in there somewhere. There is no magic here, that's for sure. Animations are just images for different movements, you and I can draw them. But then they are somehow combined and edited so that any creature with that avatar can have extra "natural" properties like certain sounds or, say, magic resistance. That is over and above anything in the INI file for the animation or what the CRE file contains. So if you want someone to be immune to magic, use Ctrl +6/7 to scroll to the Burning Man animation and then try to blast that one. These and other properties - and the reason why Sarevok lives in death - are buried in this stuff like Pharod's Bronze Sphere, but it's going to take an expert on animations to dig them up.

    I've done all I can and I'm going to rest my case here.
    Post edited by chimeric on
  • ArdanisArdanis Member Posts: 1,736
    In short, a couple sprites are known to have had slight issues with dying, which may well result in what you just observed. Point being, such behavior is unintentional at best, and bugged at worst. Although, I guess that wouldn't dissuade you from trying to exploit it :D
  • kjeronkjeron Member Posts: 2,368
    The starting area of IWD is full of such sprites(the sitting customers). Makes it a difficult and inconsistent place to test things.
  • chimericchimeric Member Posts: 1,163
    I have only one question left: how is it possible for sprites to have any special properties at all, intended or not, if they are just collections of BAMs with frame cycles?
  • CrevsDaakCrevsDaak Member Posts: 7,155
    It's not in the sprite themselves, it's in their entry number and it's probably an engine thing as well.
  • chimericchimeric Member Posts: 1,163
    By the entry number, what do you mean? And "an engine thing" doesn't really explain anything. To approach it from the other end, how did the developers go about giving the Burning Man animation 100% magic resistance? I doubt that they edited the Infinity Engine itself to apply that effect whenever one switches to that animation. If they could do that, they could probably give us a lot more modding options than we have.
  • ArdanisArdanis Member Posts: 1,736
    edited December 2016
    You're already familiar with ids files, yes? I.e. GOODBUTBLUE entry in ea.ids corresponds to the value 29, and whenever the actual code is concerned (that is, inside the compiled executable), it uses 29 in its functions. Similar with animation slots, the Sarevok one is linked to the number 0x6404. You can probably replace the animation files (BAMs) for Sarevok with, say, goblin, and it'd still remain detectable after death, because the engine only cares about that number, not the graphics files associated with it.

    To approach it from the other end, how did the developers go about giving the Burning Man animation 100% magic resistance?

    If merely switching the animation gives the resistance, as you say, then as baffling as it is to me, I suppose it was hardcoded for some unknown reason. Unknown because the same effect is usually achieved by applying the resistance via EFF, without bloating the executable with more checks.

    I doubt that they edited the Infinity Engine itself to apply that effect whenever one switches to that animation.

    ToB's limit of one planetar/deva and seven traps was enforced exactly like that, via hardcode. Only it was checking for CRE/PRO file names rather than ids entries.
  • KuronaKurona Member Posts: 881
    edited December 2016
    What @CrevsDaak means is that certain sprite properties are most likely hardcoded based on the animation index. For instance Volo uses the animation 8448, and there's probably a chunk of code somewhere in the engine making this specific sprite number completely impervious to death.

    Edit: ninja'd
  • chimericchimeric Member Posts: 1,163
    edited December 2016
    Are these numbers from the INI file of the animation? I'm having some trouble with Near Infinity, so I can't very well check, but I seem to remember that the Sarevok animation's INI uses "animation type" 8000. It might be a different number. So where do you get the 0x6404 from, @Ardanis ? At any rate, I've tried pasting the contents of the INI file of Sarevok, including his 8000, in another animation's INI, hoping that some part of it would confer the immortality. It didn't, but it messed up the avatar in a curious way - the gestures and frames were doubled, so the creature had two sword arms and swords at once. One cycle was correct and the other not. It looked as if the INI was giving one set of instructions and something more permanent was dictating another.

    I did something else, too: put a non-existent number against Volo's animation in ANIMATE.IDS. Well, he shows up normally and keeps his property, which is, more exactly, complete immunity to damage from anything. Try it out next time you're in Nashkel.

    Anyway, this is obviously a moot point.
  • ArdanisArdanis Member Posts: 1,736
    So where do you get the 0x6404 from, @Ardanis ?

    Animate.ids.

    I did something else, too: put a non-existent number against Volo's animation in ANIMATE.IDS. Well, he shows up normally and keeps his property, which is, more exactly, complete immunity to damage from anything.
    Changing the index in ids doesn't change how it's processed by exe, so that's expected.
Sign In or Register to comment.