WesternWolff Posted September 25, 2022 Share Posted September 25, 2022 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 More sharing options...
maxarturo Posted September 25, 2022 Share Posted September 25, 2022 Check this post so can get an idea of the specific set up you are aiming for, sorry but I'm way too tired right now. https://forums.nexusmods.com/index.php?/topic/11721293-need-help-for-multibutton-switch/ Link to comment Share on other sites More sharing options...
Sphered Posted September 25, 2022 Share Posted September 25, 2022 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 More sharing options...
WesternWolff Posted September 25, 2022 Author Share Posted September 25, 2022 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 More sharing options...
Recommended Posts