Jump to content

Looking for some scripting advice amd help.


Recommended Posts

So I'm trying to figure out how to script but it is going super slow and i have been reading every tutorial I can find and made copies of some to re-read offline like the one by Cipscis.

 

I am trying to make a menu pop up when you activate a container (Briefcase) That lets you pick it up, open to store stuff, or do nothing. I had an idea for it but it was wrong so many error messages popped.

 

 

I looked kinda like this.

 

 

scn CaseSCRIPT

Begin OnActivate

Set Button to GetButtonPressed

If ButtonPressed == 1
Player.AddItem CaseID

If ButtonPressed == 2
Player.Activate CaseID

If ButtonPressed == 3
Player.exitMenuMode

Endif
End

So i get failures that say Button is an unknown variable and more that I can't remember.

 

I'm also trying to make a summoning device that only works outside not in combat and if the companion (it's a companion mod BTW) is not in the party or is waiting somewhere and is lost or your to lazy to look.

 

scn 001SummonsSCRIPT

Begin OnFire
	If ( Player.IsInInterior == 1 )
					ElseIf ( Player.IsInCombat == 1 ) || ( GetVATSMode != 0 )
		Player.placeatme JTAlphaPrime
	Endif
End

It does work but what do i do to make it work so that if the companion is waiting or not in the party it summons them to you?

Link to comment
Share on other sites

scn CaseSCRIPT

short sMyButton ; You need to declare variables before you can use them.

Begin OnActivate

ShowMessage YourMessage ;need to show the message. Also, activate blocks can't handle wait-for-input code, you need to do those in gameMode or menuMode

End

begin menuMode 1001 ;menuMode 1001 is the message box menu. This code will execute once every frame as long as the window is showing.

Set sMyButton to GetButtonPressed

If sMyButton == 0 ; Make sure the variables are consistent; you were using 'Button' to store the button press, and checking 'ButtonPressed' here. Also, buttons are 0-initialized, rather than 1-initialized
Player.AddItem CaseID
elseIf sMyButton == 1 ;Wrong construction here, you needed if/elseIf/elseIf, not If/If/If
Player.Activate CaseID
endIf ;No need to exit the menu in code, if you have a null button, the menu will close by itself.

end
Link to comment
Share on other sites

scn CpnSummonsSCRIPT ; Changed the name.  Second rule of modding: NEVER begin an editorID with a numeric Character.

Begin OnFire
If ( Player.IsInInterior == 1 )
ElseIf ( Player.IsInCombat == 1 ) || ( GetVATSMode != 0 )
JTAlphaPrimeREF.moveTo player 32 32 0 ; You want to call moveTo on your companion ref, here, NOT use placeAtMe. Place at me creates a NEW item from the base form at the calling reference. MoveTo is called on a reference and moves that reference to the target marker.
Endif
End
Edit because the board is fisking stupid. Edited by Xaranth
Link to comment
Share on other sites

 

scn CpnSummonsSCRIPT ; Changed the name.  Second rule of modding: NEVER begin an editorID with a numeric Character.

Begin OnFire
	If ( Player.IsInInterior == 1 )
	ElseIf ( Player.IsInCombat == 1 ) || ( GetVATSMode != 0 )
		JTAlphaPrimeREF.moveTo player 32 32 0 ; You want to call moveTo on your companion ref, here, NOT use placeAtMe.  Place at me creates a NEW item from the base form at the calling reference.  MoveTo is called on a reference and moves that reference to the target marker.
	Endif
End
Edit because the board is fisking stupid.

I get errors that say CaseID is not a valid item to pick up so i guess that means this is impossible, but thanks for giving me the script maybe someone could make it work just not me.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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