Jump to content

Scripted Spells


kingtitan

Recommended Posts

Is it possible to write a scripted spell that when cast on an NPC can force them to sit down on a specific reference (chair,stool, ect.)? Or along the same lines, a similar scripted spell that forces an NPC to use a bed or bedroll? If so, I assume it would somehow need to be able to select the reference within the interior cell, but I certainly don't know that for sure! Thanks for the help! Edited by kingtitan
Link to comment
Share on other sites

In my own experience populating the player owned homes with NPCs I've found that for them to use beds and chairs they need to be marked persistent in the CS. I haven't seen any slowdowns from doing that, but keep in mind I'm only changing a few items in each cell. If you were doing a vast cathedral or barracks for an army that might make a difference.
Link to comment
Share on other sites

You probably don't need to worry about the bloat in this case. It is not likely to cause noticeable lag.

 

I have one character I have been playing off and on for more than two years. I checked, and his save games are 6/10ths of the way to unacceptable bloat where problems could be expected. Skyrim will have been out for a year or two before these savegames reach a crisis.

 

The one thing you don't want to do is have a summoning spell that you use all the time that uses the PlaceAtMe command. That can cause measurable bloat and eventually make it so a savegame becomes unusable and the character has to be abandoned.

Link to comment
Share on other sites

Ok well if that is the case I can just mark them as persistent in my mods that I am using. The most annoying thing though is when you are using the CM partners mod, you tell your companion to go eat/sleep, ect. and the companion tries to find the furthest away bed or chair... That's what I would like to fix in the end. But is it even possible to script a spell that would tell them to go to a certain chair or bed or does that use the placeatme command?
Link to comment
Share on other sites

Instead of using PlaceAtMe, you can use MoveTo. That would slow, if not prevent, any bloat.

 

 

As for spells, I don't think they would work. As far as I am aware, most AI requires a persistent reference as a target - I don't think marking a bed with a scripted spell is possible.

 

If it is for one person following the player, then you could create a spell that moves the bed to your location. Otherwise, I'm not sure.

Link to comment
Share on other sites

You might be able to toggle an AI on the NPC with a magic script that will make them immediately look for a bed or chair in the cell they are in.

 

However, they will always choose the nearest one that they have permission to use (some beds are owned by NPCs or Factions).

 

This means you will have to go to each NPC you want the spell to work on and add the AI to them with a condition of something set by your spell script.

Link to comment
Share on other sites

You can use AddScriptPackage to force an NPC to sleep in a bed or sit in a chair. For an NPC to use a bed, obviously you will need to have the AI package be a sleep package. For an NPC to use a chair, that is slightly more complicated. There is no such thing as a "sit" package. But you can make an NPC sit if you choose "Near Reference" in the Location tab and then select a specific chair. I believe that it'll only work for the Eat, Travel, and Use Item At packages.

 

You can also try using a Find package, with chairs set as the target type. However, once the NPC activates the chair, then the Find package is "completed" so they'll re-evaluate their packages. This would only be useful if you want to see an NPC sit for a second and then get right back up.

 

If you want to be able to dynamically change the bed/chair that an NPC uses, you will have to use OBSE's SetPackageLocationData.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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