Jump to content


Photo

What can be done with dead creatures?


  • Please log in to reply
2 replies to this topic

#1 temnix

temnix
  • Member
  • 983 posts

Posted 13 August 2016 - 03:09 AM

So they died, and I want my invisible creature to look around and, if it finds any corpses with the right race and other such combination, replace them with living copies. I can't do it through any ActionOverrides, since the dead do not run scripts (yo way yo). So what action can I use from the invisible creature's script, or from an effect, and what can generally be done with dead things other than, as Miracle Max has suggested, searching their pockets for loose change?



#2 Roxanne

Roxanne

    Modder

  • Member
  • 3564 posts

Posted 13 August 2016 - 03:47 AM

So they died, and I want my invisible creature to look around and, if it finds any corpses with the right race and other such combination, replace them with living copies. I can't do it through any ActionOverrides, since the dead do not run scripts (yo way yo). So what action can I use from the invisible creature's script, or from an effect, and what can generally be done with dead things other than, as Miracle Max has suggested, searching their pockets for loose change?

a) You could do something completely different, like looking at the way it is done for Trolls, where when a troll dies he is actually replaced by another one (whom you need to kill with fire or acid). Adjust this to your design.

 

b) you could do something in the script of those to die like

IF
    Die()

Global("ANelfisdead","Global",0)
THEN
    RESPONSE #100

SetGlobal("ANelfisdead","Global",1)

END

and for your rescue guy use

IF

Global("ANelfisdead","Global",1)

THEN
    RESPONSE #100

SetGlobal("ANelfisdead","Global",0)

CreateCreature("Copyofadeadelf",[somehwhere])

END

Of course this is simplified - you could only use it for dedicated NPCs etc, not for a group of hobgoblins you kill and who are replaced by another bunch of ghost hobgoblins.

 

c) you can look at how the fission slime is coded, when you kill that one (without fire), it respawns two replacements.


The Sandrah Saga

another piece of *buggy, cheesy, unbalanced junk*

 


#3 temnix

temnix
  • Member
  • 983 posts

Posted 13 August 2016 - 07:03 AM

None of these will do, because I would have to alter the living creatures' scripts, and Sword Coast Stratagems is too widely beloved for me to mess in that field. I need some kind of more general solution that I could use from outside, on corpses. There is no unsetting the STATE_DEAD flag, is there? No way to restore a dead creature's hit points? In that case, I need a way to remove a dead creature, at least. That's probably doable, I just can't find an effect or action for it yet. Once the corpse is gone, I could create another one at the first one's location - either a copy of the first one or, if that's too complicated, something generic like one kind of spider in place of all dead spiders. That, in a nutshell, is just what I want to do.

 

I think I have two options for this spawning, once I've figured out how to remove the body. I'm a complete amateur at this, I confess, more so than with spell effects, which I'm gradually figuring out. The problem with doing this from a spell is that, as far as I can tell, Dead Actor-targeted spells only work on party members. Anyway, the two script possibilities from the G3 guide:

 

246 CreateCreatureAtLocation(S:GLOBAL*,S:Area*,S:ResRef*)
This action creates the specified creature at the specified saved location.

250 CreateCreatureObjectCopy(S:ResRef*,O:Object*,I:Usage1*,I:Usage2*,I:Usage3*)
This action creates the specified creature and sets its animation to that of the active creature.

Now, since the only way to look around for dead creatures, determine their races and so on seems to be from another creature's script, the first action requires that I somehow get 1) the dead one's location, 2) the dead one's ResRef. Can that be done? And the second action - does it work on dead creatures? This is something I can test myself, but it may be easier to just ask. And what are the Usage parameters?

 

P.S. Is it possible to have a dead creature join the party so I can use Dead Actor effects on it?