I would like a little help with a mod I'm writing, it is to create an amulet which uses magicka or gold to create arrows, bolts, darts etc. I have created a slightly comlicated menu system for selecting what you want, but this no longer works and I don't know why. When the amulet is equipped it asks what ammo to summon. It should then change the question slightly and ask again, but it just seems to stop running at this point. As I understand Morrowind scripts, they should run until stopped actively, so just loop through over and over. This script seems to only go through once. It used to work, but since then I've added more options to the menus, and I didn't keep a backup of the old version :( I've attached the mod so you can look at it. The offending script is called 'wobSmnAmmo_Control'. Here is the code... wobSmnAmmoType, wobSmnAmmoEnchant, wobSmnAmmoPay and wobSmnAmmoBow are global variables. wobSmnAmmo_Create and wobSmnAmmo_Delete are scripts that fully work (verified by manually setting the globals then starting the scripts). Begin wobSmnAmmo_Control
;Variables......................................................................
.......
Short OnPCEquip
Short CState ;Overall control state
Short QButton ;Button pressed in message box
Short QAmmoType ;= 0 - 3 : 0=Arrow, 1=Bolt, 2=Dart, 3=Star
Short QSmnBow ;= 0 - 1 : 0=No, 1=Yes
Short QPayType ;= 0 - 1 : 0=Magicka, 1=Gold
Short QEnchantType ;= 0 - 4 : 0=None, 1=Damage, 2=AoE, 3=Draining, 4=Other
Short QEnchant ;= 0 - 5 : Depends on QEnchantType
Short TState ;= 0000 - 3114
;Inventory control.....................................................................
if ( OnPCEquip == 1 )
if ( CState == 0 )
Set CState to 10
endif
endif
if ( OnPCEquip == 0 )
if ( CState > 0 )
StartScript wobSmnAmmo_Delete
Set CState to 0
endif
endif
;Questions......................................................................
.......
if ( CState == 10 )
;Bow summoning is only for arrows and bolts
if ( QAmmoType > 1 )
Set QSmnBow to 0
endif
;Reduces number of nested ifs needed
Set TState to ( ( QAmmoType * 1000 ) + ( QSmnBow * 100 ) + ( QPayType * 10 ) + ( QEnchantType ) )
if ( TState == 0000 )
MessageBox "Select the type of ammunition to be summoned:" "Ammo type: Arrow" "Summon longbow: No" "Payment: Magicka" "Enchantment type: None" "None (0)" "Simple (0)" "Normal (1)" "Silver (2)"
elseif ( TState == 0001 )
MessageBox "Select the type of ammunition to be summoned:" "Ammo type: Arrow" "Summon longbow: No" "Payment: Magicka" "Enchantment type: Damage" "Fire (3)" "Frost (3)" "Shock (3)" "Poison (3)" "Health (3)"
elseif ( TState == 0002 )
MessageBox "Select the type of ammunition to be summoned:" "Ammo type: Arrow" "Summon longbow: No" "Payment: Magicka" "Enchantment type: Area damage" "Fire (3)" "Frost (3)" "Shock (3)" "Poison (3)" "Health (3)"
elseif ( TState == 0003 )
MessageBox "Select the type of ammunition to be summoned:" "Ammo type: Arrow" "Summon longbow: No" "Payment: Magicka" "Enchantment type: Draining" "Health (10)" "Magicka (10)" "Fatigue (10)" "Speed (10)" "Intelligence (10)"
elseif ( TState == 0004 )
MessageBox "Select the type of ammunition to be summoned:" "Ammo type: Arrow" "Summon longbow: No" "Payment: Magicka" "Enchantment type: Other" "Paralyze (20)" "Silence (20)" "Burden (20)" "Soultrap (2)" "Teleporting (8)"
elseif ( TState == 0010 )
MessageBox "Select the type of ammunition to be summoned:" "Ammo type: Arrow" "Summon longbow: No" "Payment: Gold" "Enchantment type: None" "None (0)" "Simple (0)" "Normal (1)" "Silver (2)"
elseif ( TState == 0011 )
MessageBox "Select the type of ammunition to be summoned:" "Ammo type: Arrow" "Summon longbow: No" "Payment: Gold" "Enchantment type: Damage" "Fire (3)" "Frost (3)" "Shock (3)" "Poison (3)" "Health (3)"
elseif ( TState == 0012 )
MessageBox "Select the type of ammunition to be summoned:" "Ammo type: Arrow" "Summon longbow: No" "Payment: Gold" "Enchantment type: Area damage" "Fire (3)" "Frost (3)" "Shock (3)" "Poison (3)" "Health (3)"
elseif ( TState == 0013 )
MessageBox "Select the type of ammunition to be summoned:" "Ammo type: Arrow" "Summon longbow: No" "Payment: Gold" "Enchantment type: Draining" "Health (10)" "Magicka (10)" "Fatigue (10)" "Speed (10)" "Intelligence (10)"
elseif ( TState == 0014 )
MessageBox "Select the type of ammunition to be summoned:" "Ammo type: Arrow" "Summon longbow: No" "Payment: Gold" "Enchantment type: Other" "Paralyze (20)" "Silence (20)" "Burden (20)" "Soultrap (2)" "Teleporting (8)"
elseif ( TState == 0100 )
MessageBox "Select the type of ammunition to be summoned:" "Ammo type: Arrow" "Summon longbow: Yes" "Payment: Magicka" "Enchantment type: None" "None (0)" "Simple (0)" "Normal (1)" "Silver (2)"
elseif ( TState == 0101 )
MessageBox "Select the type of ammunition to be summoned:" "Ammo type: Arrow" "Summon longbow: Yes" "Payment: Magicka" "Enchantment type: Damage" "Fire (3)" "Frost (3)" "Shock (3)" "Poison (3)" "Health (3)"
elseif ( TState == 0102 )
MessageBox "Select the type of ammunition to be summoned:" "Ammo type: Arrow" "Summon longbow: Yes" "Payment: Magicka" "Enchantment type:Area Damage" "Fire (3)" "Frost (3)" "Shock (3)" "Poison (3)" "Health (3)"
elseif ( TState == 0103 )
MessageBox "Select the type of ammunition to be summoned:" "Ammo type: Arrow" "Summon longbow: Yes" "Payment: Magicka" "Enchantment type: Draining" "Health (10)" "Magicka (10)" "Fatigue (10)" "Speed (10)" "Intelligence (10)"
elseif ( TState == 0104 )
MessageBox "Select the type of ammunition to be summoned:" "Ammo type: Arrow" "Summon longbow: Yes" "Payment: Magicka" "Enchantment type: Other" "Paralyze (20)" "Silence (20)" "Burden (20)" "Soultrap (2)" "Teleporting (8)"
elseif ( TState == 0110 )
MessageBox "Select the type of ammunition to be summoned:" "Ammo type: Arrow" "Summon longbow: Yes" "Payment: Gold" "Enchantment type: None" "None (0)" "Simple (0)" "Normal (1)" "Silver (2)"
elseif ( TState == 0111 )
MessageBox "Select the type of ammunition to be summoned:" "Ammo type: Arrow" "Summon longbow: Yes" "Payment: Gold" "Enchantment type: Damage" "Fire (3)" "Frost (3)" "Shock (3)" "Poison (3)" "Health (3)"
elseif ( TState == 0112 )
MessageBox "Select the type of ammunition to be summoned:" "Ammo type: Arrow" "Summon longbow: Yes" "Payment: Gold" "Enchantment type:Area Damage" "Fire (3)" "Frost (3)" "Shock (3)" "Poison (3)" "Health (3)"
elseif ( TState == 0113 )
MessageBox "Select the type of ammunition to be summoned:" "Ammo type: Arrow" "Summon longbow: Yes" "Payment: Gold" "Enchantment type: Draining" "Health (10)" "Magicka (10)" "Fatigue (10)" "Speed (10)" "Intelligence (10)"
elseif ( TState == 0114 )
MessageBox "Select the type of ammunition to be summoned:" "Ammo type: Arrow" "Summon longbow: Yes" "Payment: Gold" "Enchantment type: Other" "Paralyze (20)" "Silence (20)" "Burden (20)" "Soultrap (2)" "Teleporting (8)"
elseif ( TState == 1000 )
MessageBox "Select the type of ammunition to be summoned:" "Ammo type: Bolt" "Summon crossbow: No" "Payment: Magicka" "Enchantment type: None" "None (0)" "Simple (0)" "Normal (1)" "Silver (2)"
elseif ( TState == 1001 )
MessageBox "Select the type of ammunition to be summoned:" "Ammo type: Bolt" "Summon crossbow: No" "Payment: Magicka" "Enchantment type: Damage" "Fire (3)" "Frost (3)" "Shock (3)" "Poison (3)" "Health (3)"
elseif ( TState == 1002 )
MessageBox "Select the type of ammunition to be summoned:" "Ammo type: Bolt" "Summon crossbow: No" "Payment: Magicka" "Enchantment type:Area Damage" "Fire (3)" "Frost (3)" "Shock (3)" "Poison (3)" "Health (3)"
elseif ( TState == 1003 )
MessageBox "Select the type of ammunition to be summoned:" "Ammo type: Bolt" "Summon crossbow: No" "Payment: Magicka" "Enchantment type: Draining" "Health (10)" "Magicka (10)" "Fatigue (10)" "Speed (10)" "Intelligence (10)"
elseif ( TState == 1004 )
MessageBox "Select the type of ammunition to be summoned:" "Ammo type: Bolt" "Summon crossbow: No" "Payment: Magicka" "Enchantment type: Other" "Paralyze (20)" "Silence (20)" "Burden (20)" "Soultrap (2)" "Teleporting (8)"
elseif ( TState == 1010 )
MessageBox "Select the type of ammunition to be summoned:" "Ammo type: Bolt" "Summon crossbow: No" "Payment: Gold" "Enchantment type: None" "None (0)" "Simple (0)" "Normal (1)" "Silver (2)"
elseif ( TState == 1011 )
MessageBox "Select the type of ammunition to be summoned:" "Ammo type: Bolt" "Summon crossbow: No" "Payment: Gold" "Enchantment type: Damage" "Fire (3)" "Frost (3)" "Shock (3)" "Poison (3)" "Health (3)"
elseif ( TState == 1012 )
MessageBox "Select the type of ammunition to be summoned:" "Ammo type: Bolt" "Summon crossbow: No" "Payment: Gold" "Enchantment type:Area Damage" "Fire (3)" "Frost (3)" "Shock (3)" "Poison (3)" "Health (3)"
elseif ( TState == 1013 )
MessageBox "Select the type of ammunition to be summoned:" "Ammo type: Bolt" "Summon crossbow: No" "Payment: Gold" "Enchantment type: Draining" "Health (10)" "Magicka (10)" "Fatigue (10)" "Speed (10)" "Intelligence (10)"
elseif ( TState == 1014 )
MessageBox "Select the type of ammunition to be summoned:" "Ammo type: Bolt" "Summon crossbow: No" "Payment: Gold" "Enchantment type: Other" "Paralyze (20)" "Silence (20)" "Burden (20)" "Soultrap (2)" "Teleporting (8)"
elseif ( TState == 1100 )
MessageBox "Select the type of ammunition to be summoned:" "Ammo type: Bolt" "Summon crossbow: Yes" "Payment: Magicka" "Enchantment type: None" "None (0)" "Simple (0)" "Normal (1)" "Silver (2)"
elseif ( TState == 1101 )
MessageBox "Select the type of ammunition to be summoned:" "Ammo type: Bolt" "Summon crossbow: Yes" "Payment: Magicka" "Enchantment type: Damage" "Fire (3)" "Frost (3)" "Shock (3)" "Poison (3)" "Health (3)"
elseif ( TState == 1102 )
MessageBox "Select the type of ammunition to be summoned:" "Ammo type: Bolt" "Summon crossbow: Yes" "Payment: Magicka" "Enchantment type:Area Damage" "Fire (3)" "Frost (3)" "Shock (3)" "Poison (3)" "Health (3)"
elseif ( TState == 1103 )
MessageBox "Select the type of ammunition to be summoned:" "Ammo type: Bolt" "Summon crossbow: Yes" "Payment: Magicka" "Enchantment type: Draining" "Health (10)" "Magicka (10)" "Fatigue (10)" "Speed (10)" "Intelligence (10)"
elseif ( TState == 1104 )
MessageBox "Select the type of ammunition to be summoned:" "Ammo type: Bolt" "Summon crossbow: Yes" "Payment: Magicka" "Enchantment type: Other" "Paralyze (20)" "Silence (20)" "Burden (20)" "Soultrap (2)" "Teleporting (8)"
elseif ( TState == 1110 )
MessageBox "Select the type of ammunition to be summoned:" "Ammo type: Bolt" "Summon crossbow: Yes" "Payment: Gold" "Enchantment type: None" "None (0)" "Simple (0)" "Normal (1)" "Silver (2)"
elseif ( TState == 1111 )
MessageBox "Select the type of ammunition to be summoned:" "Ammo type: Bolt" "Summon crossbow: Yes" "Payment: Gold" "Enchantment type: Damage" "Fire (3)" "Frost (3)" "Shock (3)" "Poison (3)" "Health (3)"
elseif ( TState == 1112 )
MessageBox "Select the type of ammunition to be summoned:" "Ammo type: Bolt" "Summon crossbow: Yes" "Payment: Gold" "Enchantment type:Area Damage" "Fire (3)" "Frost (3)" "Shock (3)" "Poison (3)" "Health (3)"
elseif ( TState == 1113 )
MessageBox "Select the type of ammunition to be summoned:" "Ammo type: Bolt" "Summon crossbow: Yes" "Payment: Gold" "Enchantment type: Draining" "Health (10)" "Magicka (10)" "Fatigue (10)" "Speed (10)" "Intelligence (10)"
elseif ( TState == 1114 )
MessageBox "Select the type of ammunition to be summoned:" "Ammo type: Bolt" "Summon crossbow: Yes" "Payment: Gold" "Enchantment type: Other" "Paralyze (20)" "Silence (20)" "Burden (20)" "Soultrap (2)" "Teleporting (8)"
elseif ( TState == 2000 )
MessageBox "Select the type of ammunition to be summoned:" "Ammo type: Dart" "Summon bow: N/A" "Payment: Magicka" "Enchantment type: None" "None (0)" "Simple (0)" "Normal (1)" "Silver (2)"
elseif ( TState == 2001 )
MessageBox "Select the type of ammunition to be summoned:" "Ammo type: Dart" "Summon bow: N/A" "Payment: Magicka" "Enchantment type: Damage" "Fire (3)" "Frost (3)" "Shock (3)" "Poison (3)" "Health (3)"
elseif ( TState == 2002 )
MessageBox "Select the type of ammunition to be summoned:" "Ammo type: Dart" "Summon bow: N/A" "Payment: Magicka" "Enchantment type:Area Damage" "Fire (3)" "Frost (3)" "Shock (3)" "Poison (3)" "Health (3)"
elseif ( TState == 2003 )
MessageBox "Select the type of ammunition to be summoned:" "Ammo type: Dart" "Summon bow: N/A" "Payment: Magicka" "Enchantment type: Draining" "Health (10)" "Magicka (10)" "Fatigue (10)" "Speed (10)" "Intelligence (10)"
elseif ( TState == 2004 )
MessageBox "Select the type of ammunition to be summoned:" "Ammo type: Dart" "Summon bow: N/A" "Payment: Magicka" "Enchantment type: Other" "Paralyze (20)" "Silence (20)" "Burden (20)" "Soultrap (2)" "Teleporting (8)"
elseif ( TState == 2010 )
MessageBox "Select the type of ammunition to be summoned:" "Ammo type: Dart" "Summon bow: N/A" "Payment: Gold" "Enchantment type: None" "None (0)" "Simple (0)" "Normal (1)" "Silver (2)"
elseif ( TState == 2011 )
MessageBox "Select the type of ammunition to be summoned:" "Ammo type: Dart" "Summon bow: N/A" "Payment: Gold" "Enchantment type: Damage" "Fire (3)" "Frost (3)" "Shock (3)" "Poison (3)" "Health (3)"
elseif ( TState == 2012 )
MessageBox "Select the type of ammunition to be summoned:" "Ammo type: Dart" "Summon bow: N/A" "Payment: Gold" "Enchantment type:Area Damage" "Fire (3)" "Frost (3)" "Shock (3)" "Poison (3)" "Health (3)"
elseif ( TState == 2013 )
MessageBox "Select the type of ammunition to be summoned:" "Ammo type: Dart" "Summon bow: N/A" "Payment: Gold" "Enchantment type: Draining" "Health (10)" "Magicka (10)" "Fatigue (10)" "Speed (10)" "Intelligence (10)"
elseif ( TState == 2014 )
MessageBox "Select the type of ammunition to be summoned:" "Ammo type: Dart" "Summon bow: N/A" "Payment: Gold" "Enchantment type: Other" "Paralyze (20)" "Silence (20)" "Burden (20)" "Soultrap (2)" "Teleporting (8)"
elseif ( TState == 3000 )
MessageBox "Select the type of ammunition to be summoned:" "Ammo type: Star" "Summon bow: N/A" "Payment: Magicka" "Enchantment type: None" "None (0)" "Simple (0)" "Normal (1)" "Silver (2)"
elseif ( TState == 3001 )
MessageBox "Select the type of ammunition to be summoned:" "Ammo type: Star" "Summon bow: N/A" "Payment: Magicka" "Enchantment type: Damage" "Fire (3)" "Frost (3)" "Shock (3)" "Poison (3)" "Health (3)"
elseif ( TState == 3002 )
MessageBox "Select the type of ammunition to be summoned:" "Ammo type: Star" "Summon bow: N/A" "Payment: Magicka" "Enchantment type:Area Damage" "Fire (3)" "Frost (3)" "Shock (3)" "Poison (3)" "Health (3)"
elseif ( TState == 3003 )
MessageBox "Select the type of ammunition to be summoned:" "Ammo type: Star" "Summon bow: N/A" "Payment: Magicka" "Enchantment type: Draining" "Health (10)" "Magicka (10)" "Fatigue (10)" "Speed (10)" "Intelligence (10)"
elseif ( TState == 3004 )
MessageBox "Select the type of ammunition to be summoned:" "Ammo type: Star" "Summon bow: N/A" "Payment: Magicka" "Enchantment type: Other" "Paralyze (20)" "Silence (20)" "Burden (20)" "Soultrap (2)" "Teleporting (8)"
elseif ( TState == 3010 )
MessageBox "Select the type of ammunition to be summoned:" "Ammo type: Star" "Summon bow: N/A" "Payment: Gold" "Enchantment type: None" "None (0)" "Simple (0)" "Normal (1)" "Silver (2)"
elseif ( TState == 3011 )
MessageBox "Select the type of ammunition to be summoned:" "Ammo type: Star" "Summon bow: N/A" "Payment: Gold" "Enchantment type: Damage" "Fire (3)" "Frost (3)" "Shock (3)" "Poison (3)" "Health (3)"
elseif ( TState == 3012 )
MessageBox "Select the type of ammunition to be summoned:" "Ammo type: Star" "Summon bow: N/A" "Payment: Gold" "Enchantment type:Area Damage" "Fire (3)" "Frost (3)" "Shock (3)" "Poison (3)" "Health (3)"
elseif ( TState == 3013 )
MessageBox "Select the type of ammunition to be summoned:" "Ammo type: Star" "Summon bow: N/A" "Payment: Gold" "Enchantment type: Draining" "Health (10)" "Magicka (10)" "Fatigue (10)" "Speed (10)" "Intelligence (10)"
elseif ( TState == 3014 )
MessageBox "Select the type of ammunition to be summoned:" "Ammo type: Star" "Summon bow: N/A" "Payment: Gold" "Enchantment type: Other" "Paralyze (20)" "Silence (20)" "Burden (20)" "Soultrap (2)" "Teleporting (8)"
else
;For debug only
MessageBox "Unknown TState" "OK"
endif
Set CState to 20
endif
;Answers........................................................................
.......
if ( CState == 20 )
Set QButton to GetButtonPressed
if ( QButton == 0 )
if ( QAmmoType >= 3 )
Set QAmmoType to 0
else
Set QAmmoType to ( QAmmoType + 1 )
endif
Set CState to 10
elseif ( QButton == 1 )
if ( QSmnBow >= 1 )
Set QSmnBow to 0
else
Set QSmnBow to ( QSmnBow + 1 )
endif
Set CState to 10
elseif ( QButton == 2 )
if ( QPayType >= 1 )
Set QPayType to 0
else
Set QPayType to ( QPayType + 1 )
endif
Set CState to 10
elseif ( QButton == 3 )
if ( QEnchantType >= 4 )
Set QEnchantType to 0
else
Set QEnchantType to ( QEnchantType + 1 )
endif
Set CState to 10
elseif ( QButton == 4 )
Set QEnchant to 0
Set CState to 30
elseif ( QButton == 5 )
Set QEnchant to 1
Set CState to 30
elseif ( QButton == 6 )
Set QEnchant to 2
Set CState to 30
elseif ( QButton == 7 )
Set QEnchant to 3
Set CState to 30
elseif ( QButton == 8 )
Set QEnchant to 4
Set CState to 30
endif
endif
;Start creation........................................................................
if ( CState == 30 )
Set wobSmnAmmoType to QAmmoType
Set wobSmnAmmoEnchant to ( ( QEnchantType * 10 ) + QEnchant )
Set wobSmnAmmoPay to QPayType
Set wobSmnAmmoBow to QSmnBow
StartScript wobSmnAmmo_Create
Set CState to 99
endif
End wobSmnAmmo_Control
It's probably something really obvious, but I just can't see it :wallbash: . Any help is greatly appreciated.