Aller au contenu

Photo

Block companion from using specific weapons?


  • Veuillez vous connecter pour répondre
7 réponses à ce sujet

#1
kamalpoe

kamalpoe
  • Members
  • 711 messages
Is there a way to block a companion from using a weapon they'd otherwise be proficient in? For instance, to prevent a fighter companion from using a greatsword, or prevent him from using peircing weapons.  I think it would be a neat trick for story reasons or to have the 2nd edition clerics use blunt weapons only restriction.

Preferably the companion would also have a speakstring saying they can't use the weapon if you try to give them one to use.

#2
WyrinDnjargo

WyrinDnjargo
  • Members
  • 136 messages
Use the *module's* OnEquip script to check for the companion tag and the base item type being equipped. Then pick a random string to be spoken as the item is unequipped.

#3
Morbane

Morbane
  • Members
  • 1 883 messages
you can use GetBaseItemType(...) and force the companion to unequip if it is of the specific type - im not sure how versatile that function is but you should get some results by looking into it. You can also try ActionUnequipItem(...) - together with some sort of speakstring they should give you a basic functionality to work with.

Edit: Plus what Wyrin suggested.. :P

Modifié par Morbane, 05 août 2010 - 02:37 .


#4
Shallina

Shallina
  • Members
  • 1 011 messages
Tag based scrpting is your answer.

#5
_Knightmare_

_Knightmare_
  • Members
  • 643 messages

Shallina wrote...

Tag based scrpting is your answer.


Not sure it is in this case, unless you want to make a seperate script for all the differently tagged blueprints. The module level OnEquip is the best place to make these sorts of "blanket" alterations.

#6
kamalpoe

kamalpoe
  • Members
  • 711 messages
Tag based I don't think is the answer here as the script would have to be updated any time a new item of the greatsword category (for example) was added to the module. I figured it would be a custom onEquip for the companion, but I wasn't sure if you could detect a weapon category such as greatswords.

#7
WyrinDnjargo

WyrinDnjargo
  • Members
  • 136 messages
yeah, just use

if (GetTag(GetPCItemLastEquippedBy() == "companiontag" && GetBaseItemType(GetPCItemLastEquipped()) == BASE_ITEM_GREATSWORD))



(but done neater than that...)

#8
kamalpoe

kamalpoe
  • Members
  • 711 messages
I'll give that a look. I realized I have a companion that doesn't like exactly scimitars Posted Image, so this would be a nifty bit to stick in the mod.