Hello.
I'm trying to apply SetChosenActions() to an item, laying the in container.
The critter has opened the container the typical way, then after he clicks the item, I have the item.Id and should be enough.
The problem is that I swear to God it worked 2 days ago but not anymore. I checked all changes but didn't find any changes which could lead to this.
So I call these to each of the functions:
void ChosenScienceItem(uint itemId)
{
uint[] skill = { CHOSEN_USE_SKL_ON_ITEM, 1, SK_SCIENCE, itemId, 0, 0, 0 };
SetChosenActions(skill);
}
void ChosenEngineerItem(uint itemId)
{
uint[] skill = { CHOSEN_USE_SKL_ON_ITEM, 1, SK_ENGINEERING, itemId, 0, 0, 0 };
SetChosenActions(skill);
}
I have correct itemId (at least server log shows itemId the same I've sent to the function). And yes, it works in inventory and pickUp screens if I target item in the critter's inventory.
I know that arguments are suppose to be IsInventory, Skill index (SK_*), Item id. If I change IsInventory to 0, then action doesn't happen even for items in critter inventory.
1. Any idea if it's possible to apply SetChosenActions() to the item in the container or I was on hard drugs while it was working for >3 hours?
2. What is IsInventory exactly?
3. Can you please elaborate parameters for CHOSEN_MOVE_ITEM ( Item id, Item count, To slot, Is barter container, Is second try ) ? What are Is barter container and Is second try?
4. How exactly works SLOT_GROUND? Can I use it for items items in the containers? If not, is there anything like that I can use?
5. Is there a way to update the PickUp screen of the item (e.g. looting the locker), so it won't show items moved out of it ? E.g. if I call MoveItem( item, count, cr ) I will see changes after I call item.Update() in the critter inventory but not in the locker inventory. Surely I can call cr.ShowContainer(null, container, TRANSFER_HEX_CONT_UP) , but then I will lose scrolling position.