Jump to content

Item consumption for a conversable item


temnix

Recommended Posts

One of my items starts a dialogue from a button, where the character is supposed to be able to make poisons from berries. It takes 30 berries to make a bottle, and the dialogue checks for this with NumItemsGT("BBERRY_#",LastTalkedToBy,29). When the character chooses this response, a bottle of poison is created and two actions are run to expend the berries: TakePartyItemNum("BBERRY_#",30) DestroyItem("BBERRY_#"). The problem is that with conversable items characters really talk to themselves, and so in this case the character takes the berries from his own inventory (or from the inventory of others in the party, but in my testing only this character had any berries) and puts them again into his own backpack. He also tries to destroy what is probably the first stack of berries in the inventory, however many that one contains, one or a whole lot. The result is that the count is all wrong, and I can make three bottles from what should only be enough for one. Any suggestions about how to manipulate items in conversables' dialogues better?

Link to comment

Instead of conversable item spawn invisible npc with opcode #151 (0x97) Summon: Replace Creature, Parameter2=3 (dont remove), attach dialog to npc and it should work.

OR.. why dialog, why not make recipes with ingredients, click recipe it will set global variable eg alchemy = 12 , it will spawn invisible npc, npc will check block with value 12 and add item to players inventory,  last script block will always set variable alchemy to 0,, npc DestroySelf(), and also good practice attach to npc opcode delayed #168 (0xA8) Summon: Remove Creature self, bad things may happen npc will not destroy self eg, cutscene or party maliciously entered to other location...

Link to comment

Yes, I'm going the way of an invisible minion myself... I was hoping to avoid that and just do it from a button. Presentation should be as elegant as possible. Now another problem comes up: how to summon the minion through the button that I can get if I make the item conversable and can give any name to?

Baldr019.jpg.3105120be72baaece43e38f4fde44474.jpg

I can click the button and get the conversation with myself, which doesn't do the job, as I said, or I can get rid of the button and simply summon the minion from an item ability. But this would be the better way. I do need a conversation, because there are some choices. However, the only kind of item that gets a different button, not calling on a dialogue, are familiars. Their button kickstarts the first item ability, which only sets a global, and the engine takes it from there, creating the familiar, but the ability can contain any effects. I've used it for another item. The button, however, always says "Release." So I'm a trilemma here. 

Link to comment

So make your conversable item as you wanted you will have "Make Poison" button as you wanted, and script actions will be executed by invisible npc spawned from dialog file,... (add to dialog CreateCreatureObject(....)

If you don't want to spam save game file with global variables, you could use local variables instead, to let know what action should be performed by invisible npc add to dialog actions line after npc creation:

eg.: ActionOverride("INVSNPC",SetGlobal("ALCHEMY","LOCALS",12)) or set variable via opcode as spell...

or without variables?

ActionOverride("INVSNPC",TakePartyItemNum("BBERRY_#",30))

 
Edited by Gamemacik
Link to comment

Join the conversation

You are posting as a guest. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...