antstubell Posted September 2, 2020 Share Posted September 2, 2020 Can I call an event when player consumes an ingredient? or do I need to check the item's effect on the player? I'm sure onEat doesn't exist. Link to comment Share on other sites More sharing options...
IsharaMeradin Posted September 3, 2020 Share Posted September 3, 2020 Eat / Use / Equip all have the same keybind thus the OnEquipped event on a player alias script may catch when an ingredient is consumed. It is at least worth testing. If it is a custom ingredient, you can apply a scripted effect and use the OnEffectStart event. But that effect may also show up in the Alchemy crafting menu which could be undesired. Link to comment Share on other sites More sharing options...
antstubell Posted September 3, 2020 Author Share Posted September 3, 2020 (edited) Thank you. EDIT So I made a copy of the Magic Effect AlchParalysis and placed this script on it. MiscObject Property MyMiscObj AutoEvent OnEffectStart(Actor Target, Actor Caster)Debug.Notification ("I’m Drunk")Game.GetPlayer().AddItem(MyMiscObj, 1)EndEvent Effect works as expected but the script does nothing. What have I messed up? Edited September 3, 2020 by antstubell Link to comment Share on other sites More sharing options...
IsharaMeradin Posted September 3, 2020 Share Posted September 3, 2020 I cannot be 100% certain but I think magic effects with scripts attached need to be of the type "scripted" instead of say "fire and forget" Link to comment Share on other sites More sharing options...
antstubell Posted September 4, 2020 Author Share Posted September 4, 2020 (edited) Hmm. Tried changing it to Type Script, player gets the paralysis green hue around him, doesn't fall over and script doesn't fire.May have to re-think the whole idea, thanks. Edited September 4, 2020 by antstubell Link to comment Share on other sites More sharing options...
lofgren Posted September 13, 2020 Share Posted September 13, 2020 Both OnEquip and OnSpellCast will fire when an ingredient is consumed. The script should work regardless of the effect type. Did you: 1. Fill the property?2. Compile the script? Link to comment Share on other sites More sharing options...
Recommended Posts