Sepichat / FoundryVTT-GiveItem

A module to allow players to give an item to another player
GNU General Public License v3.0
6 stars 7 forks source link

Give item from 1 character you control to another you control. #38

Open OregonPinkRose opened 2 years ago

OregonPinkRose commented 2 years ago

Right now, if a player controls Annie and Bob, and player 2 controls Chris and David, they cannot give items to their other characters. Only Chris and David show up as an option for player 1 to give to. And vise versa. I would like to be able to have Annie have the option of giving to Bob, or Chris or David. It seems you can only choose characters you do not control. Or that are controlled by another player, I'm not sure which.

Xayrlen commented 1 year ago

You can simply drag an item from one inventory window to another.

Terrox commented 9 months ago

I would also like this because some systems don't have drag-n-drop. I can't see multi-owned characters in the list but I'm not sure if this related to this issue, I guess it would be if it is considered an own-character. I might try modding the code to see if that works.

Terrox commented 9 months ago

@OregonPinkRose partial progress here. I can give to my own secondary characters and to any other visible "actors". So for a situation where all the players control a vehicle actor or loot actor, this mod allows sending from or to the group owned actor.

the below will look in actors, grab the visible ones which aren't already in the list and also check you're not back to the origin actor.

the only failing is that it wont list your own main actor in the list which needs a fix for emitting a socket to yourself or auto-allowing the trade or something.

note: there is a commented out part which I neede for Custom System Builder to check the actor type and not include templates, probably don't need it since templates aren't visible to players anyway.

in /foundrydata/Data/modules/give-item/scripts/actorOverride.js add this in giveItem() after const actor around line 119 if (actor.id === currentActor.id) { return ui.notifications.error(Actor cannot give to itself); }

in /foundrydata/Data/modules/give-item/scripts/actorOverride.js in function fetchPCList() { before the return filteredPCList; add this game.actors.forEach(actor => { // temp new hack if (!!actor.visible && game.user.character?.id !== actor.id /* && actor.type == 'character' */) { // push only if the actor.id is not in the filteredPCList if (!filteredPCList.includes(actor)) { filteredPCList.push(actor); } } });