Mirage Source

Free ORPG making software.
It is currently Wed May 22, 2024 10:10 am

All times are UTC




Post new topic Reply to topic  [ 9 posts ] 
Author Message
 Post subject: Small Issue with Spells
PostPosted: Tue Mar 24, 2009 9:13 am 
Offline
Regular
User avatar

Joined: Tue Jun 03, 2008 6:22 pm
Posts: 50
Well for some odd reason when i go into the /editspell menu and choose "say number 4" it crashes.
now in VB6 it did the same but took me to the code

Code:
frmSpellEditor.scrlFrame.Max = (DDS_Spell(scrlFrame.Value).SurfDescription.lWidth \ SIZE_X) - 1


im not exactly sure what to do, any help would be much appreciated. :)


Top
 Profile  
 
PostPosted: Tue Mar 24, 2009 12:58 pm 
Jared wrote:
Well for some odd reason when i go into the /editspell menu and choose "say number 4" it crashes.
now in VB6 it did the same but took me to the code

Code:
frmSpellEditor.scrlFrame.Max = (DDS_Spell(scrlFrame.Value).SurfDescription.lWidth \ SIZE_X) - 1


im not exactly sure what to do, any help would be much appreciated. :)


The exact error code would help a lot.


Top
  
 
PostPosted: Tue Mar 24, 2009 3:53 pm 
Offline
Regular
User avatar

Joined: Tue Jun 03, 2008 6:22 pm
Posts: 50
Code:
"Runtime error 9  -   Subscript 9 out of range

thats the general error i get when trying to edit a spell or make a new one.

That is the exact error code... was the only thing i got..


Top
 Profile  
 
PostPosted: Tue Mar 24, 2009 4:18 pm 
This is my sub:

Code:
Public Sub SpellEditorBltSpell()
Dim SpellNum As Long
Dim sRECT As DxVBLib.RECT
Dim dRECT As DxVBLib.RECT

    SpellNum = frmSpellEditor.scrlPic.Value

    If SpellNum < 1 Or SpellNum > NumSpells Then
        frmSpellEditor.picPic.Cls
        Exit Sub
    End If
   
    SpellTimer(SpellNum) = GetTickCount + SurfaceTimerMax

    If DDS_Spell(SpellNum) Is Nothing Then
        Call InitDDSurf("spells\" & SpellNum, DDSD_Spell(SpellNum), DDS_Spell(SpellNum))
    End If
   
    frmSpellEditor.scrlFrame.Max = (DDSD_Spell(SpellNum).lWidth \ SIZE_X) - 1
   
    sRECT.Top = 0
    sRECT.Bottom = SIZE_Y
    sRECT.Left = frmSpellEditor.scrlFrame.Value * SIZE_X
    sRECT.Right = sRECT.Left + SIZE_X
   
    dRECT.Top = 0
    dRECT.Bottom = SIZE_Y
    dRECT.Left = 0
    dRECT.Right = SIZE_X

    Call Engine_BltToDC(DDS_Spell(SpellNum), sRECT, dRECT, frmSpellEditor.picPic)

End Sub


Compare them.


Top
  
 
PostPosted: Tue Mar 24, 2009 6:50 pm 
Offline
Regular
User avatar

Joined: Tue Jun 03, 2008 6:22 pm
Posts: 50
this is client side btw.


Code:
Private Sub scrlFrame_Change()
    lblFrameNum.Caption = scrlFrame.Value
    Call SpellEditorBltSpell
    frmSpellEditor.scrlFrame.Max = (DDS_Spell(scrlFrame.Value).SurfDescription.lWidth \ SIZE_X) - 1
End Sub


lol.. i didnt know witch one you were talking about so.



Code:
Public Sub SpellEditorBltSpell()
Dim SpellPic As Long
Dim sRECT As DXVBLib.RECT
Dim dRECT As DXVBLib.RECT

    SpellPic = frmSpellEditor.scrlPic.Value

    If SpellPic < 1 Or SpellPic > NumSpells Then
        frmSpellEditor.picPic.Cls
        Exit Sub
    End If
   
    Call DD_ReadySurface("spells\" & SpellPic, DDS_Spell(SpellPic))
   
    sRECT.Top = 0
    sRECT.Bottom = SIZE_Y
    sRECT.Left = frmSpellEditor.scrlFrame.Value * SIZE_X
    sRECT.Right = sRECT.Left + SIZE_X
   
    dRECT.Top = 0
    dRECT.Bottom = SIZE_Y
    dRECT.Left = 0
    dRECT.Right = SIZE_X

    Call DD_BltToDC(DDS_Spell(SpellPic).Surface, sRECT, dRECT, frmSpellEditor.picPic)

End Sub


Top
 Profile  
 
PostPosted: Tue Mar 24, 2009 9:11 pm 
Jared wrote:
this is client side btw.


Code:
Private Sub scrlFrame_Change()
    lblFrameNum.Caption = scrlFrame.Value
    Call SpellEditorBltSpell
    frmSpellEditor.scrlFrame.Max = (DDS_Spell(scrlFrame.Value).SurfDescription.lWidth \ SIZE_X) - 1
End Sub


lol.. i didnt know witch one you were talking about so.



Code:
Public Sub SpellEditorBltSpell()
Dim SpellPic As Long
Dim sRECT As DXVBLib.RECT
Dim dRECT As DXVBLib.RECT

    SpellPic = frmSpellEditor.scrlPic.Value

    If SpellPic < 1 Or SpellPic > NumSpells Then
        frmSpellEditor.picPic.Cls
        Exit Sub
    End If
   
    Call DD_ReadySurface("spells\" & SpellPic, DDS_Spell(SpellPic))
   
    sRECT.Top = 0
    sRECT.Bottom = SIZE_Y
    sRECT.Left = frmSpellEditor.scrlFrame.Value * SIZE_X
    sRECT.Right = sRECT.Left + SIZE_X
   
    dRECT.Top = 0
    dRECT.Bottom = SIZE_Y
    dRECT.Left = 0
    dRECT.Right = SIZE_X

    Call DD_BltToDC(DDS_Spell(SpellPic).Surface, sRECT, dRECT, frmSpellEditor.picPic)

End Sub


Well, tbh, I meant take your code and then take my code. Compare them and find out what was different. Mine works fine.


Top
  
 
PostPosted: Tue Mar 24, 2009 9:28 pm 
Offline
Regular
User avatar

Joined: Tue Jun 03, 2008 6:22 pm
Posts: 50
Well it did not work on mine, and also, just to see if anything i added was messing it up i downloaded a fresh version of MS4 and still the same exact issue without any editing.

Strange eh?

Lol also im quiet new at this so, im still learning.


Top
 Profile  
 
PostPosted: Sun Mar 29, 2009 1:14 pm 
Offline
Newbie

Joined: Mon May 12, 2008 4:54 pm
Posts: 9
change the
Code:
frmSpellEditor.scrlFrame.Max = (DDS_Spell(scrlFrame.Value).SurfDescription.lWidth \ SIZE_X) - 1


with this
Code:
frmSpellEditor.scrlFrame.Max = (DDS_Spell(scrlPic.Value).SurfDescription.lWidth \ SIZE_X) - 1


in case u didnt notice,
i replaced scrlFrame.value with scrlPic.value


Top
 Profile  
 
PostPosted: Sun Mar 29, 2009 4:53 pm 
Offline
Regular
User avatar

Joined: Tue Jun 03, 2008 6:22 pm
Posts: 50
lol that just caused more errors. thank you though.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 9 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 5 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group