Make An Actor Collapse

Post » Sun Sep 20, 2009 4:37 pm

Hi. Is it possible to have an NPC collapse, as in, fall to the floor as if unconscious?

Id like to do this directly from the goodbye of a Topic to make it appear that the NPC has passed out (With fear in fact).

Iv looked at SetUnconscious, but this does not make the NPC fall to the floor in the way that I want, so its no good.

Any ideas

Cheers

MVK
User avatar
Ann Church
 
Posts: 3450
Joined: Sat Jul 29, 2006 7:41 pm

Post » Mon Sep 21, 2009 4:47 am

You could either use pushactoraway (easier to use if you want the NPC to directly get up after he collapsed) or an ability that damages fatigue by a huge amount (if you want the NPC to stay on the ground until you remove the ability).

For the first one use a script like this (me is the NPC ref, the script below would be on the NPC):

set me to getself
me.pushactoraway me -1

For the second one make a new ability with damage fatigue -1000 (or more if the NPC is super tough for some reason or has magic resistance) and add/remove it via script when desired (using the addspell/removespell functions).
User avatar
Trey Johnson
 
Posts: 3295
Joined: Thu Oct 11, 2007 7:00 pm

Post » Sun Sep 20, 2009 2:36 pm

That's excellent Phitt, thanks. I'm off to try things out!

Cheers

MVK
User avatar
Kahli St Dennis
 
Posts: 3517
Joined: Tue Jun 13, 2006 1:57 am

Post » Mon Sep 21, 2009 3:43 am

A slight problem!

I use: NPCREF.AddSpell NPCCollapseSpell to make the NPC hit the floor and it works wonderfully, however, to remove this from the NPC I use: NPCREF.RemoveSpell NPCCollapseSpell, but the NPC stays on the floor.

Worse is the fact that even when he's on the floor and supposedly out cold, the player can still talk to him. This is the same when the removespell is called.

Note: The spell is added at the goodbye of a conversation and works very well. The player then trots off and does a part of the quest before returning to the unconscious NPC again. The remove spell is done in the result script of a topic, which also advances the quest to send the player back to the unconscious NPC. Of course, he's not meant to be unconscious when the player gets back!

Any ideas? I need to stop the player from being able to communicate with the NPC once he's on the floor, but even more, I need the NPC to get back up and carry on with his current package when I remove the spell. Have I got something mixed up here or is there something missing?

Cheers

MVK
User avatar
jessica breen
 
Posts: 3524
Joined: Thu Aug 03, 2006 1:04 am

Post » Sun Sep 20, 2009 1:29 pm

I think I mixed up damage and drain. You need to use a drain fatigue spell, not damage fatigue. Drain will be automatically reversed once the spell is removed, while with damage the fatigue will return only slowly via normal fatigue regeneration...which could take a long time if the NPC has -1000 fatigue or less. Don't know about the talking issue, normally you shouldn't be able to talk to a NPC that is knocked out due to negative fatigue.

EDIT: If nothing helps you could put an onactivate block on him like:

begin onactivate

if isactionref player == 1
if getstage MyQuest == 30 ; stage during which the NPC is supposed to be unconscious

return

else

activate player

endif
endif

end

You could use other conditions as well instead like if getactorvalue fatigue < 0
User avatar
Farrah Barry
 
Posts: 3523
Joined: Mon Dec 04, 2006 4:00 pm

Post » Mon Sep 21, 2009 1:29 am

Thanks Phitt - The talking thing is bad but I could deal with that - it was returning to the room and finding the NPC still on the floor that's a real pain!

Cheer

MVK
User avatar
Tiffany Carter
 
Posts: 3454
Joined: Wed Jul 19, 2006 4:05 am


Return to IV - Oblivion