Eating sound problem. - by Kurhhan
Kurhhan on 1/9/2015 at 19:41
I need add to food "script" in World Action ( to teleport something else when frob/take food). But when you do this, eating sound appears when taking food to inventory. How to fix this ? Deleting schema eating sound is not good, because eating sound is also gone when you normally want to eat this food from inv.
PS : Sorry for bad english.
LarryG on 1/9/2015 at 21:08
Did you mean the EatFood script?
Quote:
EatFood<dd style="margin-bottom: 1.5em; color: rgb(0, 0, 0); font-family: 'Times New Roman'; font-size: medium;">gen.osm
1/G/2</dd>On <code style="color: rgb(0, 0, 0); text-decoration: underline; white-space: nowrap;">FrobInvEnd</code>, plays an environmental schema with the <code style="color: rgb(0, 0, 0); text-decoration: underline; white-space: nowrap;">Event Activate</code> tag. If the object was frobbed by the player, the schema is played with the ambient option.
So according to this you should only get the environmental sound of eating food when frobbing it from your Inventory (FrobInvEnd) and not when frobbing it in the World (FrobWorldEnd). If you want something to happen on FrobWorldEnd I would suggest using an NV script which can be tailored to respond to that.
I just checked using an apple and setting world action to script, and no sound was made when picking it up. Are you getting a different result?
Kurhhan on 1/9/2015 at 21:25
Hmmm, you right. No sound when picking "normal" food with script in world action. Script StdButton cause this problem in "my" food. I added StdButton to this food to cause teleport other object when frobing food.
LarryG on 1/9/2015 at 22:43
Use NVRelayTrap or TrigWorldFrob to intercept the FrobWorldEnd message and turn it into a TurnOn message silently.
Kurhhan on 1/9/2015 at 22:59
Hmm, I just place TrigWorldFrob in scripts (+ deleted StdButton), and it's seems to work, no eating sound when taking food, only when using from inv. So easy ? I am grateful LarryG.
R Soul on 1/9/2015 at 23:10
The 'eat food' schema is set up like any 'device', and StdButton and EatFood both play 'event activate' schemas, but under different circumstances (StdButton = world, EatFood = inv).
Larry, I'm not sure either of those scripts will work because if the player already has apples, the one in the world may be deleted before it can send any messages.
Kurhhan on 1/9/2015 at 23:34
It's seems to all work well now. I edited post before seeing your message R Soul.
LarryG on 2/9/2015 at 03:13
Quote Posted by R Soul
Larry, I'm not sure either of those scripts will work because if the player already has apples, the one in the world may be deleted before it can send any messages.
Maybe. I used a different approach with my fruit basket. All vegetable and fruit food turns into the fruit basket on world frobbing via NVGiveItem. Then the fruit basket in inventory has the EatFood script and UseAmmo which decrements the count in inventory as you eat from the basket. In any event I would think that if the NVRelayTrap or TrigWorldFrob comes first in the script list, it should work. (as it seems to for Kurhhan with his magic food)
Yandros on 2/9/2015 at 14:46
To make sure it actually does work, he just needs to have several in game and pick up more than one and make sure it works on those after the first are frobbed.
R Soul on 2/9/2015 at 15:43
I tried it once and it didn't work, but then I tried it again and it did work.
I put it down to Dromed not knowing how to react. Last month I saw a couple of goats but I didn't sacrifice either of them.