VincentIcarus Posted March 27, 2011 Share Posted March 27, 2011 Alright, I have a unique set of armor that I've created for myself and there is a Machete strapped on the back and a pistol in a thigh holster as a part of the armor. Well, obviously, whenever I enter a casino and they take my weapons, the machete and pistol are still there because they are a part of the armor. How would I make a mod so that when I enter a casino and they take my weapons, they take the machete and pistol off of the armor? I know I would probably have to make a separate .nif file for the "casino friendly" armor and probably have to make a script for the armors to be switched out when they take my weapons but I have absolutely no idea how to make a script like that. Is there any advice/help you can offer me? Here's a halfway decent picture of my armor where you can see the machete and the pistol:http://newvegasnexus.com/imageshare/images/2253779-1298703833.jpg Link to comment Share on other sites More sharing options...
PaladinRider Posted March 28, 2011 Share Posted March 28, 2011 I would check for if the weapons themselves are in the player's inventory. If the player drops the two weapons, ForceEquip the armour set without the weapons Link to comment Share on other sites More sharing options...
VincentIcarus Posted March 28, 2011 Author Share Posted March 28, 2011 No, the weapons are a part of the armor mesh. They themselves are not functional. They're just there for decoration. Link to comment Share on other sites More sharing options...
PaladinRider Posted March 28, 2011 Share Posted March 28, 2011 (edited) EDIT: Double post Edited March 28, 2011 by PaladinRider Link to comment Share on other sites More sharing options...
PaladinRider Posted March 28, 2011 Share Posted March 28, 2011 (edited) Okay, well assuming you have two sets of armour, one with the strapped weapons and one without. Find the script that takes all but your holdout weapons,and just add this code in the place where all weapons are removed: If Player.GetItemCount ArmourRefWithWeapons == 1 Player.RemoveItem ArmourRefWithWeapons 1 Player.AddItem ArmourRefWithoutWeapons 1 Player.ForceEquip ArmourRefWithoutWeapons 1 ; note this will equip the armour even if you had the armour in your inventory but not equipped endif Then when the weapons are given back, run the same script but with the references switched. EDIT: It's actually a bit more complicated with that, I forgot to preserve the armour's damage Edited March 28, 2011 by PaladinRider Link to comment Share on other sites More sharing options...
VincentIcarus Posted March 28, 2011 Author Share Posted March 28, 2011 I normally keep it at 95% or more so that won't really be much of a problem. Thank you very much Paladin. Link to comment Share on other sites More sharing options...
VincentIcarus Posted March 28, 2011 Author Share Posted March 28, 2011 Okay, so adding a script to the armor sounds like the most stable way to do it. So I would add this script: If Player.GetInCell TOPSCasino || Player.GetInCell TOPSrestaurant || Player.GetInCell ULCasino ; (and so on until you got ALL casino interiors in the IF condition)set inCasino to 1elseset inCasino to 0 if InCasino = 1player.UnequipItem (ArmorWithPistol)player.RemoveItem (ArmorWithPistol) [TempContainer - if it works in NV]player.AddItem (ArmorWithOutPistol)player.EquipItem (ArmorWithOutPistol)elseif InCasino == 0player.UnequipItem (ArmorWithOutPistol)player.RemoveItem (ArmorWithOutPistol) [TempContainer - if it works in NV]player.AddItem (ArmorWithPistol)player.EquipItem (ArmorWithPistol)endif Is that what it would look like? Or am I completely off? (This is my very first attempt at trying to do any type of scripting) Link to comment Share on other sites More sharing options...
rickerhk Posted March 28, 2011 Share Posted March 28, 2011 You will want to change this section, otherwise it will add the armor every frame and CTD.The Player.GetItemCount part is redundant if the item is unique.You won't be able to preserve the health of the armor unless you use NVSE, or unless you set up two remote containers - each with one version of the armor, and use RemoveAllTypedItems to swap them out. But thier health will not be in sync with each other. if InCasino = 1 if (player.GetEquipped ArmorWithPistol) player.UnequipItem ArmorWithPistol if (Player.GetItemCount ArmorWithOutPistol == 0) player.AddItem ArmorWithOutPistol 1 endif player.EquipItem ArmorWithOutPistol player.RemoveItem ArmorWithPistol 1 endif else if (player.GetEquipped ArmorWithOutPistol) player.UnequipItem ArmorWithOutPistol if (Player.GetItemCount ArmorWithPistol == 0) player.AddItem ArmorWithPistol 1 endif player.EquipItem ArmorWithPistol player.RemoveItem ArmorWithOutPistol 1 endif endif Link to comment Share on other sites More sharing options...
VincentIcarus Posted March 29, 2011 Author Share Posted March 29, 2011 Okay and the script that defines whether or not I am in a casino is part of a separate script or is it also a part of that script? Link to comment Share on other sites More sharing options...
rickerhk Posted March 29, 2011 Share Posted March 29, 2011 Okay and the script that defines whether or not I am in a casino is part of a separate script or is it also a part of that script? The same script, like you had it. Link to comment Share on other sites More sharing options...
Recommended Posts