Blocking a Companion's Inventory Completely
#1
Posté 13 janvier 2011 - 02:19
I've switched off selectability of a companion, so you can't open their inventory the usual way, but I can still drag and drop items from the PCs inventory onto the companion's portrait.
I wrote a script that should fire when their inventory is disturbed, that automatically cycles through the inventory and drops each item encountered (with the exception of healing potions), but it doesn't seem to fire at all when you give them items by dragging them onto the companion's portrait.
Any suggestions? Since you can't access this companion's inventory the usual way, if you drag-and-drop heavy items onto them there's a chance they could be slowed, with nothing the player can do about it (except perhaps casting bull's strength on them at regular intervals). You would also lose those items permanently.
#2
Posté 14 janvier 2011 - 04:25
Mind you, I don't know anything about the differences between hench's and companions from the perspective of scripting. I just wanted to bring up the distinction.
#3
Posté 14 janvier 2011 - 08:36
#4
Posté 14 janvier 2011 - 09:31
#5
Posté 14 janvier 2011 - 11:46
Quoting 0100010, social.bioware.com/forum/1/topic/164/index/3120333 ...
AddHenchman
Attempting to exit to the main menu while a henchman (not a companion) is added
crashes the client
Workaround: Don’t do it
Modifié par The Fred, 14 janvier 2011 - 11:49 .
#6
Posté 15 janvier 2011 - 10:20
What can you do if you want a henchman who uses the companion on death script I tried copying scripts across but to no avail. In the end I had to make the henchman with a very high ac so he survivied a key fight. I wouod rather for balance reasons have the henchman come back like a companion would?
PJ
#7
Posté 15 janvier 2011 - 12:21
#8
Posté 15 janvier 2011 - 11:09
#9
Posté 15 janvier 2011 - 11:28
#10
Posté 16 janvier 2011 - 09:52
This particular companion is non-selectable, which means you can't possess them or open their inventory, which is all good. It's just the drag-and-drop onto the portrait that is the problem. It functions as an inventory 'back door' that seems to bypass inventory disturbed checks. You can't drag-and-drop onto summoned creature portraits - but then again, they disappear when killed.
In other words; I want my cake, and I want to eat it.
Is there an event number for a character becoming encumbered? If so, then I could force the companion to drop their entire inventory if it gets too heavy for them. It's not a very strong companion, so it wouldn't take much to encumber it.
Or is it possible to remove the inventory completely from a companion?
Modifié par DannJ, 16 janvier 2011 - 09:55 .
#11
Posté 17 janvier 2011 - 02:18
I could always modify the HB interval so that it runs once a minute rather than once every six seconds. If you encumber the companion, you may have to wait up to a minute for it to "disgorge" though.
A SetHasInventory function would be useful, if it existed.
Modifié par DannJ, 17 janvier 2011 - 02:19 .
#12
Posté 17 janvier 2011 - 09:28
The 'drop all' script originally cycled through the companion's inventory and dropped everything, but I found that it crashed the game when magic bags were involved. I've found that the GiveAllInventory function works better.
The script works fine when executed from the companion's conversation, however it seems that companion heartbeat scripts don't always fire very predictably. It's probably because companions frequently have actions queued up. It will work a few times, then stop firing at all until the companion's actions are cleared in some way (talking to them, transitioning to a new area, etc). So it sort of half-works.
It's a disappointing work-around. It'd be so much better if an inventory disturb event was triggered when you drag-and-drop items onto a portrait. It'd be even better still if you could completely block this inventory back-door, which summoned creatures somehow manage to do.
Modifié par DannJ, 17 janvier 2011 - 09:30 .
#13
Guest_Chaos Wielder_*
Posté 17 janvier 2011 - 10:10
Guest_Chaos Wielder_*
Edit:
Set X2_JUST_A_DISABLEEQUIP =1
Modifié par Chaos Wielder, 17 janvier 2011 - 10:11 .
#14
Posté 17 janvier 2011 - 11:05
#15
Posté 18 janvier 2011 - 07:12
#16
Posté 18 janvier 2011 - 09:51
It's possible to make them resurrectable though, after which you can talk to them and have them rejoin, but that's not very desirable.
Now I'm thinking of giving them a modified troll script, which makes them fall down when reduced to 1HP, but removing the fire/acid vulnerability. This particular companion regenerates slowly anyway, so the troll script shouldn't need to be altered very much.
The challenge will be in making enemies ignore the fallen henchman. Perhaps some sort of sanctuary effect would do the trick. More to experiment with...
Modifié par DannJ, 18 janvier 2011 - 09:53 .
#17
Posté 19 janvier 2011 - 09:15
'While a henchman is added' doesn't mean the game will crash if you happen to exit to the main menu *while* the henchman is being added - the game crashes at any time *after* a henchman has been added if you try to exit to the main menu. I can't be bothered finding out why Slaan didn't do this in the first campaign (maybe he did?).
After all these increasingly complicated scripting experiments, a simple solution suddenly occured to me. I can fill the non-possessable companion's inventory with non-droppable, non-stackable, zero-weight custom items, so that any attempt to transfer items to it will fail due to lack of inventory space. No scripting required.
D'oh!
Modifié par DannJ, 19 janvier 2011 - 09:16 .
#18
Posté 20 janvier 2011 - 05:25
It seems that the inventory-filling approach might work, though, given that you can't view their inventory anyway. Make sure they're not going to want to, say, switch weapons, though, since that could mess things up.
#19
Posté 20 janvier 2011 - 09:26
I've now given it 128 cursed keys (the lightest non-stacking item type I could find). Any attempt to drag-and-drop items onto its portrait fails, with the item in question simply remaining in the PCs inventory. So much for complex scripting solutions...
The moral of the story appears to be; when all scripting attempts fail, just cram it full of keys.
Modifié par DannJ, 20 janvier 2011 - 09:30 .





Retour en haut







