Jump to content

Scripting Help Needed


Recommended Posts

So, this is my first time using the mod author forums (yay! Privileges!), so apologies if this is the wrong forum or something.

 

Anyway, I've got a script I'm making for my mod, Scrap Everything. What I'm trying to do is make a menu that will allow the user to choose whether or not they want to scrap certain items. I have a GetGlobalValue = 1 condition for the constructible objects of the things I want to make not scrappable. Essentially, the script changes the global variable when the button is pressed.

 

I'm new to Papyrus (although I'm currently learning Java as well, so I may have some Java stuff in here by accident because it's quite similar to Papyrus), so I don't know if it's the compiler (I'm using Caprica) or me who is doing something wrong. Probably me... Although I have no idea what I'm doing wrong.

 

The compiler bugs out on the "Choice = SS_ChooseScrapMenu.Show()" line, saying it doesn't have enough arguments.

ScriptName SS_ChooseScrapQuestScript Extends Quest

;-- Imports -----------------------------------------
Import Game

;-- Properties --------------------------------------
Message Property SS_ChooseScrapMenu auto
MiscObject Property SS_ScrapMenuItem auto
FormList Property SS_NoScrapList auto
Form Property SS_workshopScrapRecipe_Roofs auto
Form Property SS_workshopScrapRecipe_Walls auto
Form Property SS_workshopScrapRecipe_Foundations auto
Form Property SS_workshopScrapRecipe_Carports auto
Form Property SS_workshopScrapRecipe_SidewalksRoads auto

;-- Variables ---------------------------------------
GlobalVariable ScrappableRoof ; 0= not scrappable, 1=Scrappable (default)
GlobalVariable ScrappableWall
GlobalVariable ScrappableFoundation
GlobalVariable ScrappableCarport
GlobalVariable ScrappableSWRoad

;-- Functions ---------------------------------------
Event OnInit()
    If GetPlayer().GetItemCount(SS_ScrapMenuItem) == 0
        GetPlayer().AddItem(SS_ScrapMenuItem, 1, false)
    EndIf
EndEvent
Event OnActivate (ObjectReference SS_ScrapMenuItem)
    ScrapMenu()
EndEvent
Function ScrapMenu(bool ScrapMenu = True, int Choice = 0)
    While ScrapMenu
        If ScrapMenu != -1
        Choice = SS_ChooseScrapMenu.Show()
        ScrapMenu = False
            If Choice == 0 
                If SS_NoScrapList.HasForm(SS_workshopScrapRecipe_Roofs)
                    SS_NoScrapList.RemoveAddedForm(SS_workshopScrapRecipe_Roofs)
                    ScrappableRoof.SetValue(1)
                    Debug.Notification("Sanctuary House Roofs are now able to be scrapped")
                Else
                    SS_NoScrapList.AddForm(SS_workshopScrapRecipe_Roofs)
                    ScrappableRoof.SetValue(0)
                    Debug.Notification("Sanctuary House Roofs are no longer able to be scrapped")
                EndIf
            ElseIf Choice == 1
                If SS_NoScrapList.HasForm(SS_workshopScrapRecipe_Foundations)
                    SS_NoScrapList.RemoveAddedForm(SS_workshopScrapRecipe_Foundations)
                    ScrappableFoundation.SetValue(1)
                    Debug.Notification("Sanctuary House Foundations are now able to be scrapped")
                Else
                    SS_NoScrapList.AddForm(SS_workshopScrapRecipe_Foundations)
                    ScrappableFoundation.SetValue(0)
                    Debug.Notification("Sanctuary House Foundations are no longer able to be scrapped")
                EndIf
            ElseIf Choice == 2
                If SS_NoScrapList.HasForm(SS_workshopScrapRecipe_Carports)
                    SS_NoScrapList.RemoveAddedForm(SS_workshopScrapRecipe_Carports)
                    ScrappableCarport.SetValue(1)
                    Debug.Notification("Carports and Dormers are now able to be scrapped")
                Else
                    SS_NoScrapList.AddForm(SS_workshopScrapRecipe_Carports)
                    ScrappableCarport.SetValue(0)
                    Debug.Notification("Carports and Dormers are no longer able to be scrapped")
                EndIf
            ElseIf Choice == 3
                If SS_NoScrapList.HasForm(SS_workshopScrapRecipe_Walls)
                    SS_NoScrapList.RemoveAddedForm(SS_workshopScrapRecipe_Walls)
                    ScrappableWall.SetValue(1)
                    Debug.Notification("Sanctuary House Walls are now able to be scrapped")
                Else
                    SS_NoScrapList.AddForm(SS_workshopScrapRecipe_Walls)
                    ScrappableWall.SetValue(0)
                    Debug.Notification("Sanctuary House Walls are no longer able to be scrapped")
                EndIf
            ElseIf Choice == 4
                If SS_NoScrapList.HasForm(SS_workshopScrapRecipe_SidewalksRoads)
                    SS_NoScrapList.RemoveAddedForm(SS_workshopScrapRecipe_SidewalksRoads)
                    ScrappableSWRoad.SetValue(1)
                    Debug.Notification("Concrete Steps, Driveways, Roads, and Sidewalks are now able to be scrapped")
                Else
                    SS_NoScrapList.AddForm(SS_workshopScrapRecipe_SidewalksRoads)
                    ScrappableSWRoad.SetValue(0)
                    Debug.Notification("Concrete Steps, Driveways, Roads, and Sidewalks are no longer able to be scrapped")
                EndIf
            ElseIf Choice == 5
                ScrapMenu.SetValue(-1)
            EndIf
        EndIf
    EndWhile
EndFunction 
Link to comment
Share on other sites

The problem is simply that you don't have enough arguments. The Show() function, if you look in the decompiled Message script, takes 9 arguments of type float. So to fix your problem you would simply need to use

Show(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0)

If your message doesn't have any float / int formatting codes in it, those 0.0s will be ignored.

Edited by Reneer
Link to comment
Share on other sites

The problem is simply that you don't have enough arguments. The Show() function, if you look in the decompiled Message script, takes 9 arguments of type float. So to fix your problem you would simply need to use

Show(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0)

If your message doesn't have any float / int formatting codes in it, those 0.0s will be ignored.

That's what I thought. I guess I still need to add them even if they'll be ignored... Thanks for the help!

Link to comment
Share on other sites

 

The problem is simply that you don't have enough arguments. The Show() function, if you look in the decompiled Message script, takes 9 arguments of type float. So to fix your problem you would simply need to use

Show(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0)

If your message doesn't have any float / int formatting codes in it, those 0.0s will be ignored.

That's what I thought. I guess I still need to add them even if they'll be ignored... Thanks for the help!

 

In the GECK / FO4CK this isn't an issue (well, it wasn't in Skyrim). Pretty sure it's a Caprica-only thing.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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