Jump to content

MessageBox , not sure what I'm doing wrong


Recommended Posts

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"
end
Begin 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"
Endif
End

 

 

thnx for all help given

 

Link to comment
Share on other sites

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"
end
Begin 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

Endif
End

 

Link to comment
Share on other sites

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

  • Recently Browsing   0 members

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