Jump to content

Making armor not equipable or unequipable during combat


Masterofnet

Recommended Posts

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 by qwertyzeldar
Link to comment
Share on other sites

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

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 by Masterofnet
Link to comment
Share on other sites

 

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

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 by Masterofnet
Link to comment
Share on other sites

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

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

  • Recently Browsing   0 members

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