the Sim Settlements forums!

Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!

Problem using papyrus function SetLinkedRef

navmedic

New Member
Messages
9
Friends, I take the first steps in modding, there are some problems. When trying to link a container and a workshop using SetLinkedRef, the function does not execute, the stack has an error. MIBMilitaryBox - my own keyword, valid and declared as property
============================
cont.SetLinkedRef(ws,MIBMilitaryBox)
==============================

[12/26/2023 - 05:12:20PM] SetMilitaryBox: ws=[workshopscript < (001654BD)>] cont: [ObjectReference < (FF03CADE)>]
[12/26/2023 - 05:12:20PM] SetMilitaryBox: SetLinkedRef ws=[workshopscript < (001654BD)>] cont: [ObjectReference < (FF03CADE)>]
[12/26/2023 - 05:12:20PM] warning: Assigning None to a non-object variable named "::temp17"
stack:
[Item 1 in container (FF03CADE)].MIB:MIBMarkerScript.OnContainerChanged() - "C:\Users\Andrey\AppData\Local\Temp\PapyrusTemp\MIB\MIBMarkerScript.psc" Line 39
 

Attachments

  • MIBMarkerScript.psc
    4.3 KB · Views: 1
Those things you say - they terrify me. 0.0

Im not that into coding yet so Im clueless. but I thought maybie you could use a laugh.

2zlxt1.jpg
 
Friends, I take the first steps in modding, there are some problems. When trying to link a container and a workshop using SetLinkedRef, the function does not execute, the stack has an error. MIBMilitaryBox - my own keyword, valid and declared as property
============================
cont.SetLinkedRef(ws,MIBMilitaryBox)
==============================

[12/26/2023 - 05:12:20PM] SetMilitaryBox: ws=[workshopscript < (001654BD)>] cont: [ObjectReference < (FF03CADE)>]
[12/26/2023 - 05:12:20PM] SetMilitaryBox: SetLinkedRef ws=[workshopscript < (001654BD)>] cont: [ObjectReference < (FF03CADE)>]
[12/26/2023 - 05:12:20PM] warning: Assigning None to a non-object variable named "::temp17"
stack:
[Item 1 in container (FF03CADE)].MIB:MIBMarkerScript.OnContainerChanged() - "C:\Users\Andrey\AppData\Local\Temp\PapyrusTemp\MIB\MIBMarkerScript.psc" Line 39
I think you're misunderstanding the error. The error is occuring when it returns from SetMilitaryBox(ws,akNewContainer,abSet=true). This is because SetMilitaryBox is defined as returning a bool value. However you never actually return a bool. So when it returns, the return value is None and the VM is setting a temporary variable of bool type to None. Which is the error you see. Since you never return a value from SetMilitaryBox and you never use a returned value from it. The simplest solution is to remove the bool return value from the function definition.
 
I think you're misunderstanding the error. The error is occuring when it returns from SetMilitaryBox(ws,akNewContainer,abSet=true). This is because SetMilitaryBox is defined as returning a bool value. However you never actually return a bool. So when it returns, the return value is None and the VM is setting a temporary variable of bool type to None. Which is the error you see. Since you never return a value from SetMilitaryBox and you never use a returned value from it. The simplest solution is to remove the bool return value from the function definition.
Thank you for your help, you are right
 
Top