Masterofnet Posted December 30, 2014 Share Posted December 30, 2014 Does anyone have any ideas on the best way to make armor unable to be equipped or unequipped during combat? Or when enemies are near. Like fast travel. RegardsMasterofnet Link to comment Share on other sites More sharing options...
DoctorKaizeld Posted December 30, 2014 Share Posted December 30, 2014 i say just dont equip or unequip in battle, but since you asked i believe several of the major game play overhauls add that effect to the game. Link to comment Share on other sites More sharing options...
Masterofnet Posted December 30, 2014 Author Share Posted December 30, 2014 How do the major gameplay overhauls do it? I am looking to add this to a mod I am working on. Link to comment Share on other sites More sharing options...
DoctorKaizeld Posted December 31, 2014 Share Posted December 31, 2014 (edited) not sure, i just know i used one overhaul that change several combat related things as well to make it harder. i stopped using it though because it really didnt suit me... not sure which one it was, i think it was requiem? Edited January 2, 2015 by qwertyzeldar Link to comment Share on other sites More sharing options...
Masterofnet Posted December 31, 2014 Author Share Posted December 31, 2014 I only need this to work on two separate sets of unique armor so I am working on a script using event OnObjectUnequipped. The script would need to extend the object reference and be placed on the object. The script also need to display text when the player attempts to uneqip the armor saying. This item can not be Unequipped wile in combat. Link to comment Share on other sites More sharing options...
Masterofnet Posted January 2, 2015 Author Share Posted January 2, 2015 (edited) Event OnUnequipped(Actor akActor) if akActor == Game.GetPlayer() && Game.GetPlayer.IsInCombat() && Game.GetPlayer().GetItemCount(Self) == 1 This item can not be unequiped while in combat.Show() Game.GetPlayer().EquipItem(Self) endIf endEvent This is the script I came up with. It goes on the item. If the player un-equips the item it should be re-equipped and display a message stating the item cannot be unequipped during combat. Thanks for the input. Any thoughts? Edited January 2, 2015 by Masterofnet Link to comment Share on other sites More sharing options...
Terra Nova Posted January 2, 2015 Share Posted January 2, 2015 Event OnUnequipped(Actor akActor) Actor PlayerRef = Game.GetPlayer() ; store it once for more the one call. if akActor == PlayerRef && PlayerRef.IsInCombat() && PlayerRef.GetItemCount(Self) == 1 This item can not be unequiped while in combat.Show() PlayerRef.EquipItem(Self) endIf endEvent Other than the excessive Game.GetPlayer() calling which I handled for you, it's fine to me. I don't see another way to do this. I'm assuming you got that message there as an example of what your message is going to say and that you know how to make a message property, etc. Link to comment Share on other sites More sharing options...
Masterofnet Posted January 2, 2015 Author Share Posted January 2, 2015 (edited) Event OnUnequipped(Actor akActor) Actor PlayerRef = Game.GetPlayer() if akActor == PlayerRef && PlayerRef.IsInCombat() && PlayerRef.GetItemCount(Self) == 1 Debug.Notification("This item can not be unequiped while in combat") PlayerRef.EquipItem(Self) endIf endEvent No, Actually I got that message script from the creation kit Wiki. I have never attempted to put a message on an object before. Will that not display a message when the player attempts to un-equip the armor? How about this? Thanks Edited January 3, 2015 by Masterofnet Link to comment Share on other sites More sharing options...
Masterofnet Posted January 7, 2015 Author Share Posted January 7, 2015 This is infuriating. When placed on the armor the above script does nothing. I changed the event to onequipped it does nothing. Scriptname GoodorEquiped extends ObjectReference Event OnEquipped(Actor akActor) if akActor == Game.GetPlayer() Game.getplayer().kill() endIf endEvent I placed this script on the armor. It does nothing. I changed the event to OnUnEquipped it does nothing. What is the problem???? The script compiles just fine and the game completely ignores the event. Link to comment Share on other sites More sharing options...
Masterofnet Posted January 7, 2015 Author Share Posted January 7, 2015 I was able to get this script to work perfectly in coc by replacing self with a script property. Can anyone explain why self does not work? It will not even work on getitemcount. I use self on other scripts when placed on an object and it works fine. Scriptname DSCorCombat extends ObjectReference Event OnUnequipped(Actor akActor) Actor PlayerRef = Game.GetPlayer() if akActor == PlayerRef && PlayerRef.IsInCombat() && PlayerRef.GetItemCount(Helmet) == 1 Debug.Trace("We were unequipped from the player!") Debug.Notification("This item can not be unequiped while in combat") Game.GetPlayer().EquipItem(Helmet, abSilent = true) endIf endEvent Armor Property Helmet Auto I also have no idea why it does not work in game Link to comment Share on other sites More sharing options...
Recommended Posts