draco1122 Posted April 27, 2017 Share Posted April 27, 2017 Here is what I got for a new fallout 4 script. Trying to make it so when player activates a container it shows a menu and they can then select a container. More below wall of text. Scriptname aaadREFIGMASTERSCRIPT extends ObjectReference Message Property MainMessage Auto Activator Property aaadPSC_ProvisionedMetalBox_Activator Auto Activator Property aaadFood_Activator Auto Activator Property aaadFoodDryAlt_Activator Auto Event OnActivate (ObjectReference akActionRef)IF akActionRef == Game.GetPlayer()PlayGamebryoAnimation("open" )PlayAnimation("open")MainMessage(akActionRef)EndIFEndEvent Function MainMessage(ObjectReference akActionRef) Int iCount = 99999Int iButton = MainMessage.Show() If iButton == 0 ; All WeaponsaaadPSC_ProvisionedMetalBox_Activator.Activate(akActionRef)Wait( 0.5 )While ( IsInMenuMode() )WaitMenuMode( 0.5 )EndWhileIf iButton == 1 ; OneHandaaadFood_Activator.Activate(akActionRef)Wait( 0.5 )While ( IsInMenuMode() )WaitMenuMode( 0.5 )EndWhileIf iButton == 2 ; TwoHandaaadFoodDryAlt_Activator.Activate(akActionRef)Wait ( 0.5 )While ( IsInMenuMode() )WaitMenuMode( 1.0 )EndWhileIf iButton == 3 ; ExitWait( 0.5 )While ( IsInMenuMode() )WaitMenuMode( 0.5 )EndWhilePlayGamebryoAnimation( "close" )PlayAnimation("close")EndifEndifEndifEndifEndfunction Here is my compiling error.Compiling "aaadREFIGMASTERSCRIPT"...C:\Users\scion\AppData\Local\Temp\PapyrusTemp\aaadREFIGMASTERSCRIPT.psc(25,41): Activate is not a function or does not existC:\Users\scion\AppData\Local\Temp\PapyrusTemp\aaadREFIGMASTERSCRIPT.psc(26,3): Wait is not a function or does not existC:\Users\scion\AppData\Local\Temp\PapyrusTemp\aaadREFIGMASTERSCRIPT.psc(27,11): IsInMenuMode is not a function or does not existC:\Users\scion\AppData\Local\Temp\PapyrusTemp\aaadREFIGMASTERSCRIPT.psc(28,4): WaitMenuMode is not a function or does not existC:\Users\scion\AppData\Local\Temp\PapyrusTemp\aaadREFIGMASTERSCRIPT.psc(27,3): cannot cast a void to a bool to perform a condition checkC:\Users\scion\AppData\Local\Temp\PapyrusTemp\aaadREFIGMASTERSCRIPT.psc(31,22): Activate is not a function or does not existC:\Users\scion\AppData\Local\Temp\PapyrusTemp\aaadREFIGMASTERSCRIPT.psc(32,3): Wait is not a function or does not existC:\Users\scion\AppData\Local\Temp\PapyrusTemp\aaadREFIGMASTERSCRIPT.psc(33,11): IsInMenuMode is not a function or does not existC:\Users\scion\AppData\Local\Temp\PapyrusTemp\aaadREFIGMASTERSCRIPT.psc(34,4): WaitMenuMode is not a function or does not existC:\Users\scion\AppData\Local\Temp\PapyrusTemp\aaadREFIGMASTERSCRIPT.psc(33,3): cannot cast a void to a bool to perform a condition checkC:\Users\scion\AppData\Local\Temp\PapyrusTemp\aaadREFIGMASTERSCRIPT.psc(37,28): Activate is not a function or does not existC:\Users\scion\AppData\Local\Temp\PapyrusTemp\aaadREFIGMASTERSCRIPT.psc(38,3): Wait is not a function or does not existC:\Users\scion\AppData\Local\Temp\PapyrusTemp\aaadREFIGMASTERSCRIPT.psc(39,11): IsInMenuMode is not a function or does not existC:\Users\scion\AppData\Local\Temp\PapyrusTemp\aaadREFIGMASTERSCRIPT.psc(40,4): WaitMenuMode is not a function or does not existC:\Users\scion\AppData\Local\Temp\PapyrusTemp\aaadREFIGMASTERSCRIPT.psc(39,3): cannot cast a void to a bool to perform a condition checkC:\Users\scion\AppData\Local\Temp\PapyrusTemp\aaadREFIGMASTERSCRIPT.psc(43,3): Wait is not a function or does not existC:\Users\scion\AppData\Local\Temp\PapyrusTemp\aaadREFIGMASTERSCRIPT.psc(44,11): IsInMenuMode is not a function or does not existC:\Users\scion\AppData\Local\Temp\PapyrusTemp\aaadREFIGMASTERSCRIPT.psc(45,4): WaitMenuMode is not a function or does not existC:\Users\scion\AppData\Local\Temp\PapyrusTemp\aaadREFIGMASTERSCRIPT.psc(44,3): cannot cast a void to a bool to perform a condition checkNo output generated for aaadREFIGMASTERSCRIPT, compilation failed. Problem is I am confused isn't activate and wait a valid function? I pieced it together from general stores skyrim scripts and creation kit wiki so is that my problem? I am still new to scripting. Just wondering is it my script or do I have a creation kit error. Link to comment Share on other sites More sharing options...
Reneer Posted April 27, 2017 Share Posted April 27, 2017 (edited) First, there were some logic issues with your code. Secondly, you want to use ObjectReferences, not Activators, when pointing to your other containers. Here's what I came up with, but I haven't tested to see if it compiles: Scriptname aaadREFIGMASTERSCRIPT extends ObjectReference Message Property MainMessage Auto ObjectReference Property aaadPSC_ProvisionedMetalBox_Activator Auto ObjectReference Property aaadFood_Activator Auto ObjectReference Property aaadFoodDryAlt_Activator Auto Event OnActivate (ObjectReference akActionRef) if akActionRef == Game.GetPlayer() PlayGamebryoAnimation("open") PlayAnimation("open") MainMessage(akActionRef) endif EndEvent Function MainMessage(ObjectReference akActionRef) Int iCount = 99999 Int iButton = MainMessage.Show() If iButton == 0 ; All Weapons aaadPSC_ProvisionedMetalBox_Activator.Activate(akActionRef) Utility.Wait( 0.5 ) While ( Utility.IsInMenuMode() ) Utility.WaitMenuMode( 0.5 ) EndWhile endif If iButton == 1 ; OneHand aaadFood_Activator.Activate(akActionRef) Utility.Wait( 0.5 ) While ( Utility.IsInMenuMode() ) Utility.WaitMenuMode( 0.5 ) EndWhile endif If iButton == 2 ; TwoHand aaadFoodDryAlt_Activator.Activate(akActionRef) Utility.Wait ( 0.5 ) While ( Utility.IsInMenuMode() ) Utility.WaitMenuMode( 1.0 ) EndWhile endif If iButton == 3 ; Exit Utility.Wait( 0.5 ) While ( Utility.IsInMenuMode() ) Utility.WaitMenuMode( 0.5 ) EndWhile endif PlayGamebryoAnimation( "close" ) PlayAnimation("close") EndfunctionAlso, in the future, this is not really the forum for posting issues like this. You will often get more responses on the Fallout 4 Creation Kit and Modders Forum. Edited April 27, 2017 by Reneer Link to comment Share on other sites More sharing options...
draco1122 Posted April 27, 2017 Author Share Posted April 27, 2017 Thx you for reply. I looked for fallout 4 modding forum but some how I missed it. Thx you for link. Tried that and it failed with same errors on activate and wait not being a valid function. Will post in right place and see what I can come up with. Link to comment Share on other sites More sharing options...
Reneer Posted April 27, 2017 Share Posted April 27, 2017 (edited) Thx you for reply. I looked for fallout 4 modding forum but some how I missed it. Thx you for link. Tried that and it failed with same errors on activate and wait not being a valid function. Will post in right place and see what I can come up with. Oh, my bad. I forgot to add Utility. to the Wait / WaitMenuMode functions (edited the code above to fix that). I'm not sure why the Activate call isn't working, though. Unless you're putting Activators inside the ObjectReference variables by mistake? Edited April 27, 2017 by Reneer Link to comment Share on other sites More sharing options...
draco1122 Posted April 27, 2017 Author Share Posted April 27, 2017 Yea, that worked better only got this error now. Compiling "aaadREFIGMASTERSCRIPT"...C:\Users\scion\AppData\Local\Temp\PapyrusTemp\aaadREFIGMASTERSCRIPT.psc(41,10): IsInMenuMode is not a function or does not existC:\Users\scion\AppData\Local\Temp\PapyrusTemp\aaadREFIGMASTERSCRIPT.psc(41,2): cannot cast a void to a bool to perform a condition checkNo output generated for aaadREFIGMASTERSCRIPT, compilation failed. Link to comment Share on other sites More sharing options...
Reneer Posted April 27, 2017 Share Posted April 27, 2017 (edited) Yea, that worked better only got this error now. Compiling "aaadREFIGMASTERSCRIPT"...C:\Users\scion\AppData\Local\Temp\PapyrusTemp\aaadREFIGMASTERSCRIPT.psc(41,10): IsInMenuMode is not a function or does not existC:\Users\scion\AppData\Local\Temp\PapyrusTemp\aaadREFIGMASTERSCRIPT.psc(41,2): cannot cast a void to a bool to perform a condition checkNo output generated for aaadREFIGMASTERSCRIPT, compilation failed.Fixed that in the above code. I missed one of the Utility additions. I'm sure you could have figured that one out on your own. :smile: Edited April 27, 2017 by Reneer Link to comment Share on other sites More sharing options...
draco1122 Posted April 27, 2017 Author Share Posted April 27, 2017 Thx you so much. It compiled now. Still have a lot to learn but that was a big help. Starting to see where I went wrong tho. Will need to keep learning. Thank you again. Link to comment Share on other sites More sharing options...
Deleted3897072User Posted April 27, 2017 Share Posted April 27, 2017 (edited) I notice that the MainMessage token is overloaded - the same name is used both as a property and as a function. That may not have been the problem, but it's not generally a good thing to do. Edited April 27, 2017 by OldMansBeard Link to comment Share on other sites More sharing options...
draco1122 Posted April 27, 2017 Author Share Posted April 27, 2017 (edited) Yea, that was my doing. Still need to clean things up but, I think with that help I can move forward. Will change that name and do some testing.Final Product was this and has to placed on Door to work in game. Not sure is getplayer matters tho was playing with that. Scriptname aaadREFIGMASTERSCRIPT extends ObjectReference Message Property aaadContaineroptionsMessage Auto Message Property aaadtest Auto Message Property aaadtest2 Auto Message Property aaadtest3 Auto ObjectReference Property aaadPSC_ProvisionedMetalBox_Activator Auto ObjectReference Property aaadFood_Activator Auto ObjectReference Property aaadFoodDryAlt_Activator Auto Event OnActivate (ObjectReference akActionRef)if akActionRef == Game.GetPlayer()PlayGamebryoAnimation("open")PlayAnimation("open")MainMessage(akActionRef)endifEndEvent Function MainMessage(ObjectReference akActionRef) Int iCount = 99999Int iButton = aaadContaineroptionsMessage.Show() If iButton == 0 ; Master Food Chestaaadtest.Show()aaadPSC_ProvisionedMetalBox_Activator.Activate(Game.getPlayer())Utility.Wait( 0.5 )While ( Utility.IsInMenuMode() )Utility.WaitMenuMode( 0.5 )EndWhileendifIf iButton == 1 ; Dry Foods Chestaaadtest2.Show()aaadFood_Activator.Activate(Game.getPlayer())Utility.Wait( 0.5 )While ( Utility.IsInMenuMode() )Utility.WaitMenuMode( 0.5 )EndWhileendifIf iButton == 2 ; Perishable Foods Chestaaadtest3.Show()aaadFoodDryAlt_Activator.Activate(Game.getPlayer())Utility.Wait ( 0.5 )While ( Utility.IsInMenuMode() )Utility.WaitMenuMode( 1.0 )EndWhileendifIf iButton == 3 ; ExitUtility.Wait( 0.5 )While ( Utility.IsInMenuMode() )Utility.WaitMenuMode( 0.5 )EndWhileendifPlayGamebryoAnimation( "close" )PlayAnimation("close")Endfunction Edited April 27, 2017 by draco1122 Link to comment Share on other sites More sharing options...
Recommended Posts