Jump to content

Papyrus scripts can't read each others' properties


Recommended Posts

Posted

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?
 
Posted

 

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

Posted

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

 

Posted

 

 

 

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

Posted

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)?

Posted

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.

Posted

 

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.

Posted

[...]

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.

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...