Make a portrait switch or receive an item
Record ID: transfer_to_mara. Global Script: off. Put this on Mara’s portrait instead of the plain Switch Character behavior.
extends "res://scripts/runtime/script_base.gd"func run(_context: Dictionary = {}) -> Variant:
var item: String = str(Runtime.get("selected_inventory"))
if item.is_empty():
await Runtime.call("switch_player_character", "assistant")
return true
await TransferInventory({"fromCharacterId":ActivePlayer(),
"toCharacterId":"assistant", "itemId":item, "count":1})
Runtime.call("clear_selected_inventory_item")
return trueCopy the record for another recipient and change assistant to that character’s ID. Keep ActivePlayer() as the source; hard-coding the source would transfer from the wrong character after a switch.
Add story or ownership checks before Transfer Inventory when needed. A transfer-aware portrait should explain why an unavailable recipient or a forbidden item cannot be used, rather than behaving like a dead Button.
Use the item’s actual selected ID. Its caption, icon and translated name are presentation; they are not reliable transfer keys.
