JimmyChooChoo Posted January 3, 2019 Share Posted January 3, 2019 So at first I was going to make a spell that'd teleport me to the mages guild I picked, but I eventually gave up because the message box didn't do anything, so I began to work on this where it would add the item you pick, but nothing happens at this stage, all I want it to do for now is show me the message box when I click on one of the choices, but it does nothing except closes the box which is what it did with the teleport spell I planned. Here's the script Begin ScriptEffectStart MessageBox "Pick catergory of item you wish to add""Armor""Weapon""Book""Clothing""Food&Drink""Ingredient""Keys""Misc""QuestItem"endBegin ScriptEffectUpdate If GetButtonPressed == 0 MessageBox "Pick the Armor you wish to add""Cancel" ElseIf GetButtonPressed == 1 MessageBox "Pick a Weapon you wish to add""Cancel" ElseIf GetButtonPressed == 2 MessageBox "Pick a Book you wish to add""Cancel" ElseIf GetButtonPressed == 3 MessageBox "Pick a Clothing item you wish to add""Cancel" ElseIf GetButtonPressed == 4 MessageBox "Pick Food or Drink you wish to add""Cancel" ElseIf GetButtonPressed == 5 MessageBox "Pick an Ingredient you wish to add""Cancel" ElseIf GetButtonPressed == 6 MessageBox "Pick a Key you wish to add""Cancel" ElseIf GetButtonPressed == 7 MessageBox "Pick a Misc Item you wish to add""Cancel" ElseIf GetButtonPressed == 8 MessageBox "Pick a Quest item you wish to add""Cancel" EndifEnd thnx for all help given Link to comment Share on other sites More sharing options...
JimmyChooChoo Posted January 3, 2019 Author Share Posted January 3, 2019 Here's for the teleport script aswell ScriptName AAATUTMAGICSCRIPTTHREE Begin ScriptEffectStart MessageBox "Which Mages Guild do you wish to teleport to?""Anvil Mages Guild""Bravil Mages Guild""Bruma Mages Guild""Cheydinhal Mages Guild""Chorrol Mages Guild""Arcane University""Leyawiin Mages Guild""Skingrad Mages Guild""Cancel"endBegin ScriptEffectStart If GetButtonPressed == 0 Player.MoveTo AAATPMAGEANVIL ElseIf GetButtonPressed == 1 Player.MoveTo AAATPMAGEBRAVIL ElseIf GetButtonPressed == 2 Player.MoveTo AAATPMAGEBRUMA ElseIf GetButtonPressed == 3 Player.MoveTo AAATPMAGECHEYDINHAL ElseIf GetButtonPressed == 4 Player.MoveTo AAATPMAGECHORROL ElseIf GetButtonPressed == 5 Player.MoveTo AAATPMAGEICITY ElseIf GetButtonPressed == 6 Player.MoveTo AAATPMAGELEYAWIIN ElseIf GetButtonPressed == 7 Player.MoveTo AAATPMAGESKINGRAD ElseIf GetButtonPressed == 8 EndifEnd Link to comment Share on other sites More sharing options...
DrakeTheDragon Posted January 4, 2019 Share Posted January 4, 2019 I don't know if it's the reason, but I myself have had very bad results with usage of ScriptEffectUpdate blocks in the past. They're just way too unreliable, if you don't know "exactly" what you're doing. As in for most kinds of spells they don't run every time, sometimes not at all. I for one would do as they do on the CS Wiki page for the function and just use it only inside GameMode blocks. Oh, but most important of all the function call GetButtonPressed will only ever return a value != -1 "once" each frame. Consecutive calls inside the same script, as in your's, will only lead to it being -1 again.Use a variable instead and "store" its value the 1 time you call it, then evaluate in conditions only the variable. It's also done that way on the Wiki page linked above. And it also can't help keeping in mind it sometimes won't be != -1 the immediate next frame after the button press as well. Link to comment Share on other sites More sharing options...
JimmyChooChoo Posted January 4, 2019 Author Share Posted January 4, 2019 I fixed it but i don't understand the mistake Link to comment Share on other sites More sharing options...
Oblivionaddicted Posted January 5, 2019 Share Posted January 5, 2019 By curiosity what does your working script look like? Link to comment Share on other sites More sharing options...
Recommended Posts