For my craft mod, I would like to launch a script that will check the crafting result at a certain point in the dialogue, like
PC "I would like to make some tanning"
NPC "What exactly would like td do ?"
PC "I would like to create leather strips from leather"
NPC "You need leather" if the player doesn't have any leather
or NPC "Here you go" if the player has some leather, and this line starts the script below:
Scriptname newscripttest extends questimport utilityimport fron_utility_functionsmessage property css_craftingtanning_base automessage property css_tanning_LeatherStrips automessage property css_peltandhidesintoleather automiscobject Property leather01 automiscobject Property badleather automiscobject Property LeatherStrips autoglobalvariable property css_tanning_skill auto;Event OnActivate(ObjectReference triggerRef)Function checkTanningResult()string sSkillLevel = Fron_GetSkillLevelName(css_tanning_skill.getvalueint())debug.notification("you are "+ sSkillLevel + " in tanning.")string sResultint xp_gained_4 sResult = css_check_success(5,12,20,css_tanning_skill,-4) debug.notification(sResult) game.getPlayer().RemoveItem(leather01) if sResult == "echec critique" xp_gained_4 = XP_gain(sResult,3,6,2,4,1,3,0,1) Improve_skill_from_experience(css_tanning_skill,xp_gained_4) elseif sResult == "echec" xp_gained_4 = XP_gain(sResult,3,6,2,4,1,3,0,1) Improve_skill_from_experience(css_tanning_skill,xp_gained_4) game.getPlayer().addItem(LeatherStrips,1) elseif sResult == "reussite" xp_gained_4 = XP_gain(sResult,3,6,2,4,1,3,0,1) Improve_skill_from_experience(css_tanning_skill,xp_gained_4) int succ_Leather_number = utility.randomint(2,4) game.getPlayer().addItem(LeatherStrips,succ_Leather_number) elseif sResult == "reussite critique" xp_gained_4 = XP_gain(sResult,3,6,2,4,1,3,0,1) Improve_skill_from_experience(css_tanning_skill,xp_gained_4) int critsucc_badLeather_number = utility.randomint(3,6) game.getPlayer().addItem(LeatherStrips,critsucc_badLeather_number) endifEndFunctionNothing happens there.
Where should this script go ? Is it ok ?
Thanks in advance, I am stuck

