Jump to content

aedenthorn

Premium Member
  • Posts

    21
  • Joined

  • Last visited

Nexus Mods Profile

1 Follower

About aedenthorn

Profile Fields

  • Country
    None

Recent Profile Visitors

174714 profile views

aedenthorn's Achievements

Explorer

Explorer (4/14)

0

Reputation

  1. Thanks everyone for using the Boss Creatures mod, I was surprised how much attention it has gotten! Please help me tweak it by answering this poll and leaving comments here about what's wrong with the bosses - they are still in their infancy and lots can be tweaked.
  2. I was given the answer by schlangster: And indeed, that was it. Changing the registration line to: registry->RegisterFunction(new NativeFunction3 <StaticFunctionTag, float, BSFixedString, BSFixedString, BSFixedString>("FuzRoBork_setMCMConfig", "FuzRoBork", FuzRoBorkNamespace::setMCMConfig, registry)); Allowed me to build the project, and the function is accessible from Papyrus as expected, using: Function FuzRoBork_setMCMConfig(string strings, string booleans, string floats) global native
  3. So, I've been trying to follow the guides here: http://forums.nexusmods.com/index.php?/topic/863175-can-someone-explain-skse-plugins-to-me/?p=12698303 and here: https://github.com/xanderdunn/skaar/wiki/Registering-Functions And so far I've got everything working until I finally try to register my plugin with the following call: registry->RegisterFunction(new NativeFunction3 <StaticFunctionTag, float, string, string, string>("FuzRoBork_setMCMConfig", "FuzRoBork", FuzRoBorkNamespace::setMCMConfig, registry)); There are no errors until I try to compile it, at which point I am told by VS 2015: I assume this has something to do with dependencies? My skse includes are: #include "skse/GameEvents.h" #include "skse/GameRTTI.h" #include "skse/GameForms.h" #include "skse/GameObjects.h" #include "skse/GameReferences.h" #include "skse/GameForms.h" #include "skse/PluginAPI.h" #include "skse/PapyrusArgs.h" #include "skse/PapyrusVM.h" #include "skse/PapyrusNativeFunctions.h" I'm not highly skilled at C++ programming, so I can't really understand the error, beyond that it can't find kTypeID in relation to BaseType, as per PapyrusArgs.h: template <typename T> UInt32 GetTypeID <T *>(VMClassRegistry * registry) { UInt32 result; typedef remove_pointer <IsArrayType<T>::TypedArg>::type BaseType; if(!IsArrayType<T>::value) { result = GetTypeIDFromFormTypeID(BaseType::kTypeID, registry); } else { // Arrays are ClassInfo ptr + 1 result = GetTypeIDFromFormTypeID(BaseType::kTypeID, registry) | VMValue::kType_Identifier; } return result; } Can anyone shed light on this? Much obliged.
  4. I'm not using properties, am I? Just that one function, the rest are ordinary variables. My suspicion is that what ever you mean by "filling" properties is precisely what is keeping this from working... but... I've put it all back in one script and everything works fine. I just run my event registering stuff using OnGameReload and am able to save and send variables to the UI fine.
  5. Unless I am mistaken, even starting a new game doesn't allow me to run one function from the other script. I disable the mod, start Skyrim, start a new game, save the game, close Skyrim, enable the mod, start skyrim, load the new game, and it still doesn't call the doSendVals() function in the MCM script from the non-MCM script on the onMenuOpen event.
  6. I'm sorry, I don't understand what this means... does the MCM quest only update on a new game? Maybe that's my problem then... Yeah, sorry, that was a temp thing... removed, still doesn't help. I've changed the setup now, putting the variables back solely in the MCM script. It is in its own quest, as per the documentation. The other script (in its own quest) now just has the following: ScriptName BorkFunctions extends Quest BorkMCM Property mcm Auto Event OnInit() RegisterForMenu("Dialogue Menu") Debug.Notification("Bork, Bork, Bork!") EndEvent Event OnMenuOpen(string menuName) Debug.Notification("Opening menu!") mcm.doSendVals(); RegisterForKey(42); endEvent Event OnKeyDown(Int KeyCode) Debug.Notification("Shift pressed!") UI.Invoke("Dialogue Menu", "_root.DialogueMenu_mc.doSendTextForSpeech") endEvent Event OnMenuClose(string menuName) Debug.Notification("Closing menu!") UnregisterForKey(42); endEvent But the line mcm.doSendVals(); doesn't actually call the function in the other script... it's as if I can't really access one script from another. Whether I try accessing properties or functions, I seem to get nothing from them. Here's the current BorkMCM script: ScriptName BorkMCM extends SKI_ConfigBase Import Form bool skipVal = true; bool playPlayerVal = true; int pLangVal = 0; int fLangVal = 0; int mLangVal = 0; int playKeyVal = 42; ;slider states float msVal = 500.0; float volVal = 30.0; float pRateVal = 1.0; float fRateVal = 1.0; float mRateVal = 1.0; string[] LangList; string[] LCIDList; Event OnConfigInit() LangList = new string[4] LangList[0] = "US English" LangList[1] = "British English" LangList[2] = "Australian English" LangList[3] = "Indian English" LCIDList = new string[4] LCIDList[0] = "409" LCIDList[1] = "809" LCIDList[2] = "c09" LCIDList[3] = "4009" EndEvent event OnPageReset(string page) {Called when a new page is selected, including the initial empty page} SetCursorFillMode(TOP_TO_BOTTOM) SetCursorPosition(0) ; Can be removed because it starts at 0 anyway AddHeaderOption("General") AddToggleOptionST("playPlayerST","Speak Player Text", playPlayerVal) AddToggleOptionST("SkipST","Skip Empty Responses", skipVal) AddSliderOptionST("msST","Text duration", msVal, "{0} ms / word") AddSliderOptionST("volST","Speech Volume", volVal, "{0}%") SetCursorPosition(1) ; Move cursor to top right position AddHeaderOption("Languages") AddTextOptionST("pLangST","Player Language", LangList[pLangVal]) AddTextOptionST("fLangST","Female NPC Language", LangList[fLangVal]) AddTextOptionST("mLangST","Male NPC Language", LangList[mLangVal]) AddHeaderOption("Rates") AddSliderOptionST("pRateST","Player Speech Rate", pRateVal, "{1}x") AddSliderOptionST("fRateST","Female Speech Rate", fRateVal, "{1}x") AddSliderOptionST("mRateST","Male Speech Rate", mRateVal, "{1}x") endEvent state playPlayerST event OnSelectST() playPlayerVal = !playPlayerVal SetToggleOptionValueST(playPlayerVal) endEvent event OnDefaultST() playPlayerVal= true SetToggleOptionValueST( playPlayerVal) endEvent event OnHighlightST() SetInfoText("Play player dialogue as well") endEvent endState state skipST event OnSelectST() skipVal = !skipVal SetToggleOptionValueST(skipVal) endEvent event OnDefaultST() skipVal = true SetToggleOptionValueST(skipVal) endEvent event OnHighlightST() SetInfoText("Don't play back silent dialog for empty dialog responses") endEvent endState state pLangST event OnSelectST() pLangVal += 1 if(pLangVal > 3) pLangVal = 0 endif SetTextOptionValueST(LangList[pLangVal]) endEvent event OnDefaultST() pLangVal = 0; SetTextOptionValueST(LangList[0]) endEvent event OnHighlightST() SetInfoText("Language for player character voice") endEvent endState state fLangST event OnSelectST() fLangVal += 1 if(fLangVal > 3) fLangVal = 0; endif SetTextOptionValueST(LangList[fLangVal]) endEvent event OnDefaultST() fLangVal = 1 SetTextOptionValueST(LangList[1]) endEvent event OnHighlightST() SetInfoText("Language for female NPC voice") endEvent endState state mLangST event OnSelectST() mLangVal += 1 if(mLangVal > 3) mLangVal = 0; endif SetTextOptionValueST(LangList[mLangVal]) endEvent event OnDefaultST() mLangVal = 1 SetTextOptionValueST(LangList[1]) endEvent event OnHighlightST() SetInfoText("Language for male NPC voice") endEvent endState state msST event OnSliderOpenST() SetSliderDialogStartValue(msVal) SetSliderDialogDefaultValue(500) SetSliderDialogRange(100, 2000) SetSliderDialogInterval(1) endEvent event OnSliderAcceptST(float value) msVal = value SetSliderOptionValueST(value, "{0} ms / word") endEvent event OnDefaultST() msVal = 500 SetSliderOptionValueST(msVal, "{0} ms / word") endEvent event OnHighlightST() SetInfoText("Number of milliseconds it takes to say a word") endEvent endState state volST event OnSliderOpenST() SetSliderDialogStartValue(volVal) SetSliderDialogDefaultValue(30) SetSliderDialogRange(1,100) SetSliderDialogInterval(1) endEvent event OnSliderAcceptST(float value) volVal = value as int SetSliderOptionValueST(volVal, "{0}%" ) endEvent event OnDefaultST() volVal = 30 SetSliderOptionValueST(volVal, "{0}%" ) endEvent event OnHighlightST() SetInfoText("Speech volume %") endEvent endState state pRateST event OnSliderOpenST() SetSliderDialogStartValue(pRateVal) SetSliderDialogDefaultValue(1) SetSliderDialogRange(0.1,5) SetSliderDialogInterval(0.1) endEvent event OnSliderAcceptST(float value) pRateVal = value as int SetSliderOptionValueST(pRateVal, "{1}x" ) endEvent event OnDefaultST() pRateVal = 1 SetSliderOptionValueST(pRateVal, "{1}x" ) endEvent event OnHighlightST() SetInfoText("Rate of speech for PC") endEvent endState state fRateST event OnSliderOpenST() SetSliderDialogStartValue(fRateVal) SetSliderDialogDefaultValue(1) SetSliderDialogRange(0.1,5) SetSliderDialogInterval(0.1) endEvent event OnSliderAcceptST(float value) fRateVal = value as int SetSliderOptionValueST(fRateVal, "{1}x" ) endEvent event OnDefaultST() fRateVal = 50 SetSliderOptionValueST(fRateVal, "{1}x" ) endEvent event OnHighlightST() SetInfoText("Rate of speech for female NPC") endEvent endState state mRateST event OnSliderOpenST() SetSliderDialogStartValue(mRateVal) SetSliderDialogDefaultValue(1) SetSliderDialogRange(0.1,5) SetSliderDialogInterval(0.1) endEvent event OnSliderAcceptST(float value) mRateVal = value as int SetSliderOptionValueST(mRateVal, "{1}x") endEvent event OnDefaultST() mRateVal = 1 SetSliderOptionValueST(mRateVal, "{1}x") endEvent event OnHighlightST() SetInfoText("Rate of speech for male NPC") endEvent endState Function doSendVals() Debug.Notification("Sending variables...") Debug.Notification("Player lang: "+pLangVal) Debug.Notification("Player Language: "+LCIDList[pLangVal]) UI.SetBool("Dialogue Menu", "_root.DialogueMenu_mc.skipVal", skipVal) UI.SetBool("Dialogue Menu", "_root.DialogueMenu_mc.playPlayerVal", playPlayerVal) UI.SetFloat("Dialogue Menu", "_root.DialogueMenu_mc.msVal", msVal) UI.SetFloat("Dialogue Menu", "_root.DialogueMenu_mc.volVal", volVal) UI.SetString("Dialogue Menu", "_root.DialogueMenu_mc.pLangVal", LCIDList[pLangVal]) UI.SetString("Dialogue Menu", "_root.DialogueMenu_mc.fLangVal", LCIDList[fLangVal]) UI.SetString("Dialogue Menu", "_root.DialogueMenu_mc.mLangVal", LCIDList[mLangVal]) UI.SetFloat("Dialogue Menu", "_root.DialogueMenu_mc.pRateVal", pRateVal) UI.SetFloat("Dialogue Menu", "_root.DialogueMenu_mc.fRateVal", fRateVal) UI.SetFloat("Dialogue Menu", "_root.DialogueMenu_mc.mRateVal", mRateVal) UI.Invoke("Dialogue Menu", "_root.DialogueMenu_mc.doSendVars") EndFunction
  7. Too much, it seems... I'm trying to first of all get the variables to persist somewhere; when I was just using a single script I could get this to work. Now that I'm using two scripts in two quests, I can't get them to even set in the second script (as per the above code in the first script) - the sliders just keep resetting when I finish adjusting them. The second script is as follows: ScriptName BorkFunctions extends Quest Import Form ; Toggle states bool Property skipVal Auto; bool Property playPlayerVal Auto; string[] Property LangList Auto; string[] Property LCIDList Auto; int Property pLangVal Auto; int Property fLangVal Auto; int Property mLangVal Auto; ; unused int Property playKeyVal Auto; ;slider states float Property msVal Auto; float Property volVal Auto; float Property pRateVal Auto; float Property fRateVal Auto; float Property mRateVal Auto; Event OnInit() ; Toggle states skipVal = true; playPlayerVal = true; pLangVal = 0; fLangVal = 0; mLangVal = 0; ; unused playKeyVal = 42; ;slider states msVal = 500.0; volVal = 30.0; pRateVal = 1.0; fRateVal = 1.0; mRateVal = 1.0; LangList = new string[4] LangList[0] = "US English" LangList[1] = "British English" LangList[2] = "Australian English" LangList[3] = "Indian English" LCIDList = new string[4] LCIDList[0] = "409" LCIDList[1] = "809" LCIDList[2] = "c09" LCIDList[3] = "4009" RegisterForMenu("Dialogue Menu") Debug.Notification("Bork, Bork, Bork!") EndEvent Event OnMenuOpen(string menuName) ; Toggle states skipVal = true; playPlayerVal = true; pLangVal = 1; fLangVal = 0; mLangVal = 0; ; unused playKeyVal = 42; ;slider states msVal = 500.0; volVal = 30.0; pRateVal = 1.0; fRateVal = 1.0; mRateVal = 1.0; doSendVals(); RegisterForKey(42); endEvent Event OnKeyDown(Int KeyCode) UI.Invoke("Dialogue Menu", "_root.DialogueMenu_mc.doSendTextForSpeech") endEvent Event OnMenuClose(string menuName) UnregisterForKey(42); endEvent Function doSendVals() Debug.Notification("Player Language: "+LCIDList[pLangVal]) UI.SetBool("Dialogue Menu", "_root.DialogueMenu_mc.skipVal", skipVal) UI.SetBool("Dialogue Menu", "_root.DialogueMenu_mc.playPlayerVal", playPlayerVal) UI.SetFloat("Dialogue Menu", "_root.DialogueMenu_mc.msVal", msVal) UI.SetFloat("Dialogue Menu", "_root.DialogueMenu_mc.volVal", volVal) UI.SetString("Dialogue Menu", "_root.DialogueMenu_mc.pLangVal", LCIDList[pLangVal]) UI.SetString("Dialogue Menu", "_root.DialogueMenu_mc.fLangVal", LCIDList[fLangVal]) UI.SetString("Dialogue Menu", "_root.DialogueMenu_mc.mLangVal", LCIDList[mLangVal]) UI.SetFloat("Dialogue Menu", "_root.DialogueMenu_mc.pRateVal", pRateVal) UI.SetFloat("Dialogue Menu", "_root.DialogueMenu_mc.fRateVal", fRateVal) UI.SetFloat("Dialogue Menu", "_root.DialogueMenu_mc.mRateVal", mRateVal) UI.Invoke("Dialogue Menu", "_root.DialogueMenu_mc.doSendVars") EndFunction
  8. Thanks for being patient with me... sorry for the ignorance. So where should I set default values for my variables? I guess the onInit function is only called when the plugin is first installed, right? But what if the plugin is reinstalled? I guess the variables are reset? I'm not able to have my MCM script change the values of variables in another script. Do they have to be in the same quest? I have two scripts in two different quests, one has the MCM script, and is set up as in the documentation. The other quest has my function script, which is actually trying to send the variables to the UI via UI.setString(), etc. But the following doesn't work: ScriptName BorkMCM extends SKI_ConfigBase Conditional BorkFunctions Property borkF Auto event OnPageReset(string page) mRateID = AddSliderOptionST("mRateST","Male Speech Rate", borkF.mRateVal, "{1}x") endEvent state mRateST event OnSliderOpenST() SetSliderDialogStartValue(borkF.mRateVal) SetSliderDialogDefaultValue(1) SetSliderDialogRange(0.1,5) SetSliderDialogInterval(0.1) endEvent event OnSliderAcceptST(float value) borkF.mRateVal = value as int SetSliderOptionValueST(borkF.mRateVal, "{1}x" ) endEvent event OnDefaultST() borkF.mRateVal = 1 SetSliderOptionValueST(borkF.mRateVal, "{1}x" ) endEvent event OnHighlightST() SetInfoText("Rate of speech for male NPC") endEvent endState The rate just keeps going back to 0 every time I try to change it.
  9. Oh, thank you, that makes much better sense. I've been struggling now for a day with this, trying to figure out how MCM is expected to work. I'll just have my MCM script change the variables in my other script then. I'm still struggling with persistence... does DLC1SeranaRef.AllowRaiseDead = !DLC1SeranaRef.AllowRaiseDead actually change the boolean in the other script permanently? I guess so... like when the user reloads the game, it will still be set? Like, suppose my other scripts says: OnInit AllowRaiseDead = true and then in my MCM script, I have it do DLC1SeranaRef.AllowRaiseDead = !DLC1SeranaRef.AllowRaiseDeadWhat happens when the first script loads again? Doesn't it reset the value to true?
  10. Thanks, I get it. I was just thrown off by the MCM documentation which has everything private.
  11. Ah, thanks... so really, I could just save myself trouble by putting all my code in one script. Still, it's surprising that MCM doesn't have functions that allow to access the saved variables.
  12. I can only assume this is so blatantly obvious that the devs didn't see fit to actually include it in the tutorial, but after setting up a wonderful MCM menu for my mod, I can't for the life of me figure out how to actually access the variables that I've set from another script. And scouring the documentation makes me none the wiser. I'm sure I must be missing something obvious; can anyone point out to me how to access the config settings I've set using MCM? E.g. In the case of: int pRateID; float pRateVal = 1.0; event OnPageReset(string page) pRateID = AddSliderOption("Player Speech Rate", pRateVal, "{0}x") ... Once I've set and changed this value, it sticks fine from session to session, but how do I get the new value? There doesn't appear to be anything in the API to show how this works. Or maybe I'm just dumb.
  13. Hey, I'm currently trying to find a way to tell ActionScript to do something from C++. I've managed to have AS send me the selected text in the Dialogue Menu, and I've interrupted the response process to run some C++ code. After the code runs, I need to tell the ActionScript to run the following function: function doTopicClickedReal() { GameDelegate.call("TopicClicked", [TopicList.selectedEntry.topicIndex]); } in order to actually let the NPC respond. The function is located in DialogueMenu.as, compiled as dialoguemenu.swf. The class it is in is: class DialogueMenu extends MovieClipHow do I call the above ActionScript function "doTopicClickedReal()" from my SKSE plugin in C++?
  14. Hey all, I'm trying to iron out a way to patch into the dialogue menu and send conversations to C++ allowing Text-To-Speech conversion for unvoiced dialogue. Is this something that can be done through Papyrus, or is it something for ActionScript? Either way, I'm still not able to receive data in C++ from the other end. If anyone can help point me in the right direction, it would be most helpful. Here's the plugin so far, all working from the C++ side; not ideal, but working as a proof-of-concept for now: http://www.nexusmods.com/skyrim/mods/68386/?
×
×
  • Create New...