Jump to content

Add item to NPC by race?


Recommended Posts

I have VERY LITTLE scripting knowledge, and i think this ought to be simple, but in my searches i cannot find a way to do what i want to with a script.
 
Here's what I want it to do.
 
Find every npc of a specific race within an area, equip them with an item (a tail, in this case) and somehow avoid causing a great deal of lag.
 
A player character furry is nice, but as an ambitious shithead, I want to replace all of one race with mice. (partially to see if i Can do the aforementioned tails automagically)
 
this is strictly a scripting matter, because unless I can put tails on the converted race, i don't wanna bother with aesthetics unless I'm sure this can work.
how simple is it to actually do this, and how much pressure would it put on the scripting?
 

 

 

post-156371-0-52709000-1434672778_thumb.png

Link to comment
array_var Entry
ref actor
 
Begin GameMode
 
    foreach Entry <- (GetRefs 42, 1) ; for each NPC in current or adjacent cell
        let actor := *Entry
        if actor.GetIsRace SomeRace
            if (actor.GetItemCount MyTail) == 0
                actor.AddItem MyTail 1
                actor.EquipItem MyTail
            endif
        endif
    loop
 
End

Stick that in standard delay quest and I don't think you'll have any performance issues. Optimally: Skip the loop and quest and use an actor OnLoad event instead.

Link to comment

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

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

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more information, see our Privacy Policy & Terms of Use