Need help with a script

Post » Mon May 17, 2010 6:49 am

I am working on a magic effect script which involves resurrecting an NPC and making it so that they can no longer talk. Right now, I am using SetDestroyed, but that makes it so any quest items in their inventory become inaccessible, a potentially very annoying if not game breaking problem. I could make it so that all of their possessions are moved to the player or a container, but this would be inconvenient, as it would over encumber the player with items they don't want or force them to go somewhere else to get the things. What I need is a way to either move only their quest items to the player, or set them so that there is no talk option but they can still be pickpocketed and their corpse can be looted later. It would also be nice to have some way of changing their name in a way which references their normal name like the way the reanimate effect changes "RandomNPC" to "PlayerName's RandomNPC," and removing them from all factions they are currently a member of. This is not intended for an individual NPC. It needs to be compatible with any NPC in the vanilla game or in a mod, so I cannot just add a line to remove every existing NPC faction. Any ideas?

This is the first time I have posted here. If I am violating any rule about format or content, feel free to mention it.
User avatar
Lynne Hinton
 
Posts: 3388
Joined: Wed Nov 15, 2006 4:24 am

Post » Sun May 16, 2010 10:34 pm

The name changing thing sounds like it requires OBSE. Anyhow, you can probably get items off your minion by moving the items to a dummy container, moving the container to the player's position, then force-activating the container, then replacing the container in your dummy cell.
User avatar
D IV
 
Posts: 3406
Joined: Fri Nov 24, 2006 1:32 am

Post » Sun May 16, 2010 5:50 pm

I have OBSE. How would I use an OBSE function to to change the name of a specific reference instead of the base object?

Edit: I decided to make a spell to share items with my minion without having to activate it, but for some reason the cs wont accept part of it. Heres what i have so far. minion is the minion and corpseREF is a non respawning corpse in a dummy cell

scn MinionSharingScript

ref minion

begin scripteffectstart
set minion to getself
if ( minion.getequipped SkeletonBody == 1 ) || ( minion.getequipped ZombieBody == 1 )
minion.removeallitems corpseREF
player.activate corpseREF
else
return
endif
end

begin scripteffectfinish
corpseREF.removeallitems minion ;It dooesn't accept this line. It says corpseREF.removeallitems is an invalid command
end
User avatar
willow
 
Posts: 3414
Joined: Wed Jul 26, 2006 9:43 pm

Post » Mon May 17, 2010 6:37 am

An NPC's name IS the base ref name, so you do want to change that. The thing to watch is that the OBSE SetName result is not saved in the save game, so it has to be repeated in a quest script with
If GetGameLoaded   do renamesendif

which in turn means you need somewhere to store a list of NPCs to do that to. If your resurrection is time-limited, it may be reasonable to make the player repeat it when they reload the game from a save. I.e the NPC is dead again, and you have to re-cast. It also gets easier if you can only have one resurrected NPC in your control at any time, just you can only have one summoned creature.
User avatar
FABIAN RUIZ
 
Posts: 3495
Joined: Mon Oct 15, 2007 11:13 am


Return to IV - Oblivion