FirstVaultDweller Posted December 8, 2018 Share Posted December 8, 2018 (edited) Hi all,I have a button (ID: RedR_ButtonBox) that is by default ON (i know it's not a usual Button).Wanted to be ON when i push it i couldn't find any options so i thought maybe disable theGlow effect in the Material Editor but that does nothing or do i something wrong?I hope there is someone out there who knows an option to do that if there isn't one than i'll have to usea second method and that is to swap the texture so when i activate the button it's gonna swap the texture.Is there a script for that guys? :confused: [EDIT] Finally i managed to disable the glow within the Material Editor under the tab Material and unchecking the "Emittance Enabled" option , instead of unchecking the Glow like i did it in the first place.- So now the only thing i need help with is to have a script attached to a button for swapping texture (BGSM) OnActivate. Edited December 8, 2018 by H3S Link to comment Share on other sites More sharing options...
FirstVaultDweller Posted December 9, 2018 Author Share Posted December 9, 2018 (edited) I don't understand, why i can't find a simple script line for swapping material OnActivate ? :wallbash:There has to be a script for that right ? :confused: [EDIT] I find two scripts with hours of searching, not sure if it's what i need but still if one of this scripts is the good one, it gives errors and cant figure out where to put my custom material (texture) ? SCRIPT 1 Scriptname ___TESTINGscript extends ObjectReference ObjectReference Property xButton01 Auto Const Event OnActivate(ObjectReference akActionRef) MatSwap myMaterialSwap = xButton01.GetMaterialSwap() Debug.Trace("Got the material swap "+myMaterialSwap+" from the "+ObjectReference+" reference.") EndEvent ERROR 1 Papyrus Compiler Version 2.8.0.4 for Fallout 4 Copyright (C) ZeniMax Media. All rights reserved. Starting 1 compile threads for 1 files... Compiling "___TESTINGscript"... C:\Users\H3S\AppData\Local\Temp\PapyrusTemp\___TESTINGscript.psc(8,66): ObjectReference is not a variable No output generated for ___TESTINGscript, compilation failed. Batch compile of 1 files finished. 0 succeeded, 1 failed. Failed on ___TESTINGscript SCRIPT 2 Scriptname ___TESTINGscript extends ObjectReference ObjectReference Property xButton01 Auto Const Event OnActivate(ObjectReference akActionRef) Game.GetPlayer().ApplyMaterialSwap(xButton01) EndEvent ERROR 2 Papyrus Compiler Version 2.8.0.4 for Fallout 4 Copyright (C) ZeniMax Media. All rights reserved. Starting 1 compile threads for 1 files... Compiling "___TESTINGscript"... C:\Users\H3S\AppData\Local\Temp\PapyrusTemp\___TESTINGscript.psc(7,36): type mismatch on parameter 1 - cannot pass a objectreference to a matswap No output generated for ___TESTINGscript, compilation failed. Batch compile of 1 files finished. 0 succeeded, 1 failed. Failed on ___TESTINGscript Anyone any idea ? Edited December 9, 2018 by H3S Link to comment Share on other sites More sharing options...
werr92 Posted December 9, 2018 Share Posted December 9, 2018 (edited) Well, the errors, which the compiler provides, are pretty much self explanatory. Script 1: delete the line "debug.trace(...)". Honestly, I doubt that anyone in the right mind looks inside a debug file when writing scripts like these. And yes, you made a logical mistake in that line when was trying to take that bit of code from wiki. Script 2. That just doesn't make any sense. What you're doing is applying an Object Reference to the Player (which even sounds a little bit off). While what you should be doing is applying a Material Swap to the Object Reference (a button in your case). xButton01.ApplyMaterialSwap(MStoApply) P.s. and don't forget to declare an MStoApply property. That one being of MatSwap type. Edited December 9, 2018 by werr92 Link to comment Share on other sites More sharing options...
FirstVaultDweller Posted December 9, 2018 Author Share Posted December 9, 2018 (edited) Well, the errors, which the compiler provides, are pretty much self explanatory. Script 1: delete the line "debug.trace(...)". Honestly, I doubt that anyone in the right mind looks inside a debug file when writing scripts like these. And yes, you made a logical mistake in that line when was trying to take that bit of code from wiki. Script 2. That just doesn't make any sense. What you're doing is applying an Object Reference to the Player (which even sounds a little bit off). While what you should be doing is applying a Material Swap to the Object Reference (a button in your case). xButton01.ApplyMaterialSwap(MStoApply) P.s. and don't forget to declare an MStoApply property. That one being of MatSwap type. Hi werr92, thnx for your reply. I'm confused about which is better ?Did what you said and Script 1 has no errors anymore but does nothing so it's not really working or i missed something else.And with Script 2 i still get a error. I tried other property style no success. But i think i'm almost there.(i hope)Here is my updated Script 2 with the error: Scriptname ___TESTINGscript extends ObjectReference ObjectReference Property xButton01 Auto Const ObjectReference Property MStoApply Auto Const Event OnActivate(ObjectReference akActionRef) xButton01.ApplyMaterialSwap(MStoApply) EndEvent Papyrus Compiler Version 2.8.0.4 for Fallout 4 Copyright (C) ZeniMax Media. All rights reserved. Starting 1 compile threads for 1 files... Compiling "___TESTINGscript"... C:\Users\H3S\AppData\Local\Temp\PapyrusTemp\___TESTINGscript.psc(8,29): type mismatch on parameter 1 - cannot pass a objectreference to a matswap No output generated for ___TESTINGscript, compilation failed. Batch compile of 1 files finished. 0 succeeded, 1 failed. Failed on ___TESTINGscript [EDIT] I find out on CK.COM/.. that the Creation Kit cannot fill a property to a MatSwap Script type and need F4SE. It's getting to difficult now so ill do it with the enable/disable script for all my Buttons i guess. (what i rather not do cuz is not the best way for something like this but no choice this is the simplest what i know) Anyway i really appreciate your help thnx. :thumbsup: Btw, please let me know if i'm wrong and there is a simpler script for that if not ill give up. Have a nice day. :smile: Edited December 9, 2018 by H3S Link to comment Share on other sites More sharing options...
Recommended Posts