Help creating a multi-choice spell script

Post » Sat Oct 29, 2016 5:40 pm

I am trying to create a spell that when cast will pop up a message box with a list of options of creatures to summon. I already have spells/Scripts to summon the creatures individually but now I am trying to have have all in one with a choice to select which one you want. I have tried creating the script myself but it only goes to the message box list when the spell is cast. I can choose an option but nothing happens. Any help/ideas would be appreciated. Here is my current script:



scn ChooseSummonFriendScript


short Choice

Short Choosing

ref caster

ref summoned

float timer

short playonce


begin ScriptEffectStart

Set Choosing to -1


If (Choosing == -1)

MessageBox "Which friend do you want to summon" "Deer" "Wolf" "Bear"

Set Choosing to 1

Set Choice to -1


ElseIf (Choosing == 1)


If (Choice == -1)

Set Choice to GetButtonPressed


ElseIf (Choice == 0)

MessageBox "Test Deer"

If (playonce == 0)

set caster to getself

set summoned to caster.placeatme FriendDeer, 1, 30, 10

summoned.moddisposition caster 100

summoned.pme zdre;; or zskh if undead

summoned.AddScriptPackage 0009E69B

set playonce to 1

Endif


ElseIf (Choice == 1)

MessageBox "Test Wolf"

If (playonce == 0)

set caster to getself

set summoned to caster.placeatme FriendWolf, 1, 30, 10

summoned.moddisposition caster 100

summoned.pme zdre;; or zskh if undead

summoned.AddScriptPackage 0009E69B

set playonce to 1

Endif


ElseIf (Choice == 2)

MessageBox "Test Bear"

If (playonce == 0)

set caster to getself

set summoned to caster.placeatme FriendBear, 1, 30, 10

summoned.moddisposition caster 100

summoned.pme zdre;; or zskh if undead

summoned.AddScriptPackage 0009E69B

set playonce to 1

Endif

Endif

EndIF

End


begin scripteffectupdate

If summoned.getdead == 1

summoned.disable

set playonce to 0

Endif


set timer to timer + ScriptEffectElapsedSeconds


If timer > 60 && summoned.getdead == 0

summoned.disable

set playonce to 0

Endif

end


begin scripteffectfinish

If summoned.isactor == 1

summoned.disable

set playonce to 0

Endif

end

User avatar
Claire Mclaughlin
 
Posts: 3361
Joined: Mon Jul 31, 2006 6:55 am

Return to IV - Oblivion