Jump to content

Papyrus Help: Multi-Solution Puzzle


WesternWolff

Recommended Posts

Hey All! Hoping someone can help, because I'm starting to drive myself crazy on this one.

I've written a puzzle with three solutions, and a papyrus script to check whether each solution is met and enable a different door depending the solution. Basically, the player enables and disables a series of coloured lanterns, and the script checks to see if the lanterns in each solution array are enabled. If they are, it enables an XMarker and the appropriate door.

My issue is that the script is working perfectly, but only for the first solution array - it doesn't seem to check the second or third. I've rewritten the script several different ways, and they all compile fine, but they all seem to have the same issue.

 

I'm using the same code structure for each solution; it looks like this:

; Check Solution 1

Int index1 = 2
Int solved1 = 0

While index1 >= 0
   If(Solution1[index1].IsEnabled())
      solved1 += 1
      index1 -= 1
   EndIf
EndWhile

If solved1 == 3
   Debug.Notification("Solution One")
   AnsweredRef.enable()
   Door1.enable()
   Door2.disable()
   Door3.disable()
EndIf

 

I do the same with Solutions 2 & 3, but for some reason, the script never seems to get that far.

I've attached the full script as well. Thanks in advance for any help!

Link to comment
Share on other sites

Poking in too, since also quite tired, just wanted to mention you are taking a relatively simple situation and making it more complex than it needs to be

 

Not knowing your criteria, I would consider some bool function checks. Add arguments as wanted and check only the applicable ones for the given situation

 

If whateveractionA() && whateveractionB() && whateveractionC()

String Theory = "Ah you got through all three boolean checks so heres a banana"

EndIf

 

Maybe more detail plz, if you continue having issues

Link to comment
Share on other sites

Thanks friends. I'm learning Papyrus as I'm creating, so I've likely been missing some basic grammar here and there.

Not sure why my method wasn't working, but it was definitely more complex than it needed to be.
I swapped out to using an If-And statement like in your examples, and it seems to work now.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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