Author Topic: Disarm weapon script?  (Read 712 times)

Legacy_GhostOfGod

  • Hero Member
  • *****
  • Posts: 1490
  • Karma: +0/-0
Disarm weapon script?
« Reply #15 on: November 29, 2010, 04:12:29 am »


               As CheshireCat pointed out there are a few odd things that would happen intercepting the disarm in this manner. But these could also be viewed as posostives. Just depends on how you look at it.

If a player is in combat and they hand someone a weapon from their inventory, the weapon will just be destroyed and the new one created back into the players inventory. This can just be viewed as "You are too busy fighting to fish around in your back pack for that dagger with the slashing resistence to give to your budy".

And it is a deterent for players to pickpocket other players while in combat. If the pick pocket snags a nice weapon...it gets destroyed and gos back to the original player.

As far as switching weapons while in combat, that shouldn't be a problem since they don't unacquire the item.

I was a bit confused about your solution ffbj. Not sure how that would work.
               
               

               
            

Legacy_CheeseshireCat

  • Jr. Member
  • **
  • Posts: 79
  • Karma: +0/-0
Disarm weapon script?
« Reply #16 on: November 29, 2010, 12:49:23 pm »


               The item will get unacquired when switching if you have little free space due to full and/or cluttered inventory.



Remember, when switching weapons, you unequip first, equip later. So if, for example, you had an axe (2x3) and a great shield (2x4) equipped, but due to some reason needed to switch to, say, a quarterstaff (1x4), if you don't have free 2x3 space, and 2x4 after that, the shield and maybe even axe would get dropped. Then the staff gets equipped, then you destroy the axe, then try to push it in again. If there still isn't room, it could mess things up even more.



How I would go about it is to replace the whole standard disarm script instead of trying to hotfix its results on the fly.
               
               

               
            

Legacy_Lightfoot8

  • Hero Member
  • *****
  • Posts: 4797
  • Karma: +0/-0
Disarm weapon script?
« Reply #17 on: November 29, 2010, 02:19:03 pm »


               

CheeseshireCat wrote...

How I would go about it is to replace the whole standard disarm script instead of trying to hotfix its results on the fly.


There is the problem, The disarm is hard coded.  Unless of cource you have hacked the server, like funky has.
               
               

               
            

Legacy_GhostOfGod

  • Hero Member
  • *****
  • Posts: 1490
  • Karma: +0/-0
Disarm weapon script?
« Reply #18 on: November 29, 2010, 03:36:02 pm »


               

CheeseshireCat wrote...

The item will get unacquired when switching if you have little free space due to full and/or cluttered inventory.

Remember, when switching weapons, you unequip first, equip later. So if, for example, you had an axe (2x3) and a great shield (2x4) equipped, but due to some reason needed to switch to, say, a quarterstaff (1x4), if you don't have free 2x3 space, and 2x4 after that, the shield and maybe even axe would get dropped. Then the staff gets equipped, then you destroy the axe, then try to push it in again. If there still isn't room, it could mess things up even more.

How I would go about it is to replace the whole standard disarm script instead of trying to hotfix its results on the fly.


That's why I put the infinite loop check in. So even if a player switches weapons(And only a weapon and while in combat) and there is no room in the inventory, it will drop to the ground, the unacquire fires, the weapon wil try once to be recreated in the inventory, if there is no room the new one will drop to the ground and stay there as it normaly would if the inventory was too full.

It's been working for us in our meager pw.
               
               

               
            

Legacy_ffbj

  • Hero Member
  • *****
  • Posts: 1097
  • Karma: +0/-0
Disarm weapon script?
« Reply #19 on: November 30, 2010, 01:03:56 am »


               GoG My thinking is that since the disarm feat flags the weapon as lost all that needs to be done is to get the weapon in the inventory slot rh, and if it's lost, i.e disarmed then set an int the disarmed/lost weapon so it can't be re-equipped for a few seconds. The weapon can then be re-created in the PC's inventory. So switching weapons would have no effect since the weapon is not lost by simply switching weapns in combat, only if it's disarmed.
Then all you need do is check for the int disarmed on the equip item script and while that int is present the weapon can't be re-equipped, which was part of the oringinal question the op asked.  That the item not be re-equipable for a few seconds, in my example 6.0. My only concern was the when the weapon is re-created the int might be lost, which is easy to fix by setting the local when the weapon is re-created in the PC's inventory.  If the int disarmed is not lost then that step would not be needed.
               
               

               


                     Modifié par ffbj, 30 novembre 2010 - 01:11 .
                     
                  


            

Legacy_GhostOfGod

  • Hero Member
  • *****
  • Posts: 1490
  • Karma: +0/-0
Disarm weapon script?
« Reply #20 on: November 30, 2010, 03:59:00 am »


               Ah ha. I didn't know anything about the disarmed weapon being flagged. So once the weapon is disarmed and it drops to the ground you can still get the weapon in the persons weapon slot even though they don't have it equipped?
               
               

               
            

Legacy_ffbj

  • Hero Member
  • *****
  • Posts: 1097
  • Karma: +0/-0
Disarm weapon script?
« Reply #21 on: December 01, 2010, 01:49:00 am »


               Well the idea is you get the weapon in the slot first then if it is the same as the weapon that is lost i.e. the weapon that is lost/disarmed then that is the weapon you recreate in the players inventory.  A different approach to the problem is all it is.
               
               

               
            

Legacy_La Rose Noire

  • Newbie
  • *
  • Posts: 49
  • Karma: +0/-0
Disarm weapon script?
« Reply #22 on: January 04, 2011, 07:50:32 am »


               Beware of CopyObject in the Disarm Script because it will erase any added properties or magical enhancement on the weapon duplicated.

In my mod, I use ActionPickUpItem which will take a little time to perform and justify the use of Disarm by fighters.
               
               

               


                     Modifié par La Rose Noire, 04 janvier 2011 - 07:51 .