Ed86 Posted June 2, 2015 Posted June 2, 2015 hello, im trying to separate my huge mcm menu in core script and sub scripts, but line 326.28 MilkMCM_Spell_Constructor.Page_Spell_Constructor() gives "cannot call the member function Page_Spell_Constructor() alone or on a type must call it on a variable" error, anyone know how to fix that? ;PAGES event OnPageReset(string page) if page == "" LoadCustomContent("MilkMod/MilkLogo.dds") RefreshStrings() else UnloadCustomContent() endif if page == "$MME_MENU_PAGE_Overview" Page_Overview() elseif page == "$MME_MENU_PAGE_Settings" Page_Settings() elseif page == "$MME_MENU_PAGE_Milking configuration" Page_Milking_Config() elseif page == "$MME_MENU_PAGE_Milk Market Information" Page_Market() elseif page == "$MME_MENU_PAGE_Debug" Page_Debug() elseif page == "$MME_MENU_PAGE_Debug Milk Maid" Page_MilkMaidDebug() elseif page == "$MME_MENU_PAGE_Compatibility check" Page_PluginChecks() elseif page == "Spells" MilkMCM_Spell_Constructor.Page_Spell_Constructor() ;elseif page == "$MME_MENU_PAGE_Armor Management" ; Page_ArmorManagement() endif endEvent MilkMCM.psc MilkMCM_Spell_Constructor.psc
b3lisario Posted June 2, 2015 Posted June 2, 2015 You can't call a function of a script file if you don't have an instance of the script. Unless the function is global. Scriptname Skript Function A() Function B() Global You can call Skript.B() because it's a global function, but no Skript.A() To call A() you must do it from a reference, for example: Skript Property myInstance Auto and then, myInstance.A()
Guest Posted June 2, 2015 Posted June 2, 2015 You forgot to add something like MilkMCM_Spell_Constructor property spellConstructor Auto And reference it to the object where you attach the script.
Ed86 Posted June 2, 2015 Author Posted June 2, 2015 You forgot to add something like MilkMCM_Spell_Constructor property spellConstructor Auto And reference it to the object where you attach the script. thx, though calling it through MilkMCM_Spell_Constructor was enough
Recommended Posts
Archived
This topic is now archived and is closed to further replies.