politicpolice Posted August 16, 2017 Posted August 16, 2017 I'm having an unusual problem that I can't find answers to on google. I have an MCM script and another script that I wish to pass properties in between. MCMscript:Scriptname MCMscript extends SKI_ConfigBaseFloat Property testing=10.0 Auto SomeScript:Scriptname SomeScript extends QuestMCMscript Property MCM Auto Event OnInit()Debug.Notification(MCM.testing)EndEvent The notification says "0.000000". What's going on here? I don't think there is anything wrong with my scripts. I get this in my papyrus log: Cannot call testing() on a None object, aborting function call stack Any ideas?
vinfamy Posted August 16, 2017 Posted August 16, 2017 I'm having an unusual problem that I can't find answers to on google. I have an MCM script and another script that I wish to pass properties in between. MCMscript: Scriptname MCMscript extends SKI_ConfigBase Float Property testing=10.0 Auto SomeScript: Scriptname SomeScript extends Quest MCMscript Property MCM Auto Event OnInit() Debug.Notification(MCM.testing) EndEvent The notification says "0.000000". What's going on here? I don't think there is anything wrong with my scripts. I get this in my papyrus log: Cannot call testing() on a None object, aborting function call stack Any ideas? MCMscript Property MCM Auto Have you selected the quest that the script is attached to for this property? Or if it's not attached to a quest, you'll have to cast whatever it attaches to as MCMScript
Guest Posted August 16, 2017 Posted August 16, 2017 1) Do not call a script MCMScript, give it a name that will be unique 2) Do not initialize the property this way, define it without the assignment, and assign it in the OnConfigInit() or on the CK
politicpolice Posted August 16, 2017 Author Posted August 16, 2017 MCMscript Property MCM Auto Have you selected the quest that the script is attached to for this property? Or if it's not attached to a quest, you'll have to cast whatever it attaches to as MCMScript The MCMscript is within its own quest, named something different. So MCMscript should be the script and not the quest. 1) Do not call a script MCMScript, give it a name that will be unique 2) Do not initialize the property this way, define it without the assignment, and assign it in the OnConfigInit() or on the CK Don't worry, the name is just for the example. I also tried initialising the property through the CK without difference in results. I'm wondering if there's something wrong with the way my compiler is setup, as seemingly I can't pass properties between any two quest scripts. That or I'm being silly. Has anyone experienced these kinds of things, where the cause was in the compiling? Thanks for the replies
politicpolice Posted August 16, 2017 Author Posted August 16, 2017 I tried reinstalling my compiler with no success. What is the best way to pass properties from one script to another (just so I can make absolutely sure it's not my implementation that is causing the issues)?
Andy14 Posted August 16, 2017 Posted August 16, 2017 Use Globals for this. In CK create a Global with name testing. (Is in Miscellaneous.) Settings; Float, value 10.0 (if is not a Constant, this is only a default) Save the Global. Save the ESP. In MCM -Quest ->Script->Properties: ad a New Property: Type -> Global Variable - called it testing. (If it the same name, Values are Autofilled) Edit your MCM-Script in your MCM-Quest: Right click->Edit Source. In the source this Line is addet. It's better, to move this line on the top. Save the source. GlobalVariable Property testing Auto This Line you can use in other scripts. You should add it just like in MCM-Script. It is easier for Autofill. For set the Value in MCM and other Scripts: testing.setValue(your Floatavalue) For get the Value in MCM and other Scripts Float MyFloat = testing.getValue() PS: By the way, if you want to compile MCM scripts, you need the sources ski_xxxx.psc. Not the pex files.
vinfamy Posted August 16, 2017 Posted August 16, 2017 The MCMscript is within its own quest, named something different. So MCMscript should be the script and not the quest. I know it's a script. But how is it supposed to know where to find the script of such name if you don't point it to the quest it's attached to. You have to select that quest in the property, the type is still MCMScript which means it will fetch you the script, not the quest.
politicpolice Posted August 16, 2017 Author Posted August 16, 2017 [...] Thank you for the detailed information. The MCMscript is within its own quest, named something different. So MCMscript should be the script and not the quest. I know it's a script. But how is it supposed to know where to find the script of such name if you don't point it to the quest it's attached to. You have to select that quest in the property, the type is still MCMScript which means it will fetch you the script, not the quest. By the nines, I'm an idiot. Somehow I didn't do that. Thank you very much.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.