| Mirage Source http://miragesource.net/forums/ |
|
| RTE 9: Subscript out of Range http://miragesource.net/forums/viewtopic.php?f=201&t=5239 |
Page 1 of 1 |
| Author: | Ciao [ Tue Mar 10, 2009 1:38 am ] |
| Post subject: | RTE 9: Subscript out of Range |
Public Sub CheckSprites() Dim i As Long i = 1 While FileExist(GFX_PATH & "sprites\" & i & GFX_EXT) NumSprites = NumSprites + 1 i = i + 1 Wend ReDim DDS_Sprite(1 To NumSprites) ReDim DDSD_Sprite(1 To NumSprites) ReDim SpriteTimer(1 To NumSprites) End Sub It highlights the part of the code thats red. Any ideas on what to do to fix this error? |
|
| Author: | GIAKEN [ Tue Mar 10, 2009 1:39 am ] |
| Post subject: | Re: RTE 9: Subscript out of Range |
Change i = 1 to i = 0 and While FileExist(GFX_PATH & "sprites\" & i & GFX_EXT) To While FileExist(GFX_PATH & "sprites\" & i + 1 & GFX_EXT) Then make a check like: Code: If i < 1 Then
MsgBox "You are missing sprite files!" GameDestroy End If |
|
| Author: | Ciao [ Tue Mar 10, 2009 1:48 am ] |
| Post subject: | Re: RTE 9: Subscript out of Range |
I found the problem, the problem is that Tony's image splitter renames the images as sprite0, sprite1 and so on but the sprites should be called 0,1,2 and shouldn't have "sprite" in the file name for them to be MS4 Compatible, so would you be able to change the code so that it allows it to work if the sprites are named sprite0,sprite1 and so on instead of just the numbers, like: 0,1,2 and so on? |
|
| Author: | GIAKEN [ Tue Mar 10, 2009 2:13 am ] |
| Post subject: | Re: RTE 9: Subscript out of Range |
Yeah just open the image splitter source and change this: Code: SavePicture frmMain.picConversion.Image, App.Path & "\Splitted Images\sprite" & i & Extension To this: Code: SavePicture frmMain.picConversion.Image, App.Path & "\Splitted Images\" & i & Extension
|
|
| Author: | Ciao [ Tue Mar 10, 2009 2:27 am ] |
| Post subject: | Re: RTE 9: Subscript out of Range |
Got it, im so stupid I forgot that the source was uploaded too because lately i've been checking around different forums and I sometimes get mixed up between them. Thank you so much for your help and patience so far. I really really appreciate the time you sacrificed to help me |
|
| Author: | GIAKEN [ Tue Mar 10, 2009 2:30 am ] |
| Post subject: | Re: RTE 9: Subscript out of Range |
download/file.php?id=251 |
|
| Author: | Ciao [ Tue Mar 10, 2009 2:39 am ] |
| Post subject: | Re: RTE 9: Subscript out of Range |
Thanks, blah i've been editing my client lately but ever since I added the graphics I get errors. Do you know what I should do when I get a "Error Rendering Graphics: The rectangle was invalid. " Error? I checked the forums and used the search bar but I couldn't find anyone who had the same error. |
|
| Author: | Ciao [ Tue Mar 10, 2009 2:57 am ] |
| Post subject: | Re: RTE 9: Subscript out of Range |
Nevermind fixed it, everythings fixed now. Thanks for you time I really appreciated it and I hope I can help you out in the future. |
|
| Page 1 of 1 | All times are UTC |
| Powered by phpBB® Forum Software © phpBB Group https://www.phpbb.com/ |
|