Jump to content

Creature respawn


exanimis

Recommended Posts

I have four creatures in cages in the secret basement of my Velld den Keep mod. When the player opens the cage the creatures will follow them. Killing the creatures in any area of the castle causes them to respawn in the same spot that they died in. I have tried to fix this with no sucess. Is there a way to make the creatures respawn back in their cages? Will a script or quest fix the problem? Sorry but I'm still crap with quest and script writing.

 

These creatures sometimes get out of their cages, is there a way to keep them in their cages?

Link to comment
Share on other sites

I have four creatures in cages in the secret basement of my Velld den Keep mod. When the player opens the cage the creatures will follow them. Killing the creatures in any area of the castle causes them to respawn in the same spot that they died in. I have tried to fix this with no sucess. Is there a way to make the creatures respawn back in their cages? Will a script or quest fix the problem? Sorry but I'm still crap with quest and script writing.

 

These creatures sometimes get out of their cages, is there a way to keep them in their cages?

Can probably be done using some scripting and packaging to work off faction ranks. Basically, make a faction to put the creatures in, give the faction 2 ranks, 0, and 1. With the packaging, make a travel to editor location package with a condition of rank 0. Make a follow package with a rank of 1. Label and make persistant all the cage doors. Make each door the parent of the creature inside. On the scriptiong of the creature, have something like this;

 

ref self
ref mydoor

begin gamemode
set self to getself
set mydoor to getparentref
if getincell <cell with the cages>
if mydoor.getopenstate == 1;; door is open
self.setfactionrank <creature faction>, 1
endif
endif
end

Begin ondeath
if self.getfactionrank <creature faction> == 1
self.setfactionrank <creature faction>, 0
mydoor.setopenstate 3
endif
end

 

That should do what you want. It should also keep the creature following you once released even after respawn unless it was killed. You could add a bit more functionallity with an activate block that toggles between rank 1, which is follow, and a new rank, 2 which could be used as the condition of a wander current location package.

Link to comment
Share on other sites

I think I must not have been too clear in my description. The creatures are guarding treasure chests that respawn. They follow if you run but they are attacking. I want them to attack when they are released from their cage but respawn back in the cage when they are killed, no matter where they are killed.

 

 

 

 

I don't want them to follow the player like a companion. This was my fault for not being clearer in my description sorry. I may still be able to use your advice VagrantO but I'll have to do a little experimenting. Thanks.

Link to comment
Share on other sites

I think I must not have been too clear in my description. The creatures are guarding treasure chests that respawn. They follow if you run but they are attacking. I want them to attack when they are released from their cage but respawn back in the cage when they are killed, no matter where they are killed.

 

 

 

 

I don't want them to follow the player like a companion. This was my fault for not being clearer in my description sorry. I may still be able to use your advice VagrantO but I'll have to do a little experimenting. Thanks.

Well, then the answer is pretty much the same. Place the creature inside the cage with an xmarker and a package telling them to stay put. Setup the door in the same way, make the door parented to the creature. Just don't do the faction thing, and make a few changes to the script.

 

ref self
ref mydoor

begin gamemode
set self to getself
set mydoor to getparentref
if getincell <cell with the cages>
if mydoor.getopenstate == 1;; door is open
self.setunconscious 0
self.startcombat player
endif
endif
end

begin onload
self.setunconscious 1
end

Begin onreset
mydoor.setopenstate 3
endif
end

Then you can script the chests to open the cage when activated by setting the cage door to be parent of the related chest

 

ref chest
ref mydoor

Begin onactivate
set chest to getself
set mydoor to getparentref
if mydoor.getopenstate == 3
mydoor.setopenstate to 1
endif
activate
end

 

Or, if you want all the cages in a room opened at once, make an activator in the room with a script that when the activator is activated, it will activate all the doors. And have the scripts on the chests just activate that activator.

Link to comment
Share on other sites

Thanks again Vagrant, I'm going to try it out in just a couple of minutes. Dang! you sure make things seem easy :biggrin:

I could make them seem hard if you wanted... It just usually doesn't end well.

 

No thank besides, I think that is a requirement for those who write tutorials.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...