Jump to content

Script help Fallout 4 confused


Recommended Posts

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)
EndIF
EndEvent
Function MainMessage(ObjectReference akActionRef)
Int iCount = 99999
Int iButton = MainMessage.Show()
If iButton == 0 ; All Weapons
aaadPSC_ProvisionedMetalBox_Activator.Activate(akActionRef)
Wait( 0.5 )
While ( IsInMenuMode() )
WaitMenuMode( 0.5 )
EndWhile
If iButton == 1 ; OneHand
aaadFood_Activator.Activate(akActionRef)
Wait( 0.5 )
While ( IsInMenuMode() )
WaitMenuMode( 0.5 )
EndWhile
If iButton == 2 ; TwoHand
aaadFoodDryAlt_Activator.Activate(akActionRef)
Wait ( 0.5 )
While ( IsInMenuMode() )
WaitMenuMode( 1.0 )
EndWhile
If iButton == 3 ; Exit
Wait( 0.5 )
While ( IsInMenuMode() )
WaitMenuMode( 0.5 )
EndWhile
PlayGamebryoAnimation( "close" )
PlayAnimation("close")
Endif
Endif
Endif
Endif
Endfunction
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 exist
C:\Users\scion\AppData\Local\Temp\PapyrusTemp\aaadREFIGMASTERSCRIPT.psc(26,3): Wait is not a function or does not exist
C:\Users\scion\AppData\Local\Temp\PapyrusTemp\aaadREFIGMASTERSCRIPT.psc(27,11): IsInMenuMode is not a function or does not exist
C:\Users\scion\AppData\Local\Temp\PapyrusTemp\aaadREFIGMASTERSCRIPT.psc(28,4): WaitMenuMode is not a function or does not exist
C:\Users\scion\AppData\Local\Temp\PapyrusTemp\aaadREFIGMASTERSCRIPT.psc(27,3): cannot cast a void to a bool to perform a condition check
C:\Users\scion\AppData\Local\Temp\PapyrusTemp\aaadREFIGMASTERSCRIPT.psc(31,22): Activate is not a function or does not exist
C:\Users\scion\AppData\Local\Temp\PapyrusTemp\aaadREFIGMASTERSCRIPT.psc(32,3): Wait is not a function or does not exist
C:\Users\scion\AppData\Local\Temp\PapyrusTemp\aaadREFIGMASTERSCRIPT.psc(33,11): IsInMenuMode is not a function or does not exist
C:\Users\scion\AppData\Local\Temp\PapyrusTemp\aaadREFIGMASTERSCRIPT.psc(34,4): WaitMenuMode is not a function or does not exist
C:\Users\scion\AppData\Local\Temp\PapyrusTemp\aaadREFIGMASTERSCRIPT.psc(33,3): cannot cast a void to a bool to perform a condition check
C:\Users\scion\AppData\Local\Temp\PapyrusTemp\aaadREFIGMASTERSCRIPT.psc(37,28): Activate is not a function or does not exist
C:\Users\scion\AppData\Local\Temp\PapyrusTemp\aaadREFIGMASTERSCRIPT.psc(38,3): Wait is not a function or does not exist
C:\Users\scion\AppData\Local\Temp\PapyrusTemp\aaadREFIGMASTERSCRIPT.psc(39,11): IsInMenuMode is not a function or does not exist
C:\Users\scion\AppData\Local\Temp\PapyrusTemp\aaadREFIGMASTERSCRIPT.psc(40,4): WaitMenuMode is not a function or does not exist
C:\Users\scion\AppData\Local\Temp\PapyrusTemp\aaadREFIGMASTERSCRIPT.psc(39,3): cannot cast a void to a bool to perform a condition check
C:\Users\scion\AppData\Local\Temp\PapyrusTemp\aaadREFIGMASTERSCRIPT.psc(43,3): Wait is not a function or does not exist
C:\Users\scion\AppData\Local\Temp\PapyrusTemp\aaadREFIGMASTERSCRIPT.psc(44,11): IsInMenuMode is not a function or does not exist
C:\Users\scion\AppData\Local\Temp\PapyrusTemp\aaadREFIGMASTERSCRIPT.psc(45,4): WaitMenuMode is not a function or does not exist
C:\Users\scion\AppData\Local\Temp\PapyrusTemp\aaadREFIGMASTERSCRIPT.psc(44,3): cannot cast a void to a bool to perform a condition check
No 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

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")
Endfunction

Also, 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 by Reneer
Link to comment
Share on other sites

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

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 by Reneer
Link to comment
Share on other sites

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 exist
C:\Users\scion\AppData\Local\Temp\PapyrusTemp\aaadREFIGMASTERSCRIPT.psc(41,2): cannot cast a void to a bool to perform a condition check
No output generated for aaadREFIGMASTERSCRIPT, compilation failed.
Link to comment
Share on other sites

 

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 exist
C:\Users\scion\AppData\Local\Temp\PapyrusTemp\aaadREFIGMASTERSCRIPT.psc(41,2): cannot cast a void to a bool to perform a condition check
No 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 by Reneer
Link to comment
Share on other sites

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

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)
endif
EndEvent
Function MainMessage(ObjectReference akActionRef)
Int iCount = 99999
Int iButton = aaadContaineroptionsMessage.Show()
If iButton == 0 ; Master Food Chest
aaadtest.Show()
aaadPSC_ProvisionedMetalBox_Activator.Activate(Game.getPlayer())
Utility.Wait( 0.5 )
While ( Utility.IsInMenuMode() )
Utility.WaitMenuMode( 0.5 )
EndWhile
endif
If iButton == 1 ; Dry Foods Chest
aaadtest2.Show()
aaadFood_Activator.Activate(Game.getPlayer())
Utility.Wait( 0.5 )
While ( Utility.IsInMenuMode() )
Utility.WaitMenuMode( 0.5 )
EndWhile
endif
If iButton == 2 ; Perishable Foods Chest
aaadtest3.Show()
aaadFoodDryAlt_Activator.Activate(Game.getPlayer())
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")
Endfunction
Edited by draco1122
Link to comment
Share on other sites

  • Recently Browsing   0 members

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