Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

Edit Spell not saving


augusto95
 Share

Recommended Posts

Matthew, this is my cmbType code:

>! ```
>! Private Sub cmbType_Click()
>! If cmbType.text = "Linear" Then
>! scrlRange.Value = 0
>! chkAOE.Value = 1
>! End If
>! If (cmbType.ListIndex = SPELL_TYPE_PROJECTILE) Then
>! Frame4.Visible = True
>! Else
>! Frame4.Visible = False
>! End If
>! ' If debug mode, handle error then exit out
>! If Options.Debug = 1 Then On Error GoTo errorhandler
>! If EditorIndex = 0 Or EditorIndex > MAX_SPELLS Then Exit Sub
>! Item(EditorIndex).Type = cmbType.ListIndex
>! ' Error handler
>! Exit Sub
>! errorhandler:
>! HandleError "cmbType_Click", "frmEditor_Spell", Err.Number, Err.Description, Err.Source, Err.HelpContext
>! Err.Clear
>! Exit Sub
>! End Sub
>! ```
and this is my SpellEditorInit (don't know if it is what you're asking)
>! ```
>! ' //////////////////
>! ' // Spell Editor //
>! ' //////////////////
>! Public Sub SpellEditorInit()
>! Dim i As Long
>! Dim SoundSet As Boolean
>! ' If debug mode, handle error then exit out
>! If Options.Debug = 1 Then On Error GoTo errorhandler
>! If frmEditor_Spell.Visible = False Then Exit Sub
>! EditorIndex = frmEditor_Spell.lstIndex.ListIndex + 1
>! ' populate the cache if we need to
>! If Not hasPopulated Then
>! PopulateLists
>! End If
>! ' add the array to the combo
>! frmEditor_Spell.cmbSound.Clear
>! frmEditor_Spell.cmbSound.AddItem "None."
>! For i = 1 To UBound(soundCache)
>! frmEditor_Spell.cmbSound.AddItem soundCache(i)
>! Next
>! ' finished populating
>! With frmEditor_Spell
>! ' set max values
>! .scrlAnimCast.Max = MAX_ANIMATIONS
>! .scrlAnim.Max = MAX_ANIMATIONS
>! .scrlAOE.Max = MAX_BYTE
>! .scrlRange.Max = MAX_BYTE
>! .scrlMap.Max = MAX_MAPS
>!
>! ' build class combo
>! .cmbClass.AddItem "None"
>! .cmbClass.Clear
>! For i = 1 To Max_Classes
>! .cmbClass.AddItem Trim$(Class(i).Name)
>! Next
>!
>! If Spell(EditorIndex).ClassReq > -1 And Spell(EditorIndex).ClassReq <= Max_Classes Then
>! .cmbClass.ListIndex = Spell(EditorIndex).ClassReq
>! End If
>!
>! ' set values
>! .txtName.text = Trim$(Spell(EditorIndex).Name)
>! .txtDesc.text = Trim$(Spell(EditorIndex).Desc)
>! .cmbType.ListIndex = Spell(EditorIndex).Type
>! .scrlMP.Value = Spell(EditorIndex).MPCost
>! .scrlLevel.Value = Spell(EditorIndex).LevelReq
>! .scrlAccess.Value = Spell(EditorIndex).AccessReq
>! .cmbClass.ListIndex = Spell(EditorIndex).ClassReq
>! .scrlCast.Value = Spell(EditorIndex).CastTime
>! .scrlCool.Value = Spell(EditorIndex).CDTime
>! .scrlIcon.Value = Spell(EditorIndex).Icon
>! .scrlMap.Value = Spell(EditorIndex).Map
>! .scrlX.Value = Spell(EditorIndex).x
>! .scrlY.Value = Spell(EditorIndex).y
>! .scrlDir.Value = Spell(EditorIndex).Dir
>! .scrlVital.Value = Spell(EditorIndex).Vital
>! .scrlDuration.Value = Spell(EditorIndex).Duration
>! .scrlInterval.Value = Spell(EditorIndex).Interval
>! If Spell(EditorIndex).IsAoE Then
>! .chkAOE.Value = 1
>! Else
>! .chkAOE.Value = 0
>! End If
>! .scrlAOE.Value = Spell(EditorIndex).AoE
>! .scrlAnimCast.Value = Spell(EditorIndex).CastAnim
>! .scrlAnim.Value = Spell(EditorIndex).SpellAnim
>! .scrlStun.Value = Spell(EditorIndex).StunDuration
>! .scrlBaseStat.Value = Spell(EditorIndex).BaseStat
>!
>!
>! If frmEditor_Spell.cmbType.ListIndex = SPELL_TYPE_PROJECTILE Then
>! frmEditor_Spell.Frame4.Visible = True
>! With Spell(EditorIndex).ProjecTile
>! frmEditor_Spell.scrlProjectileDamage.Value = .Damage
>! frmEditor_Spell.scrlProjectilePic.Value = .Pic
>! frmEditor_Spell.scrlProjectileRange.Value = .Range
>! frmEditor_Spell.scrlProjectileSpeed.Value = .Speed
>! End With
>! End If
>!
>! ' find the sound we have set
>! If .cmbSound.ListCount >= 0 Then
>! For i = 0 To .cmbSound.ListCount
>! If .cmbSound.List(i) = Trim$(Spell(EditorIndex).Sound) Then
>! .cmbSound.ListIndex = i
>! SoundSet = True
>! End If
>! Next
>! If Not SoundSet Or .cmbSound.ListIndex = -1 Then .cmbSound.ListIndex = 0
>! End If
>! End With
>! EditorSpell_BltIcon
>! Spell_Changed(EditorIndex) = True
>! ' Error handler
>! Exit Sub
>! errorhandler:
>! HandleError "SpellEditorInit", "modGameEditors", Err.Number, Err.Description, Err.Source, Err.HelpContext
>! Err.Clear
>! Exit Sub
>! End Sub
>! ```

