Jump to content

setscale on NPC script


Recommended Posts

hello, i need help with a script

 

ok, so i created a script that makes you taller when you wear Power Armor but setting a player's scale also increases damage so i made a perk that gets added to you by the script that reduces damage to 90% because i set player scale to 110% to balance it and i made this script

 

scn TallerPowerArmorScript

 

begin onequip

setscale 1.1

AddPerk TallerPowerArmorPerk

end

 

begin onunequip

setscale 1

RemovePerk TallerPowerArmorPerk

end

 

and then i added the script to power armors

so i then i tested it out in-game, i wore a t-45 then i got taller so i thought woot it worked!

then i gave one to my companion but she didn't get taller

so now my problems is how to make this mod affect NPCs?

 

thanks in advance and sorry for bothering anyone

Edited by ghostrecon123
Link to comment
Share on other sites

Does this add the perk to you? Seems like you are running the functions on the armor not the wearer. Try setting a reference variable like "set me to getcontainer", then use me to run your functions against.

 

me.setscale 1.1

me.AddPerk TallerPowerArmorPerk

 

You might also try setsize as opposed to setscale. Pretty sure setscale doesn't update the collision to match the new dimensions.

Link to comment
Share on other sites

Does this add the perk to you?

i re-tested it and it turned out it doesn't add the perk on my character so i wrote the script like this

 

scn TallerPowerArmorScript

 

begin onequip

player.setscale 1.1

player.AddPerk TallerPowerArmorPerk

end

 

begin onunequip

player.setscale 1

player.RemovePerk TallerPowerArmorPerk

end

 

so then i tested it and now i get the perk and get taller but when i make other NPCs wear it they still don't get taller, is there a command that targets all NPCs instead of just the player? like replacing "player".addperk with something else that targets all NPCs that wear the armor?

 

i don't know much on this because i suck at scripting

 

EDIT: setsize doesn't seem to work both on the script and on in-game console, atleast on my end

 

and i don't understand what you meant by this

 

(Try setting a reference variable like "set me to getcontainer", then use me to run your functions against.

 

me.setscale 1.1

me.AddPerk TallerPowerArmorPerk)

 

because i don't know much about scripting

Edited by ghostrecon123
Link to comment
Share on other sites

Like this...

 

scn TallerPowerArmorScript

ref me

begin onequip

set me to getcontainer

me.setscale 1.1
me.AddPerk TallerPowerArmorPerk
end

begin onunequip
me.setscale 1
me.RemovePerk TallerPowerArmorPerk
end

 

I was afraid setsize might not work, I only tried it in console and when it didn't work I thought maybe it only worked in a script. I'll have to do some testing with the function.

Link to comment
Share on other sites

the script works only half way like mine did, i get taller and i get the perk but it still doesn't work on other NPCs, anyway i just decided to drop the whole mod, just gave up on it, scripting was never my favorite part

 

anyway, thank you very much for helping, +1 kudos for you

Link to comment
Share on other sites

Oh, btw, perks don't work on NPC's afaik.

You'll have to use a script effect or object effect or something.

its ok with me if perks don't work on NPCs, it'll just make power armored NPCs 10% stronger and for me its a good thing, but if only i could make power armored NPCs 10% taller without manually editing all their scales one by one, i just stopped on the mod anyway

Link to comment
Share on other sites

  • Recently Browsing   0 members

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