SGTbayk47 Posted August 8, 2015 Share Posted August 8, 2015 Hi all, Whilst working on my mod, I tried to create a script to repair some pipes, and display the appropriate message afterwards. The script I have written (see below) successfully removes the leak, gives the player xp and makes the pipe unable to be activated again afterwards (yay!) however I can't get the messages to show up once, or even at all in some cases. Here's the script for reference: SCN CanyonSpringsPipeLeakScript Ref Leak Short Button Short PipeDamaged Begin OnActivate Player ShowMessage CanyonSpringsPipeLeakMessage01 End Begin MenuMode 1001 Set Button to GetButtonPressed If Button == 0 && Player.GetAV Repair >= 40 Set Leak to GetLinkedRef Leak.Disable Leak.MarkForDelete Set CanyonSpringsTownQuest.PipesFixed to CanyonSpringsTownQuest.PipesFixed + 1 Set CanyonSpringsTownQuest.DaysLeft to CanyonSpringsTownQuest.DaysLeft + 1 RewardXP 40 SetDestroyed 1 If CanyonSpringsTownQuest.PipesFixed == 3 ShowMessage CanyonSpringsPipeLeakMessageFixed Else ShowMessage CanyonSpringsPipeLeakMessageSuccess Endif Elseif Button == 0 && Player.GetAV Repair < 40 If PipeDamaged == 0 Set CanyonSpringsTownQuest.DaysLeft to CanyonSpringsTownQuest.DaysLeft - 2 Set PipeDamaged to 1 Endif ShowMessage CanyonSpringsPipeLeakMessageFailed Endif End The messages I'm trying to display each give a different problem:The failed message does not appear at all when you fail the repair check. The success message doesn't display when you first fix a pipe, however when you activate another pipe the message displays. Once you press ok on this message the original shows up again. However when you successfully repair the second pipe the success message shows up and gets stuck in an infinite loop.Hopefully I have made a simple rookie mistake and someone knows how to fix it, any and all help will is greatly appreciated. Thanks, BayK. Link to comment Share on other sites More sharing options...
DaemonGrin Posted August 8, 2015 Share Posted August 8, 2015 I could be wrong but you might need a button reset line. Think it was something like if Button == -1 return; elseIf Button == 0 && Player.GetAV Repair >= 40 Set Leak to GetLinkedRef There is an issue with button presses that messes up if I recall. Good luck,Geoff Link to comment Share on other sites More sharing options...
SGTbayk47 Posted August 8, 2015 Author Share Posted August 8, 2015 Hey, thanks for the reply, but unfortunately that doesn't seem to work because when I add that line no messages pop up at all. :( Link to comment Share on other sites More sharing options...
DaemonGrin Posted August 9, 2015 Share Posted August 9, 2015 Well you probably don't need it I misread and thought there were 2 buttons but it's only 1. Link to comment Share on other sites More sharing options...
SGTbayk47 Posted August 9, 2015 Author Share Posted August 9, 2015 I've sorted it now, I've had to use corner messages though. :( Link to comment Share on other sites More sharing options...
Recommended Posts