Jump to content

DOWNLOAD MODS

Are you looking for something shiny for your load order? We have many exclusive mods and resources you won't find anywhere else. Start your search now...

LEARN MODDING

Ready to try your hand at making your own mod creations? Visit the Enclave, the original ES/FO modding school, and learn the tricks of the trade from veteran modders...

JOIN THE ALLIANCE

Membership is free and registering unlocks image galleries, project hosting, live chat, unlimited downloads, & more...

Weird Issues with Reanimation


Craddok
 Share

Recommended Posts

This is a weird one. So I've got a Necromancer NPC that casts a Touch reanimation spell on an NPC that's dead by default (health at zero in the editor). It took a while to get just that working properly (the game doesn't seem to like reanimating dead-by-default actors), but now it does. The new problem is that, after the reanimation takes place, if I reload a save prior to the reanimation, things get... weird. 

 

On that first reload, the dead NPC's model is properly placed and positioned (as it was in the Havok sim). But somehow in reloading the model got decoupled from the actual actor, which is now invisible, standing behind their own corpse. Yeah. After subsequent reloads, the same thing occurs, with the invisible actor behind their starting position, but the model of the body is drawn somewhere else, nearby. The body is positioned in the same way (animation-wise, not coordinate-wise), but might be on the floor ten feet away, or floating in the air beneath the room's ceiling, or sticking out of a wall.

Here's the code attached to the dead NPC to be reanimated. The Necromancer's own script activates the dead NPC before casting the Reanimation spell. I've tried calling Reset3DState all three blocks, just to be sure, but that's probably just affecting the animation position, not the weird decoupling. I'm considering using a MoveTo on Activate, before the reanimation, but again I'm not sure if that'll stop the decoupling effect.

ScriptName ESRenaSulScript


short doOnce
ref mySelf


Begin OnLoad

	set mySelf to getSelf

End


Begin OnActivate

	if ( doOnce == 0 )
		mySelf.setav health 0	;to reset Health change during previous loads
		reset3DState
		mySelf.setav health 100    ;Used to fix AI issues with reanimating an actor with 0 base health
		set doOnce to 1
	else
		Activate
	endif

End


Begin OnReset

	mySelf.setav health 0
	reset3DState
	set doOnce to 0

End

EDIT: Woah, how do I make the code segment not look terrible and unreadable?

Edited by Craddok
Link to comment
Share on other sites

*copy from regular notepad instead of the editing program your using?

 

Do you mean you have a game loaded and your playing, then you try to load another previous game without exiting the game?

 

Oblivion does NOT work well, especially with scripts, quests and actors when you do not exit the game. It has to do with clearing memory out before the new game is loaded. You will experience all sorts of problems if you do that a lot, especially with game quests and what-not.

 

(You may try exiting to the main menu instead, and then loading your game. That may work.

Link to comment
Share on other sites

Yeah, when loading without exiting. Too bad it's part of a game-wide issue. I did notice the problems the On Load block has with reloading without exiting (namely, it not running). And yeah, I knew I could circumvent the problem by exiting, but I was trying to eliminate the bug for the players' sake.

 

So there's no way real workaround?

 

As for the code segment, I just copied it directly from the CS editor into the forum's code tool. Strange that that doesn't work (well).

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...