Aller au contenu

Photo

Equipment Restriction


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

#1
andysks

andysks
  • Members
  • 1 651 messages
Can I make an armor or weapon whatsoever in the style of some old games, that the given item was only wearable by a certain NPC/companion? Thats all :). I don't think it's possible, but worth to ask :).

#2
Lugaid of the Red Stripes

Lugaid of the Red Stripes
  • Members
  • 955 messages
You can use the alignment/class/race/gender restrictions to get pretty specific, and then have a tag-based script that checks the tag of the user when the item is equipped, and then un-equips the item if it's the wrong user.

You could also just use the tag-based script to force the item back to it's original owner if the player ever tries to take it from the NPC, using the on-unacquire event. Curse flag might work just as well, though, and might give you an in-game explanation for why no one else can use that particular item.

#3
PJ156

PJ156
  • Members
  • 2 985 messages
Have a look at the script the M.Reider did for Dominics ring in "The Gathering Storm". He did what you want and made it funny at the same time. It was a ring, and if you tried to take it, a cobersation opened and Dom asked if you were trying to hold his hand.

//makes you unable to unequip dom's ring.
void main()
{
object oRing = GetObjectByTag("doms_ring_no_use");
object oDom = GetObjectByTag("1000_n_dom");
object oPC = GetFirstPC();
AssignCommand(oDom,ActionEquipItem(oRing,INVENTORY_SLOT_LEFTRING));
AssignCommand(oPC,ActionStartConversation(oDom,"tgs_dom_ring",FALSE,FALSE,TRUE));
}

Problem is, I can't for the life of me, see where he put it. Image IPB

PJ

#4
Dann-J

Dann-J
  • Members
  • 3 161 messages
I tend to give my pre-equipped companions customised equipment that is set to both 'plot' and 'cursed'. That stops the items from being dropped or sold.

Occasionally I'll create upgraded equipment for a specific companion (preferably as part of a quest that requires that companion to be in the party at the time), with an OnAcquire script that transfers the item in question to the companion (if they didn't pick it up themself), then sets it to 'cursed' and equips it. The same script will also un-plot and un-curse the old item that's been replaced, so you can then take or sell their old hand-me-downs.

#5
andysks

andysks
  • Members
  • 1 651 messages
Hey PJ, I opened The Gathering Sorm in the toolset. The script is simply an unaquire tag based script. Thank a lot :).

#6
Dann-J

Dann-J
  • Members
  • 3 161 messages
You can also edit the module's OnEquipped script, rather than give every item its own tag-based script. In a module I'm currently working on, I've created checks for gender and deity that automatically unequip items if you don't meet their requirements, with feedback messages in the console. It's a pity you can't cause the inventory icons to go red though.

Modifié par DannJ, 10 novembre 2013 - 10:29 .


#7
andysks

andysks
  • Members
  • 1 651 messages
I only need this for some companion items, something like Keldorn's equipment in BG2. I wouldn't like to mess so much with the module's events. But I keep the information noted, in case I decide to go that way. Thanks :).

#8
Friar

Friar
  • Members
  • 293 messages

PJ156 wrote...

Have a look at the script the M.Reider did for Dominics ring in "The Gathering Storm". He did what you want and made it funny at the same time. It was a ring, and if you tried to take it, a cobersation opened and Dom asked if you were trying to hold his hand.


Reid's sense of humor is epic

#9
andysks

andysks
  • Members
  • 1 651 messages
Need to corect, it is unequip script not unaquire. And yes it is :D

#10
andysks

andysks
  • Members
  • 1 651 messages
Sorry to bring this back, but something came to mind. The companion who is using this piece is met at level 4. Is there any way to revert a script, on unequip for this instance, at some later point when the armor will not be good anymore?

#11
Tchos

Tchos
  • Members
  • 5 063 messages
Change the object's tag via script, and it should no longer be able to fire its tag-based script.

#12
andysks

andysks
  • Members
  • 1 651 messages
Thanks Tchos.

#13
Dann-J

Dann-J
  • Members
  • 3 161 messages
Or set a local variable on the item, and incorporate a check of the variable into its tag-based scripts. There are lots of ways to go about it.

#14
Tchos

Tchos
  • Members
  • 5 063 messages
Definitely. I didn't mean to imply that it was the only way. For any task here, there are probably a dozen ways to go about it.

#15
Dann-J

Dann-J
  • Members
  • 3 161 messages
Or in other words, there are a myriad of methods to flay felines. Image IPB