The Elder Scrolls Forums

TES Construction Set and Plugins >> General TES Construction Set

Pages: 1
qarl
Disciple

Reged: 05/07/02
Posts: 1111
Loc: Michigan
modCurrentFatigue => falling through th floor
      #2908781 - 08/09/04 06:43 PM

This is a weird problem. I have an NPC which I want to have sleeping until the player goes to sleep themselves, then when they wake up, the NPC wakes up. I do:

if ( NPC->getFatigue > -100 )
NPC->modCurrentFatigue -1000
endif

which works fine. She passes out and stays that way. But when I go to sleep, she falls through the floor (it's an interior cell.) I've tried to compensate by doing a setPos on her, but this causes her to coninually stand and pass out -not just stay sleeping. Anybody have any idea what's going on here? Why it only does this when I go to sleep, and what I can do about it?

--------------------
-qarl
@}-----;----
My mods
WIP: The Underground
Tutorials

Post Extras: Print Post   Remind Me!   Notify Moderator  
Miles_Acraeus
Master

Reged: 08/24/02
Posts: 7891
Loc: Primum Mobile
Re: modCurrentFatigue => falling through th floor [Re: qarl]
      #2908828 - 08/09/04 06:55 PM

That is odd. Have you tried to add something like a "feather" or "levitate" effect while the NPC is sleeping? What about placing a collision box under the bed (or where ever). I have used this for actors before, but I was never in the same cell, and what you're trying to do worked.

I suppose FixMe and RA wouldn't work, since it "remembers" the vertical axis of the actor and the engine wants to reset them that way, and thus replaying that knockdown animation ad nauseum.



--------------------
"Just some spittle in your face." ~ Vladimir Harkonnen



Post Extras: Print Post   Remind Me!   Notify Moderator  
qarl
Disciple

Reged: 05/07/02
Posts: 1111
Loc: Michigan
Re: modCurrentFatigue => falling through th floor [Re: Miles_Acraeus]
      #2908884 - 08/09/04 07:07 PM

I tried levitate but not feather. I didn't try the collision box under her, but the bed and the floor already have collision on them -but it's worth a try. It's weird, she's sleeping on the bed, but she doesn't just fall through the bed and the floor straight down the z-axis, she moves to the middle of the room and is standing half-way through the floor and passes out so she's a couple feet beneath the floor. (I toggled collision off to go under the floor and look at her.) I wonder if she's being reset or something, but I don't know why she'd be reset to the middle of the room, half-way through the floor. Hmm, maybe I should try moving the whole room to where she ends up.

--------------------
-qarl
@}-----;----
My mods
WIP: The Underground
Tutorials

Post Extras: Print Post   Remind Me!   Notify Moderator  
Simpleton
Acolyte

Reged: 07/02/04
Posts: 138
Loc: Earlham College, Richmond, IN
Re: modCurrentFatigue => falling through th floor [Re: qarl]
      #2908909 - 08/09/04 07:13 PM

when you sleep the game moves people around to give you the impression time has passes. It probably also wakes people up, and perhaps there is a bug that causes them to be placed in the center of the cell. Only thing I can think of is when the player wakes up place her on the bed and play the get up animation or something.

--------------------
Do you have a burning desire to give me money?
Click Here to Donate

Post Extras: Print Post   Remind Me!   Notify Moderator  
qarl
Disciple

Reged: 05/07/02
Posts: 1111
Loc: Michigan
Re: modCurrentFatigue => falling through th floor [Re: Simpleton]
      #2909032 - 08/09/04 07:38 PM

That makes sense. Well I tried moving the whole room and she's still in the same spot in the middle of the floor even though I sank the room by about 100 negative z. unfortunately, when I wake up, she's already standing even though her fatigue is under -100, so I can't really do the standing up animation, because she's already up. I guess I'll just make it so when the player goes to sleep, she has a steady setPos on her position making her stand there and make it seem like she woke up just before I did.

One thing I figured out while doing this, is I needed to make her walk toward me but not in a hostile way. since move and moveWorld don't accept variables I couldn't direct her toward my position. (And I wanted her to walk much closer than AIFollow does.) So I made an activator under the floor which does a constant setPos for the x,y coordinates and put an AIActivate on her. It works perfectly. Just thought I'd mention this in case someone wanted to do something similar.

--------------------
-qarl
@}-----;----
My mods
WIP: The Underground
Tutorials

Post Extras: Print Post   Remind Me!   Notify Moderator  
Archived User Account

Re: modCurrentFatigue => falling through th floor [Re: qarl]
      #2911279 - 08/10/04 08:09 AM

Would aiwander 0 0 0 0 work.
That way the game would not want to move her.

Post Extras: Print Post   Remind Me!   Notify Moderator  
Erstam
Initiate

Reged: 06/22/04
Posts: 57
Re: modCurrentFatigue => falling through th floor [Re: qarl]
      #2912156 - 08/10/04 01:59 PM

I've worked on similar things (making NPCs sleep in their beds at night) using the knockout method, and it has given me lots of trouble as well. I haven't encountered your problems with the NPCs being displaced or falling through statics, but that "standing upright though fatigue is below zero" issue sounds very familiar to me. It occured under certain conditions, sometimes after leaving and reentering the NPC's cell. They didn't collapse properly after they had just finished an AITravel command (but after they hello'ed it did work).

What I've found is that the knockout animation only gets updated properly when the NPC is in combat state. First tried "StartCombat player" after setting fatigue below 0, but this wouldn't let the player rest near the NPC. My final solution was to place a hidden combat target far away in the same cell and make the sleeping NPC "attack" that critter. Large distance is important, otherwise you'll get the "There are enemies nearby" message even though the player isn't involved in that fight.

I ended up with some quite complicated code (as a rather general solution that differentiates whether they are in a currently loaded cell or not, including waking up by themselves or by the player), but at least it works.

Post Extras: Print Post   Remind Me!   Notify Moderator  
qarl
Disciple

Reged: 05/07/02
Posts: 1111
Loc: Michigan
Re: modCurrentFatigue => falling through th floor [Re: Erstam]
      #2912947 - 08/10/04 05:47 PM

Thanks for the replies guys! Nope Cortex that doesn't work either. Erstam, that is bizarre, but it sounds sort of like the flee thing which doesn't kick in unless the NPC is in combat. But currently she does fall asleep until I sleep. I've pretty much got that part worked out, I'm just having her get her fatigue restore right when I wake up so it looks like she gets up when I do. and to prevent the falling through the floor thing, I just have a setPos in a loop making her stay put. But in another cell, we enter together and usually it's right after combat and she still has her sword drawn. That's when I really need her to faint and she doesn't. I'll try you combat trick with having her attack a far away creature.

--------------------
-qarl
@}-----;----
My mods
WIP: The Underground
Tutorials

Post Extras: Print Post   Remind Me!   Notify Moderator  
Pages: 1


Extra information
1 registered and 2 anonymous users are browsing this forum.

Moderator:  Umrahel, Freddo, Pete, Hungry Donner, Attrebus, Miltiades, tegger 

Print Thread

Permissions
      You cannot start new topics
      You cannot reply to topics
      HTML is disabled
      UBBCode is enabled

Rating:
Thread views: 76

Rate this thread
 
Jump to

The Elder Scrolls Homepage

*
UBB.threads™ 6.3

Click for Privacy Statement 2003 Bethesda Softworks LLC, a ZeniMax Media company. All Rights Reserved.
PRIVACY POLICY | TERMS & CONDITIONS | LEGAL INFORMATION | CONTACT US