Targeting Specific References?

Post » Sat Feb 19, 2011 5:58 am

If I use

Ref Npc

blah blah blah blah

Set Npc to Getself


blah blah blah


end

Will that store the specific reference of that NPC so it doesn't modify the base object id? I want to be able to add armor and spells to it and modify it's attributes without disturbing the values or attributes of the base NPC that it comes from.

For instance, if Im walking on the road and I see a bandit, and I cast a spell that adds that bandit to a friendly faction, I want dont want every instance of that bandit in the game to be in that faction.

Any assistance would be greatly appreciated!
User avatar
Facebook me
 
Posts: 3442
Joined: Wed Nov 08, 2006 8:05 am

Post » Sat Feb 19, 2011 1:24 am

In that case, you might need to use CreateFullActorCopy to clone the form, and then make your changes to the new form.

Heavy use of this will create saved game bloat, but you can use DeleteFullActorCopy to remove the copies once they're no longer needed.
User avatar
zoe
 
Posts: 3298
Joined: Sun Nov 12, 2006 1:09 pm

Post » Sat Feb 19, 2011 7:45 am

The value of 'Npc' will be the Reference ID of the target creature.
The value in 'Npc' will only exist in that instance of the spell target. If 5 targets are hit, there will be 5 scripts running with 5 different values in 'Npc' and unique to each of their scripts.
The value stored in 'Npc' will vanish when the spell ends.

But there is no reason to use this since all functions performed in the script will effect that target Reference anyway.
User avatar
A Lo RIkIton'ton
 
Posts: 3404
Joined: Tue Aug 21, 2007 7:22 pm

Post » Sat Feb 19, 2011 7:49 am

If thats the case then why did the bandits all become friendly when I modified ones aggression?

and thanks for the feedback everyone!
User avatar
Valerie Marie
 
Posts: 3451
Joined: Wed Aug 15, 2007 10:29 am

Post » Sat Feb 19, 2011 9:24 am

Read the WIKI http://cs.elderscrolls.com/constwiki/index.php/SetFactionRank

Specifically:
The faction rank is set on the actor's base object as well as on the actor (reference) itself.

User avatar
Maeva
 
Posts: 3349
Joined: Mon Mar 26, 2007 11:27 pm

Post » Fri Feb 18, 2011 7:20 pm

Ok, Im having trouble with disable and enable...

When I modify the npcs value, and then disable and enable them, their stats get reset. This is bad, because they end up reappearing with different weapons and all the players hard work to upgrade their npc companion is lost.

I'm also using the Moveto command as well, to put them by the player.

Am I right to suspect the disable/enable commands?

Would it better to move the NPC to some dummy cell and then move it back when the time is right?


Im using the ModActorValue command to change the NPCS strength, is there a better command that wouldn't change the base value of the stat so future references of that npc aren't running around with an extra 20 strength?
User avatar
Jeremy Kenney
 
Posts: 3293
Joined: Sun Aug 05, 2007 5:36 pm


Return to IV - Oblivion