chajapa Posted June 22, 2017 Posted June 22, 2017 Writing a mod ...follower...with quest... and have Milk Mod Economy as a master I have my main quest script with a property set MME_MilkQuest property MME auto and it's pointed to MME's main quest. Now.... if I have MME as a master AND have that property set what's the correct way to access functions within MME? For example: MME has a function like this: bool Function isPregnant(Actor akActor) it checks a bunch of mods to see if the actor is pregnant. What I'd LIKE is to put the result of that function into a variable within MY script... with the hope of being able to use it as a condition for dialogue. MME also stores stuff using StorageUtil and I'd like to access those values too examples: StorageUtil.GetFloatValue(akTarget, "MME.MilkMaid.MilkCount") ; // get milk count from akTarget StorageUtil.GetFloatValue(akTarget, "MME.MilkMaid.Level") ; // get level of akTarget When I've tried to use those I get compiler error that akTarget is not defined. Again I need to store the result in such a way that I can retrieve it and use it as a condition for dialogue. The dropdown for dialogue conditions has a selection for: QuestVariable and you select the quest and then the variable and set comparators.... I just thought having MME as a master would make this easier, but it seems I'm still pretty stupid with this coding stuff.
Swissenergy Posted June 22, 2017 Posted June 22, 2017 You'd need to have as a conditional variable to use it in GetVMQuestVariable and GetVMScriptVariable conditions for dialogue.
chajapa Posted June 22, 2017 Author Posted June 22, 2017 You'd need to have as a conditional variable to use it in GetVMQuestVariable and GetVMScriptVariable conditions for dialogue. Thank you for that... I'm reading I still need to learn how to access those item from MME ... it's set as a master and.... grrrr... I hate being dumb..
jlttsmiley30 Posted June 22, 2017 Posted June 22, 2017 1st I am not a MODDER , 2nd I know less than nothing about writing scripts. That point made, I would recommend you look at the scripts in other mod that do simular things like JUGS or the scripts in milk mod that let an npc know you.re leeking milk. Most scripts are like words in a sentence they just need to be put in the right place to be understood by the engine. GOOD LUCK MILK MOD ECONOMY IS ONE OF MY FAVORITE MODS WOULD LOVE SOME NEW COMTENT
chajapa Posted June 22, 2017 Author Posted June 22, 2017 1st I am not a MODDER , 2nd I know less than nothing about writing scripts. That point made, I would recommend you look at the scripts in other mod that do simular things like JUGS or the scripts in milk mod that let an npc know you.re leeking milk. Most scripts are like words in a sentence they just need to be put in the right place to be understood by the engine. GOOD LUCK MILK MOD ECONOMY IS ONE OF MY FAVORITE MODS WOULD LOVE SOME NEW COMTENT Funny you should mention JUGs....cause... I wrote it! I had a TON of help. And... I've forgotten some stuff. I had originally thought I'd want to pull information from Soul Gem Oven to see if an actor was pregnant. But...but...but... I have MME as a MASTER! And it already HAS that information. I just need to see how to access it.
Swissenergy Posted June 22, 2017 Posted June 22, 2017 If you already have a property pointing to MME_MilkQuest, then all you need to do is: Declare a conditional variable in your script that you will select in your dialogue conditions: Bool Property variablename Auto Conditional Get the info from MME_MilkQuest when needed: variablename = MME.IsPregnant(akTargetActor) Make sure your script is set as conditional, otherwise using the conditions to get script variables won't work.
chajapa Posted June 22, 2017 Author Posted June 22, 2017 If you already have a property pointing to MME_MilkQuest, then all you need to do is: Declare a conditional variable in your script that you will select in your dialogue conditions: Bool Property variablename Auto Conditional Get the info from MME_MilkQuest when needed: variablename = MME.IsPregnant(akTargetActor) Make sure your script is set as conditional, otherwise using the conditions to get script variables won't work. OK... did this. Made bool property isPreg auto conditional that compiles and I can set it to either true or false as a default then simply added "isPreg = MME.IsPregnant(akSpeaker)" into script fragment for a dialogue. Does not compile says "IsPregnant" is not a function tried making a function in my quest main script as: bool property isPreg auto conditional bool Function isPreg(Actor akActor) if MME.IsPregnant(akActor) == true Return True endif Return False EndFunction ....compile error..."isPregnant is not a function or does not exist" the property for MME is Quest property MME auto conditional and set to MME_MilkQuest
Swissenergy Posted June 23, 2017 Posted June 23, 2017 So you have MME set up as a quest property? If so, then that's probably why this isn't working. It needs to be pointing to the script. Example: SexLabFramework Property SexLab Auto SexLabFramework is the script name, not the quest name. So, you'd need to declare a variable pointing to the script attached to MME_MilkQuest that you want, not the quest itself: ScriptName Property MME Auto When filling the property it'll show the quest name, and that is correct. Also, where is the variable you're setting and using? If you're trying to set and use variables from dialogue fragments as conditions (GetVMScriptVariable), that won't work since GetVMScriptVariable can only be used on objects.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.