IAmOliverQueen Posted May 13, 2019 Posted May 13, 2019 (edited) Problem: I am trying to make a script that adds one Gold Ingot upon casting a spell. The script connects and claims the ingot has been added, but no ingot is added. Code: Scriptname goldspell extends activemagiceffect MiscObject property Sum Auto Event OnEffectFinish(Actor akTarget, Actor akCaster) Debug.Notification("connect with script") akCaster == Game.GetPlayer() Game.GetPlayer().AddItem(Sum, 1, true) Debug.Notification("added an ingot") endEvent I have gone over and changed much of the code in a few hours and every time, the outcome is the same. The messages play, but no item is added. I've used the properties to add the value as "IngotGold". Any ideas on how to get it to actually add an ingot to the player's inventory? I am new to scripting in papyrus and using Creation Kit (yes, I have gone through some tutorials). Fixed it. Error was due to another mod Edited May 14, 2019 by IAmOliverQueen
IAmOliverQueen Posted May 14, 2019 Author Posted May 14, 2019 Fixed it. Was an issue with some other mod.
ReDragon2013 Posted May 18, 2019 Posted May 18, 2019 maybe you should thinking about your script code iaoqIngotMGEFScript Scriptname iaoqIngotMGEFScript extends ActiveMagicEffect ; https://forums.nexusmods.com/index.php?/topic/7643778-script-connects-but-wont-add-item/ MiscObject PROPERTY Sum auto ; the object you want to add ; -- EVENT -- EVENT OnEffectStart(Actor akTarget, Actor akCaster) IF (akCaster == Game.GetPlayer()) ;;; Utility.Wait(1.5) ; if you need you can wait here for a while akCaster.AddItem(Sum, 1, TRUE) Debug.Notification("added an ingot") ENDIF ENDEVENT
IAmOliverQueen Posted May 18, 2019 Author Posted May 18, 2019 maybe you should thinking about your script code iaoqIngotMGEFScript Scriptname iaoqIngotMGEFScript extends ActiveMagicEffect ; https://forums.nexusmods.com/index.php?/topic/7643778-script-connects-but-wont-add-item/ MiscObject PROPERTY Sum auto ; the object you want to add ; -- EVENT -- EVENT OnEffectStart(Actor akTarget, Actor akCaster) IF (akCaster == Game.GetPlayer()) ;;; Utility.Wait(1.5) ; if you need you can wait here for a while akCaster.AddItem(Sum, 1, TRUE) Debug.Notification("added an ingot") ENDIF ENDEVENT Thanks for this. May have to try this on a heavy modded save.
Recommended Posts