Equipment Restriction
Débuté par
andysks
, nov. 05 2013 01:47
#1
Posté 05 novembre 2013 - 01:47
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
Posté 05 novembre 2013 - 02:40
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.
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
Posté 05 novembre 2013 - 06:54
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.
PJ
//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.
PJ
#4
Posté 05 novembre 2013 - 10:21
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.
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
Posté 09 novembre 2013 - 01:40
Hey PJ, I opened The Gathering Sorm in the toolset. The script is simply an unaquire tag based script. Thank a lot
.
#6
Posté 10 novembre 2013 - 10:27
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
Posté 10 novembre 2013 - 11:33
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
Posté 16 novembre 2013 - 01:13
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
Posté 16 novembre 2013 - 01:40
Need to corect, it is unequip script not unaquire. And yes it is
#10
Posté 06 décembre 2013 - 08:21
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
Posté 06 décembre 2013 - 08:37
Change the object's tag via script, and it should no longer be able to fire its tag-based script.
#12
Posté 06 décembre 2013 - 08:42
Thanks Tchos.
#13
Posté 08 décembre 2013 - 09:48
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
Posté 08 décembre 2013 - 10:21
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
Posté 08 décembre 2013 - 10:43
Or in other words, there are a myriad of methods to flay felines.





Retour en haut






