Jump to content

Unequip item from an event handler...


Recommended Posts

Hello !!!

 

 

The idea is :

 

I equip an item, if certain conditions are met on the item(e;g; it occupies the lowerbody), unequip the item...

 

I used SetEventHandler onactorequip, but according to the wiki (I read it after trying, no excuse...):

 

trying to unequip the item from within the handler will fail

 

 

An idea ??? Seems my brain stopped working, on this one...

 

 

Link to comment
Share on other sites

Short answer:

you can't prevent the item from being equipped with the OnActorEquip event handler, so you need a GameMode script to unequip it later.

 

Long answer:

The OnActorEquip event fires just a while after you clicked on the item in the inventory to equip it (or the EquipItem command i executed), but just before the item is actually equipped.

Obviously, you can't unequip an item which is still not equipped.

The best you can in the OnActorEquip handler is mark the item (put it into an array or something like that) and then a MenuMode/GameMode block will run sooner or later to unequip it.

 

The worst part is: in any case, unequipping the item is not enough. You also need to restore all items unequipped while equipping it.

Link to comment
Share on other sites

Duh !!!

 

I knew I had to kiss... (keep it simple, stoopid !!!)

 

I tried so many tricks, I forgot to mark/store/register/whatever the item...

 

 

Now I have to kiss you... :p

 

 

 

 

Thank You !!! For this and your mods (I use many of them )

 

 

The best thing is... It works like I wanted, so DOUBLE THANK YOU !!!

Link to comment
Share on other sites

  • Recently Browsing   0 members

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