Can OpenMW make NPCs activate doors that load to other cell?

General discussion regarding the OpenMW project.
For technical support, please use the Support subforum.
Post Reply
zelazko
Posts: 25
Joined: 07 Aug 2019, 18:01

Can OpenMW make NPCs activate doors that load to other cell?

Post by zelazko »

TES Construction Set does not allow NPCs to use load doors that lead to other cells can OpenMW do it? On OpenMW it does not crash at least.

Code: Select all

begin SeydaNeenAIRadiant

if ( GetPCCell "Seyda Neen" == 1 )

endif

If ( GameHour >= 17 )
	If ( GameHour <= 19 )
		"fargoth"->AiTravel, -11950, -67910, 3130
			"fargoth"->AIActivate ex_nord_door_01
	endif

elseif ( GetPCCell "Seyda Neen" == 0 ) 
endif
	if ( GameHour < 17 )
	if ( GameHour > 19 )
	"fargoth"->PositionCell, -11990, -67690, 3115, 0, "seyda neen"

endif
endif
end
I've been messing with scripting a little. This makes fargoth to travel at his door step but he keeps walking in front of his door like he never reached destination. When I added

Code: Select all

 "fargoth"->ForceRun
to help Fargoth overcome high door step obstacle between AiTravel and AiActivate he started to run into wall of the Census Exercise Office to the side that leads to the lighthouse. Guess I need to tinker more with persistence references or something because there are bunch of doors with the ID ex_nord_door_01 in Seyda Neen cell.

Moving about Fargoth with

Code: Select all

PositionCell
work the best but it's lacking the grace of living AI.

///EDIT: You can't make NPC activate doors that load to other cell with OpenMW. I managed to get Fargoth activate the doors but you only hear the locked door sound (the door was unlocked). He keeps activating it like every 10 seconds but the poor guy can't go through the door.
User avatar
Jemolk
Posts: 237
Joined: 20 Mar 2017, 02:12
Location: Sadrith Mora

Re: Can OpenMW make NPCs activate doors that load to other cell?

Post by Jemolk »

A thought -- perhaps you could make them move up to the door and then run PositionCell? That seems like it might do a decent job of simulating living AI with scripts, if that's what you want. If you wanted to go deeper, you could run an animation that has them reach for the door, and use PlaySound for the relevant door opening sound.
User avatar
akortunov
Posts: 899
Joined: 13 Mar 2017, 13:49
Location: Samara, Russian Federation

Re: Can OpenMW make NPCs activate doors that load to other cell?

Post by akortunov »

NPC's can not use teleporting doors, as in Morrowind. An attempt to teleport actor to non-active cell during AI update leads to undefined behaviour.
User avatar
Mistahtokyo
Posts: 139
Joined: 07 Sep 2013, 18:31

Re: Can OpenMW make NPCs activate doors that load to other cell?

Post by Mistahtokyo »

akortunov wrote: 20 Sep 2019, 04:31 NPC's can not use teleporting doors, as in Morrowind. An attempt to teleport actor to non-active cell during AI update leads to undefined behaviour.
Doesn't OpenMW preload adjacent cells? And how do games like Skyrim handle it, out of curiosity?
User avatar
AnyOldName3
Posts: 2671
Joined: 26 Nov 2015, 03:25

Re: Can OpenMW make NPCs activate doors that load to other cell?

Post by AnyOldName3 »

Preloading just means the cell's data is in memory instead of on-disk. It doesn't mean we're actually processing anything about the cell.

There are a few ways Skyrim might work. For example, it could just have a collection of actors that are waiting to be placed in each cell next time it's visited, and when you move an actor to an inactive cell, it's added to that cell's collection and kept there until you visit the cell, whereupon it's actually added to the scene properly. It could also have a more complicated system where it partially simulates inactive cells, or anything in between.
User avatar
AnyOldName3
Posts: 2671
Joined: 26 Nov 2015, 03:25

Re: Can OpenMW make NPCs activate doors that load to other cell?

Post by AnyOldName3 »

I've asked someone who knows, and the later games just set the position and rotation directly on the actor, and then adds the actor to the cell's reference list. I don't imagine that this would be hard to replicate at all if we weren't trying to be Morrowind right now.
Post Reply