Xyzy Posted October 23, 2009 Share Posted October 23, 2009 I'm trying to make a script that automatically resizes any NPC/player that wears a certain armor (in this case the enclave power armor). The script works fine for the player, but I can't get it to work for NPCs. Here's the script: ScriptName ArmorEnclaveSize ref user Begin OnEquipset user to GetContaineruser.SetScale 1.2End Begin OnUnequipset user to GetContaineruser.SetScale 1End Thanks in advance. As you can probably see, I'm a real novice at scripting. Link to comment Share on other sites More sharing options...
deepside Posted October 24, 2009 Share Posted October 24, 2009 ScriptName ArmorEnclaveSize ref user--- not sure but here you have to fill in npc or the ref from the npc( it's probably a refscript) Begin OnEquipset user to GetContaineruser.SetScale 1.2End----- this has probably been changed in endif coz here you are ending the script( not sure bout this one coz you say it works for you) Begin OnUnequipset user to GetContaineruser.SetScale 1End i'm a noob at it too :confused: but it seems that you are activating your script and i think that the npc don't get the command to activate it gr deepside Link to comment Share on other sites More sharing options...
Pelinor Posted October 24, 2009 Share Posted October 24, 2009 Well, the script looks fine--and as you say, it works on the player. Are the NPCs equipping the item? That's the only time "SetScale 1.2" is going to work. If they start out with the item on, you'll want to try it in a GameMode block, like below. I also included a scale tracking variable so they can go back to their original scale if they weren't 1.0 to start with. ScriptName ArmorEnclaveSize float fScale reference rUser begin GameMode if rUser != GetContainer set rUser to GetContainer endif if rUser.GetEquipped ArmorEnclave if rUser.GetScale != 1.2 set fScale to rUser.GetScale rUser.SetScale 1.2 endif elseif rUser.GetScale == 1.2 rUser.SetScale fScale endif end Link to comment Share on other sites More sharing options...
Cipscis Posted October 25, 2009 Share Posted October 25, 2009 If you try calling GetScale on an NPC in the console, you might find that their scale is being set but their 3D data isn't being updated. If this is the case, then you should be able to use Disable and Enable in order to refresh their 3D data and force them to appear at the new scale. Cipscis Link to comment Share on other sites More sharing options...
Recommended Posts