Mirage Source http://web.miragesource.net/forums/ |
|
Too many local, nonstatic variables http://web.miragesource.net/forums/viewtopic.php?f=201&t=99 |
Page 1 of 8 |
Author: | Matt [ Sat Jun 03, 2006 6:06 am ] |
Post subject: | Too many local, nonstatic variables |
I get this error, after applying Verrigan's Seamless maps tut (I never got this problem any other time I added it, but yeah). Anyone have any idea? |
Author: | Dark Echo [ Sat Jun 03, 2006 9:26 am ] |
Post subject: | |
Ahh.. this has been brought up heaps if times.. Um.. I seriously cant remember what the fix was i think it might have something to do with video and cpu memory.. I cant actually remember though.. Sorry.. |
Author: | grimsk8ter11 [ Sat Jun 03, 2006 2:06 pm ] |
Post subject: | |
you get this error if a User Defined Type is exceeding 64KB of static data, meaning set arrays, ect. So what you do to fix it? Remove some of the things you added like layers, ect. or make dynamic tiles and maps so they aren't allocated as static data. |
Author: | Matt [ Sat Jun 03, 2006 4:10 pm ] |
Post subject: | |
I have no idea how to do that, and all I added was Verrigan's seamless maps. Now, when I had my old source (Oblivion, ManaSync), I added this just to test it, and everything worked fine, I've never seen this before. Maybe it's what Dark said, maybe I'll switch over to Video Memory. Thanks for the help guys. |
Author: | grimsk8ter11 [ Sat Jun 03, 2006 4:26 pm ] |
Post subject: | |
whats highlighted. |
Author: | BigRed [ Sat Jun 03, 2006 4:29 pm ] |
Post subject: | |
Make them dynamic by changing anything like this: Tile(0 to x, 0 to x) as ... to Tile() as ... then redim it somewhere, perhaps the load map or something like that. Redim Preserve Map(x).Tile(0 to x, 0 to x) In client, you don't need Preserve. Make since? |
Author: | Matt [ Sat Jun 03, 2006 4:32 pm ] |
Post subject: | |
Yeah, I just did that, thanks. It fixed that problem, but now I get a subscript out of range with this: Code: Ground = Map.Tile(X, Y).Ground In this: Code: Sub BltTile(ByVal X As Long, ByVal Y As Long)
Dim Bufx As Long, Bufy As Long Dim i As Integer Dim Ground As Long Dim Anim1 As Long Dim Anim2 As Long For i = -1 To 7 If i = -1 Then Ground = Map.Tile(X, Y).Ground Anim1 = Map.Tile(X, Y).Mask Anim2 = Map.Tile(X, Y).Anim Bufx = (X * PIC_X) + (PIC_X * (MAX_MAPX + 1)) Bufy = (Y * PIC_Y) + (PIC_Y * (MAX_MAPY + 1)) Else Ground = SMaps(i).Tile(X, Y).Ground Anim1 = SMaps(i).Tile(X, Y).Mask Anim2 = SMaps(i).Tile(X, Y).Anim Select Case i Case 0 Bufx = (X * PIC_X) + (PIC_X * (MAX_MAPX + 1)) Bufy = Y * PIC_Y Case 1 Bufx = (X * PIC_X) + (2 * (PIC_X * (MAX_MAPX + 1))) Bufy = Y * PIC_Y Case 2 Bufx = (X * PIC_X) + (2 * (PIC_X * (MAX_MAPX + 1))) Bufy = (Y * PIC_Y) + (PIC_Y * (MAX_MAPY + 1)) Case 3 Bufx = (X * PIC_X) + (2 * (PIC_X * (MAX_MAPX + 1))) Bufy = (Y * PIC_Y) + (2 * (PIC_Y * (MAX_MAPY + 1))) Case 4 Bufx = (X * PIC_X) + (PIC_X * (MAX_MAPX + 1)) Bufy = (Y * PIC_Y) + (2 * (PIC_Y * (MAX_MAPY + 1))) Case 5 Bufx = X * PIC_X Bufy = (Y * PIC_Y) + (2 * (PIC_Y * (MAX_MAPY + 1))) Case 6 Bufx = X * PIC_X Bufy = (Y * PIC_Y) + (PIC_Y * (MAX_MAPY + 1)) Case 7 Bufx = X * PIC_X Bufy = Y * PIC_Y End Select End If rec.top = Int(Ground / 7) * PIC_Y rec.Bottom = rec.top + PIC_Y rec.Left = (Ground - Int(Ground / 7) * 7) * PIC_X rec.Right = rec.Left + PIC_X Call DD_BackBuffer.BltFast(Bufx, Bufy, DD_TileSurf, rec, DDBLTFAST_WAIT) If (MapAnim = 0) Or (Anim2 <= 0) Then ' Is there an animation tile to plot? If Anim1 > 0 And TempTile(X, Y).DoorOpen = NO Then rec.top = Int(Anim1 / 7) * PIC_Y rec.Bottom = rec.top + PIC_Y rec.Left = (Anim1 - Int(Anim1 / 7) * 7) * PIC_X rec.Right = rec.Left + PIC_X Call DD_BackBuffer.BltFast(Bufx, Bufy, DD_TileSurf, rec, DDBLTFAST_WAIT Or DDBLTFAST_SRCCOLORKEY) End If Else ' Is there a second animation tile to plot? If Anim2 > 0 Then rec.top = Int(Anim2 / 7) * PIC_Y rec.Bottom = rec.top + PIC_Y rec.Left = (Anim2 - Int(Anim2 / 7) * 7) * PIC_X rec.Right = rec.Left + PIC_X Call DD_BackBuffer.BltFast(Bufx, Bufy, DD_TileSurf, rec, DDBLTFAST_WAIT Or DDBLTFAST_SRCCOLORKEY) End If End If Next End Sub [EDIT] Ground = 0 If that helps any. |
Author: | grimsk8ter11 [ Sat Jun 03, 2006 5:00 pm ] |
Post subject: | |
did you redim the maps? and if you did (on game load) did you redim preserve when new maps are added? |
Author: | grimsk8ter11 [ Sat Jun 03, 2006 5:45 pm ] |
Post subject: | |
double post but whatever. its fixed now To Fix (for future reference): Code: Main():
Redim SaveMap.Tiles() Redim Maps.Tiles() Redim SMaps(7) Redim SMap(i).Tiles() (using for i = 0 to 7) Sub iLoadMap: Redim iLoadMap And then another Redim of SMaps(7) and .tiles in the other sub under iLoadMap |
Author: | Dark Echo [ Sun Jun 04, 2006 2:39 am ] |
Post subject: | |
Lol.. i was way off.. Oh well.. |
Page 1 of 8 | All times are UTC |
Powered by phpBB® Forum Software © phpBB Group https://www.phpbb.com/ |