Mortal Angels, this is my old EO, that you send me as "fix", I'm trying to really fix it! ![;)](http://www.touchofdeathforums.com/community/public/style_emoticons/<#EMO_DIR#>/wink.png) Just to learn more…
Link to comment
Share on other sites

Oh God!! ![<_<](http://www.touchofdeathforums.com/community/public/style_emoticons/<#EMO_DIR#>/dry.png)

Can't believe that I didn't saw this before… oh f*ck, what a waste of time...

Thx a lot bro! ![;)](http://www.touchofdeathforums.com/community/public/style_emoticons/<#EMO_DIR#>/wink.png)
Link to comment
Share on other sites

It might not be changing because when you change a spell it's not changing Spell_Changed(EditorIndex) = True make sure it's not doing something like this

With Spell(EditorIndex)

' loop for stats

For i = 1 To Stats.Stat_Count - 1

frmEditor_Spell.scrlStatBonus(i).Value = .Stat_Req(i)

Next

End With

You see if you have this in there and you dont have 1 To Stats.Stat_Count - 1 of frmEditor_Spell.scrlStatBonus then it wont recognize it as changed….

If I just lost you then do the following (place the little red dot)

![](http://i45.tinypic.com/8wecer.png)

Now run the game and try editing a spell and when you change your spell selection if it doesn't pause the game and jump to this it means the sub is exiting out before it can tell the program that the spell has been changed!

For instance perhaps with

If frmEditor_Spell.cmbType.ListIndex = SPELL_TYPE_PROJECTILE Then

frmEditor_Spell.Frame4.Visible = True

With Spell(EditorIndex).ProjecTile

frmEditor_Spell.scrlProjectileDamage.Value = .Damage

frmEditor_Spell.scrlProjectilePic.Value = .Pic

frmEditor_Spell.scrlProjectileRange.Value = .Range

frmEditor_Spell.scrlProjectileSpeed.Value = .Speed

End With

End If

any of these following might be named incorrectly and so exits the sub

Frame4, scrlProjectileDamage, scrlProjectilePic, scrlProjectileRange, scrlProjectileSpeed
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...