scale armor for everyone?

Post » Tue Aug 31, 2010 5:35 am

is it possible to use the "begin onEquip" on an unknown NPC, i am trying to make a suit of armor that scales an NPC or the player. so far the undirected scale script doesn't work, but it worked when directed at the player.
is there a universal "NPC/character" variable that i can use instead of "player"?
User avatar
Lori Joe
 
Posts: 3539
Joined: Tue Jun 20, 2006 6:10 am

Post » Tue Aug 31, 2010 4:04 am

I'm currently doing this with my Powered Power Armor mod, as of the last release. I don't actually use the onequip block, instead I just monitor whether the player/NPC has the armor equipped in a gamemode block, though there's probably no problem with doing it the other way (except that I don't think the onunequip block runs if an item is removed via script, which would cause problems with the MZ DLC). I use rContainer.setscale xx, where rContainer is the wearer of the armor, and xx is the scale. There are two issues to be aware of, though. Scaling the player up too much (I'm not sure what the limit is) will prevent them from activating some objects, like those food dispensers. You'll get a "Child cannot use this item" message. To get around this, use FOSE to continuously check if the player is pressing the activate key. If they are, set their scale again, once (or the game will crash when going through doors). This seems to work most of the time, though I've gotten a few reports that it doesn't work for some people. For NPCs, it seems that if you change their scale via a gamemode or onequip block, and probably menumode too, they'll become untargettable and unkillable until you've left and reentered the cell that they're in - something that's not likely to happen with Enclave and other enemy NPCs. To get around this, disable and then reenable the NPC a few frames after increasing their scale. This can be tricky, and causes problems with some scripts, particularly ones that check to see if an NPC has an item equipped. It would break compatibility with PPA, for one.
User avatar
Casey
 
Posts: 3376
Joined: Mon Nov 12, 2007 8:38 am


Return to Fallout 3