Find NPCs near player

Post » Tue Aug 06, 2013 12:22 am

I'm trying to add some effects to NPCs which are loaded up near the player.

So far I got this, it works on NPCs for the cell where the player is - but sadly thats just a small area.

Best would be to check all loaded cells, or have a list of cells in the location where the player is - dunno how to do that.

What I want is to add a spell to every NPCs as soon as they are attached to cells, without adding a script manually in creation kit on actor bases. I want it compatible with every monster mod.

Also I could make an invisible aura around the player to react with NPCs but dunno how much FPS it costs if I increase the radius to 10.000 or something. On my monster machine I can't measure the performance hit but dunno how weaker PCs behave.

Suggestions?

Actor player=Game.GetPlayer() Cell kCell = player.GetParentCell()Int iIndex = kCell.GetNumRefs(62)while (iIndex)    iIndex -= 1sp1.Cast(kCell.GetNthRef(iIndex, 62))
User avatar
FABIAN RUIZ
 
Posts: 3495
Joined: Mon Oct 15, 2007 11:13 am

Post » Mon Aug 05, 2013 11:32 pm

You could use a quest and use Find Matching Reference - In Loaded Area for the npc aliases.
User avatar
FirDaus LOVe farhana
 
Posts: 3369
Joined: Thu Sep 13, 2007 3:42 am

Post » Tue Aug 06, 2013 5:48 am

I try that. Also I found SkyProc patcher, which seems VERY powerfull. Java is no problem for me.

Is that tool known to have bugs, or be broken in any way? Would be easy to just apply a magic effect + script on NPCs matching my criteria that way.

User avatar
Minako
 
Posts: 3379
Joined: Sun Mar 18, 2007 9:50 pm


Return to V - Skyrim