thingy123 Posted May 18, 2016 Share Posted May 18, 2016 Hey guys. I'm trying to get something like "Set CLMAFREE to 1" papyrus kind of script for my mod. So I got this in my notepad, and tried experimenting with these. But nothing came out of it.My global value is: CLMAFREEDetermines whether your Custom Legendary modifications will be free or notCONSOLE:CLMAFREE.SetValue(1) // FREECLMAFREE.SetValue(0) // NOT FREECLMAFREE.SetValue(2) // CAN'T CRAFT, HAVE TO FIND IT ScriptName GlobalVariable extends Form Native Hiddenfloat function GetValue(CLMAFREE)float function SetValue(CLMAFREE 1) I have a feeling I might have screwed up something from somewhere, or did it in a wrong way. Is there any right way of doing it?Update 1:Tried something like this earlier: like globalvar property CLMAFREE auto CLMAFREE.setvalue( 1 )then I get errors like this: Papyrus Compiler Version 2.8.0.4 for Fallout 4 Copyright © ZeniMax Media. All rights reserved. Starting 1 compile threads for 1 files... Compiling "Fragments:Terminals:TERM_01CLMTerminalConfig_0202AF0A_2"... C:\Users\xxx\AppData\Local\Temp\PapyrusTemp\Fragments\Terminals\TERM_01CLMTerminalConfig_0202AF0A_2.psc(7,10): no viable alternative at input 'property' No output generated for Fragments:Terminals:TERM_01CLMTerminalConfig_0202AF0A_2, compilation failed.Batch compile of 1 files finished. 0 succeeded, 1 failed. Failed on Fragments:Terminals:TERM_01CLMTerminalConfig_0202AF0A_2 This solution didn't work. Update 2:Tried this way:Scriptname CLMConfig extends GlobalVariable float Function GetValue(CLMAFREE)Function SetValue(1) Got this:Papyrus Compiler Version 2.8.0.4 for Fallout 4Copyright © ZeniMax Media. All rights reserved.Starting 1 compile threads for 1 files...Compiling "Fragments:Terminals:TERM_01CLMTerminalConfig_0202AF0A_2"...C:\Users\xxx\AppData\Local\Temp\PapyrusTemp\Fragments\Terminals\TERM_01CLMTerminalConfig_0202AF0A_2.psc(7,0): no viable alternative at input 'Scriptname'C:\Users\xxx\AppData\Local\Temp\PapyrusTemp\Fragments\Terminals\TERM_01CLMTerminalConfig_0202AF0A_2.psc(0,0): error while attempting to read script Fragments:Terminals:TERM_01CLMTerminalConfig_0202AF0A_2: Object reference not set to an instance of an object.No output generated for Fragments:Terminals:TERM_01CLMTerminalConfig_0202AF0A_2, compilation failed. Batch compile of 1 files finished. 0 succeeded, 1 failed.Failed on Fragments:Terminals:TERM_01CLMTerminalConfig_0202AF0A_2I really can't figure this out. Is there anyone that know the proper script for setvalue for globals? Link to comment Share on other sites More sharing options...
ant2888 Posted May 18, 2016 Share Posted May 18, 2016 I'm not entirely sure what you're trying to do but I'd recommend skimming through the wiki http://www.creationkit.com/fallout4/index.php?title=Category:Papyrus. If you are trying to create a global variable for your papyrus scripts to modify I'd recommend adding it by using the creation kit. So since you want a CLMAFREE variable you go into the creation kit and find a GLOB variable (GameDaysPassed is one), duplicate that variable then right-click edit. Change the name to CLMAFREE and the value to what you want it to start as MAKE SURE CONST IS NOT CHECKED. After that you are free to play with it in your papyrus scripts for example: Scriptname TestScript extends ObjectReference GlobalVariable property CLMAFREE auto Event onActivate(ObjectReference obj) if (obj == Game.getPlayer()) CLMAFREE.setValue(1) debug.MessageBox("The val in CLMAFREE: "+CLMAFREE) endif endEvent Now the important part is to click properties and for the property name CLMAFREE you click it then, on the right, select the CLMAFREE object you created earlier (via Pick Object: ). Again I'm not really sure what you're after but this should set you up. Link to comment Share on other sites More sharing options...
Recommended Posts