Jump to content

Recommended Posts

Posted (edited)

Sorry for my bad English.

 

Well, i trying to make mod with an upgrades for power armor. I create 2 armor-type items that don't have any "biped object" slot, selected. Now i need to write script that don't allowed wear both that items at the same time. Let's say names of items - "item1", "item2". I wrote script for item1:



scn ScriptForItem1

Begin OnEquip player

Player.UnEquipItem Item2 0 1

End

And script for item2



scn ScriptForItem2

Begin OnEquip player

Player.UnEquipItem item1 0 1

End 

I add that scripts for items in items edit menu. But in game script don't work properly. I can wear both that items. How to fix that? Or maybe there is a better way to do that? Also sorry if i make topic on wrong forum section.

Edited by truestiven
Posted

Your method should work. I think you still see both items equipped because the inventory needs to refresh. Try closing and then re-open the inventory, and you will see that only one of the two items is equipped.

Posted

As I recall, the inventory screen can be refreshed by removing an item from your inventory. You can add a pencil or something to your inventory and then remove it in both scripts, and it should show properly.

Posted

Thanks, thats helped! As luthienanarion saying, i just add in inventory some item, and then remove that item, so inventory refreshed, and displayed properly.

Posted

As I recall, the inventory screen can be refreshed by removing an item from your inventory. You can add a pencil or something to your inventory and then remove it in both scripts, and it should show properly.

I used this trick on companions/NPCs to force them into re-evaluating their inventories. Good to know it also works on the player. :thumbsup:

Posted

Well, i have another problem now. If i unequipped power armor, mods are do not unequipped as well. Do there exist any way to unequipped power armor mods(item1, item2 from example above) in exact same moment when player unequipped power armor? Well i can add few line in power armor script, but maybe it is possible to create some "base effect" (that i give to the player as perk) that will be active all the time, and will unequipping mods when players unequipped power armor?

Posted

Add all of your PA mod items to a form list and pass the form list to UnequipItem to simplify that process. That way you can just add any new ones you create to the list and have them affected also.

 

Yeah, you can have a script constantly running on the player if you set the actor effect as an ability. It's a bit complex writing the effect script, creating a base effect using the script, and creating an actor effect using the base effect, so you're probably better off making a scripted token if you're only applying it to the player.

Posted

Add all of your PA mod items to a form list and pass the form list to UnequipItem to simplify that process. That way you can just add any new ones you create to the list and have them affected also.

Did it.

 

 

 

Yeah, you can have a script constantly running on the player if you set the actor effect as an ability. It's a bit complex writing the effect script, creating a base effect using the script, and creating an actor effect using the base effect, so you're probably better off making a scripted token if you're only applying it to the player.

Please, do you can explain about how to create script constantly running on the player? I can, maybe, create infinite loop, but to where put that script? Also do there any way to run script at beginning of the game? I mean, well i need write script that at start of game adding all energyweapon to my custom form list.

  • Recently Browsing   0 members

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