jaysus Posted July 12, 2008 Share Posted July 12, 2008 could someone plz fix the following script? i need it for the contest blades and would rather work on the textures and models atm and since i wasted at least one hour trying to find the error i ask for your generous help :) the problem is that stage -12 (answer "NO" / the part with the colour choices) doesnt start thx a ton scn 0jaymoonbladescript Short ChoosingShort Choiceshort working Begin onActivate Set Working to 1 Set Choosing to -1End Begin GameMode If Working Set Working to 1 If (Choosing == 0) Set Working to 0 Elseif (Choosing == -1) Messagebox "Is Sheogorath evil?" "Yes" "No" "Cancel" Set Choosing to 1 Set Choice to -1 Elseif (Choosing == 1) If (Choice == -1) ;No choice yet Set Choice to GetButtonPressed Elseif (Choice == 0) ;Yes Set Choosing to -11 ; Elseif (Choice == 1) ;No Set Choosing to -12 ; Elseif (Choice == 2) ;Cancel Set Choosing to 0 ; Endif Elseif (Choosing == -11) ;yes player.addspell 0jaydiseaseset choosing to 0 endif Elseif (Choosing == -12) ;noMessagebox "Which colour do you prefer?" "Blue" "Green" "Yellow" "Red" "Turquoise" Set Choosing to 12 Set Choice to -1 elseif (Choosing == 12) if (choice == -1)Set Choice to GetButtonPressed Elseif (Choice == 0) ;blue player.additem 0jaymoonblue 1 Elseif (Choice == 1) ;green player.additem 0jaymoongreen 1set choosing to 0 Elseif (Choice == 2) ;yellow player.additem 0jaymoonyellow 1 set choosing to 0 Elseif (Choice == 3) ;red player.additem 0jaymoonred 1set choosing to 0 Elseif (Choice == 4) ;turq player.additem 0jaymoonturquoise 1set choosing to 0 endif EndifEnd Link to comment Share on other sites More sharing options...
Lainge Posted July 12, 2008 Share Posted July 12, 2008 I dunno. It's an elseif statement. Shouldn't it be 'if'. Link to comment Share on other sites More sharing options...
jaysus Posted July 12, 2008 Author Share Posted July 12, 2008 i have no clue last time i scripted ifs and thens was a year ago and im still reluctant of them lol Link to comment Share on other sites More sharing options...
Lainge Posted July 12, 2008 Share Posted July 12, 2008 scn 0jaymoonbladescript Short ChoosingShort Choiceshort working Begin onActivate Set Working to 1 Set Choosing to -1End Begin GameMode If Working Set Working to 1 If (Choosing == 0) Set Working to 0 Elseif (Choosing == -1) Messagebox "Is Sheogorath evil?" "Yes" "No" "Cancel" Set Choosing to 1 Set Choice to -1 Elseif (Choosing == 1) If (Choice == -1) ;No choice yet Set Choice to GetButtonPressed Elseif (Choice == 0) ;Yes Set Choosing to -11 ; Elseif (Choice == 1) ;No Set Choosing to -12 ; Elseif (Choice == 2) ;Cancel Set Choosing to 0 ; Endif If (Choosing == -11) ;yes player.addspell 0jaydiseaseset choosing to 0 endif If (Choosing == -12) ;noMessagebox "Which colour do you prefer?" "Blue" "Green" "Yellow" "Red" "Turquoise" Set Choosing to 12 Set Choice to -1 elseif (Choosing == 12) if (choice == -1)Set Choice to GetButtonPressed Elseif (Choice == 0) ;blue player.additem 0jaymoonblue 1 Elseif (Choice == 1) ;green player.additem 0jaymoongreen 1set choosing to 0 Elseif (Choice == 2) ;yellow player.additem 0jaymoonyellow 1 set choosing to 0 Elseif (Choice == 3) ;red player.additem 0jaymoonred 1set choosing to 0 Elseif (Choice == 4) ;turq player.additem 0jaymoonturquoise 1set choosing to 0 endif EndifEndMaybe? Link to comment Share on other sites More sharing options...
jaysus Posted July 12, 2008 Author Share Posted July 12, 2008 nah it gives errors :P Link to comment Share on other sites More sharing options...
LoginToDownload Posted July 12, 2008 Share Posted July 12, 2008 What errors? Link to comment Share on other sites More sharing options...
jaysus Posted July 12, 2008 Author Share Posted July 12, 2008 lots of endif and if block errors :/ after fixing them it just applies the disease spell and doesnt even open the messagebox now... Link to comment Share on other sites More sharing options...
LoginToDownload Posted July 12, 2008 Share Posted July 12, 2008 scn 0jaymoonbladescript Short Choosing Short Choice short working Begin onActivate Set Working to 1 Set Choosing to -1 End Begin GameMode If Working Set Working to 1 If (Choosing == 0) Set Working to 0 Elseif (Choosing == -1) Messagebox "Is Sheogorath evil?" "Yes" "No" "Cancel" Set Choosing to 1 Set Choice to -1 Elseif (Choosing == 1) If (Choice == -1);No choice yet Set Choice to GetButtonPressed Elseif (Choice == 0);Yes Set Choosing to -11; Elseif (Choice == 1);No Set Choosing to -12; Elseif (Choice == 2);Cancel Set Choosing to 0; Endif If (Choosing == -11);yes player.addspell 0jaydisease set choosing to 0 endif If (Choosing == -12);no Messagebox "Which colour do you prefer?" "Blue" "Green" "Yellow" "Red" "Turquoise" Set Choosing to 12 Set Choice to -1 elseif (Choosing == 12) if (choice == -1) Set Choice to GetButtonPressed Elseif (Choice == 0);blue player.additem 0jaymoonblue 1 Elseif (Choice == 1);green player.additem 0jaymoongreen 1 set choosing to 0 Elseif (Choice == 2);yellow player.additem 0jaymoonyellow 1 set choosing to 0 Elseif (Choice == 3);red player.additem 0jaymoonred 1 set choosing to 0 Elseif (Choice == 4);turq player.additem 0jaymoonturquoise 1 set choosing to 0 endif Endif End Indenting it... The if-structure looks like it uses ifs where it needs elseifs in a few places, like here...elseif choosing == 1 <snip> if choosing == -11 Try giving this a go.scn 0jaymoonbladescript Short Choosing Short Choice short working Begin onActivate Set Working to 1 Set Choosing to -1 End Begin GameMode If Working Set Working to 1 If (Choosing == 0) Set Working to 0 Elseif (Choosing == -1) Messagebox "Is Sheogorath evil?" "Yes" "No" "Cancel" Set Choosing to 1 Set Choice to -1 Elseif (Choosing == 1) If (Choice == -1);No choice yet Set Choice to GetButtonPressed Elseif (Choice == 0);Yes Set Choosing to -11; Elseif (Choice == 1);No Set Choosing to -12; Elseif (Choice == 2);Cancel Set Choosing to 0; Endif elseif (Choosing == -11);yes player.addspell 0jaydisease set choosing to 0 elseif (Choosing == -12);no Messagebox "Which colour do you prefer?" "Blue" "Green" "Yellow" "Red" "Turquoise" Set Choosing to 12 Set Choice to -1 elseif (Choosing == 12) if (choice == -1) Set Choice to GetButtonPressed Elseif (Choice == 0);blue player.additem 0jaymoonblue 1 set choosing to 0 Elseif (Choice == 1);green player.additem 0jaymoongreen 1 set choosing to 0 Elseif (Choice == 2);yellow player.additem 0jaymoonyellow 1 set choosing to 0 Elseif (Choice == 3);red player.additem 0jaymoonred 1 set choosing to 0 Elseif (Choice == 4);turq player.additem 0jaymoonturquoise 1 set choosing to 0 endif endif Endif End I can't figure out what Working does, though... Link to comment Share on other sites More sharing options...
jaysus Posted July 12, 2008 Author Share Posted July 12, 2008 kudos!! :woot: :thanks: lol couldnt you have logged in a few hours earlier? sigh... :P btw would you also know how i could stop the script from getting activated without using disable or using disable without the activator vanishing? Link to comment Share on other sites More sharing options...
jaysus Posted July 12, 2008 Author Share Posted July 12, 2008 scn 0jaymoonbladescript Short Choosing Short Choice short working Begin onActivate Set Working to 1 Set Choosing to -1 End Begin GameMode If Working Set Working to 1 If (Choosing == 0) Set Working to 0 SetDestroyed 1 Elseif (Choosing == -1) Messagebox "Is Sheogorath good or evil?" "Good" "Neither" "Evil" Set Choosing to 1 Set Choice to -1 Elseif (Choosing == 1) If (Choice == -1);No choice yet Set Choice to GetButtonPressed Elseif (Choice == 0);Evil Set Choosing to -11; Elseif (Choice == 1);Neither Set Choosing to -12; Elseif (Choice == 2);Good Set Choosing to -11; Endif elseif (Choosing == -11);yes player.addspell 0jaydisease set choosing to 0 elseif (choosing == -12) Messagebox "How many Daedric Princes are there in Tamriel?" "1" "7" "13" "16" "23" Set Choosing to 12 set choice to -1 elseif (choosing == 12) if (choice == -1) set choice to getbuttonpressed elseif (choice == 0) set choosing to -11 elseif (choice == 1) set choosing to -11 elseif (choice == 2) set choosing to -11 elseif (choice == 3) set choosing to -13 elseif (choice == 4) set choosing to -11 endif elseif (choosing == -13) Messagebox "The city of Vivec is in which province?" "Skyrim" "Cyrodiil" "Morrowind" "Blackmarsh" Set Choosing to 13 set choice to -1 elseif (choosing == 13) if (choice == -1) set choice to getbuttonpressed elseif (choice == 0) set choosing to -11 elseif (choice == 1) set choosing to -11 elseif (choice == 2) set choosing to -14 elseif (choice == 3) set choosing to -11 endif elseif (Choosing == -14);no Messagebox "Which colour do you prefer?" "Blue" "Green" "Yellow" "Red" "Turquoise" Set Choosing to 14 Set Choice to -1 elseif (Choosing == 14) if (choice == -1) Set Choice to GetButtonPressed Elseif (Choice == 0);blue player.additem 0jaymoonblue 1 set choosing to 0 Elseif (Choice == 1);green player.additem 0jaymoongreen 1 set choosing to 0 Elseif (Choice == 2);yellow player.additem 0jaymoonyellow 1 set choosing to 0 Elseif (Choice == 3);red player.additem 0jaymoonred 1 set choosing to 0 Elseif (Choice == 4);turq player.additem 0jaymoonturquoise 1 set choosing to 0 endif endif Endif End erm ;D could you plz check why it stops after it reaches stage -12? sry for the annoyance lol Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.