Jump to content
ℹ️ Intermittent Download History issues ×

Making changes to world out of player's view


csbx

Recommended Posts

This will be a basic question for many familiar with making mods that change the world in some way. But it's a basic kind of mechanic that I just haven't figured out yet.

 

So I'm looking for a way to make changes in the world but ensure that they don't manifest while the player is in the vicinity.

 

Example: conditional set so that an npc appears at a certain location once the player has reached level x. But what if the player reaches level x at the spot where the npc is appearing ? How do you set up the conditional, and then when its met, delay the resultant effect until the player is not watching, or not in the vicinity or ? What is the method by which this is normally accomplished ?

 

Just to provide another example. The Castle gets cleaned up. But the player never sees this. There is some conditional that must be met (e.g. player is outside of that cell area for a certain period of time) but it must include something so that the player never sees the dirty work.

Link to comment
Share on other sites

I don't use built in conditions much, but the script functions for this sort of thing that you can look for (from coarse to fine):

 

if thing_in_target_areaREF.GetParentCell().IsLoaded()

 

if thing_in_target_areaREF.Is3DLoaded()

 

if Game.GetPlayer().HasDetectionLOS(thing_in_target_areaREF)

 

& I am sure there are more ...

Link to comment
Share on other sites

In Skyrim this was a typical currier quest if you played it. The approach is based upon having a quest which starts from Location Change Event (not Start Game Enabled). The quest has a scene where NPC pops up and runs towards player and the spawning points were simply placed throughout the world(s) in a way where the player can't see a currier spawn, that to be behind the buildings and all that... it's a question of design mainly. Such quests are supposed to be handled by SM Event Node, you can set the conditions to be matched there just like when you set them up for a dialogue: what locations are valid to start the quest in, what level the player should be, ect.

 

Another approach is reliable only when you keep this NPC disabled at a certain location in the world until player reaches this location. And then you check the conditions to match and if you're satisfied, you enable the NPC and fire a quest. Though I must correct what SKK50 wrote. You see, using OnCellAttach() instead of checking whether the parent cell is loaded - is a much better way to pull it off. Thing is, cells can be loaded even if not present, they would be held in the memory, making any IsLoaded() and/or OnCellLoad() miss the target.

 

OnCellAttach(), on the other hand, operates less buggy in this regard. The event is fired when a cell gets attached, that comes before loading every 3d object in cell. Thus, it fires every time and not when mem stack is empty, plus you don't need to register and later check for LOS, because by the time the cell fully loads, your NPC will already be in there, it's not going to pop up out of nowhere all of the sudden.

Link to comment
Share on other sites

It sounds like the 'coarse' approach will suit my purposes. So let's say the trigger for this is in location x. So the player satisfies some condition--level check let's say. They're in location x. Now I want location x to change (e.g. enable some objects), so I can script this to happen the next time the player enters the area, and oncellattach() will get it done before the player is even loaded up ? This stuff is totally new to me so I'll probably be back if I can't get it done !

Link to comment
Share on other sites

Before every 3d object / high-res terrain in that cell is loaded, yes. So, by the time player enters cell, the game will already know it should load up your stuff alongside the vanilla cell, and not after the cell is loaded.

 

Try to google how cell attachment/detachment and load/unload operates. Can't remember where the article was.

Edited by werr92
Link to comment
Share on other sites

  • Recently Browsing   0 members

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