Jump to content

Photo

[Scripting help] Don't ignore :c

scripting help papyrus desperate scaredofspiders

  • Please log in to reply
5 replies to this topic

#1
Mad6od

Mad6od

    Old hand

  • Members
  • PipPipPip
  • 819 posts
Somebody do me a solid and please PLEASE (I'm completely stuck until this is resolved) and take a look at my script. 
 
It compiles correctly, so no problem there. I'm trying to set it up so that when the button is pressed the Quest begins and sets the stage to 10.
Everything looks right to me but when I press the button in-game the quest does not start. I know the problem isn't on the Quest's end because when Icheck the "run on start" box everything works smoothly. So what is wrong with the script? Why will my quest (property "DeployForces") not start?
Scriptname FCOMCommandRadioTokenScript extends ObjectReference

Armor Property CommandRadio Auto Const

Actor Property Player Auto

Message Property Message1 Auto

Message Property Message2 Auto

Message Property Message3 Auto

Message Property FirstMessage Auto

Quest Property DeployTroops Auto

Event OnEquipped(Actor akActor)
        Menu()
        Player.RemoveItem(CommandRadio, 1)
        Player.AddItem(CommandRadio, 1)
EndEvent

Function Menu(Bool abMenu = True, Int aiButton = 0)
    While abMenu
        If aiButton != -1 ; Wait for input (this can prevent problems if recycling the aiButton argument in submenus)
            aiButton = FirstMessage.Show() ; Main Menu
            abMenu = False ; End the function
            If aiButton == 0 ; TESTBUTTOMAIN
                aiButton = Message1.Show()
                If aiButton == 0 ; TESTBUTTONbeginsQuest
                    DeployTroops.Start()
                    DeployTroops.SetStage(10)
                ElseIf aiButton == 1 ; null
                ElseIf aiButton == 2 ; null
                EndIf
            ElseIf aiButton == 1 ; null
                aiButton = Message2.Show()
                If aiButton == 0 ; null
                ElseIf aiButton == 1 ; null
                ElseIf aiButton == 2 ; null
                EndIf
            ElseIf aiButton == 2 ; null
                aiButton = Message3.Show()
                If aiButton == 0 ; null
                ElseIf aiButton == 1 ; null
                ElseIf aiButton == 2 ; null
                EndIf
            EndIf
        EndIf
    EndWhile
EndFunction

The specific bit I'm having the trouble with is 

                If aiButton == 0 ; TESTBUTTONbeginsQuest
                    DeployTroops.Start()
                    DeployTroops.SetStage(10) 

For some reason the above bit is not starting the quest or setting the stage to 10. My guess is that I am not using the Quest property correctly, but I don't know how else to do it. I can't find anything helpful on the wiki either. :/

 

Help a modder out


Edited by MadGodSheogorath, 19 May 2016 - 07:50 AM.


#2
Reneer

Reneer

    Old Hand

  • Premium Member
  • 4,078 posts

Assuming that DeployTroops is pointing properly to your quest, my only guess would be that

abMenu = False ; End the function

is the issue. That should either be at the bottom of your While loop, or only in buttons where you do not want any looping behavior. Maybe try adding some debug.trace functions (and compiling with the Debug flag) to see if the code is even running the Start() and SetStage(10) lines.

 

If DeployTroops is not pointing to your Quest, that would be your problem. If that is the case, the Papyrus compiler will likely be throwing an error in your Papyrus0.log file (C:\Users\<Username>\Documents\my games\Fallout4\Logs\Script\Papyrus.0.log).


Edited by Reneer, 19 May 2016 - 06:47 PM.


#3
Mad6od

Mad6od

    Old hand

  • Members
  • PipPipPip
  • 819 posts

Thank you! I was able to solve the issue.



#4
Reneer

Reneer

    Old Hand

  • Premium Member
  • 4,078 posts

Thank you! I was able to solve the issue.

So what was the problem? :)



#5
Mad6od

Mad6od

    Old hand

  • Members
  • PipPipPip
  • 819 posts
Honestly, I'm still not sure.

Now it looks like the problem wasn't with the script at all, but the quest itself. I went to my quest and removed the "script event" box and ticked the "on start enabled" box, and then added a stage "0" to the quest, and then set stage 0 to "run on start". Then I went in the game and suddenly the damn thing works.

But now there's a different problem. After I got that working I moved on to the next part: Aliases. I haven't changed anything to the script or the quest, all I did was add my aliases and now the quest isn't firing up again.

>.< no idea why the CK is giving me so much trouble.

Edited by MadGodSheogorath, 20 May 2016 - 01:08 AM.


#6
Maduin81

Maduin81

    Fan

  • Supporter
  • PipPipPip
  • 317 posts

Try setting your aliases to optional, I believe there are some issues if they don't fill properly and are mandatory.  Also, regarding the first issue, I think it sounds like your quest with the script attached wasn't started to begin with, so how could it call itself when itself doesn't exist.  Make sense?  Think of it sort of like driving down the road without first getting into the car and starting it.  







Also tagged with one or more of these keywords: scripting, help, papyrus, desperate, scaredofspiders

IPB skins by Skinbox
Page loaded in: 1.072 seconds