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

Change the size of the picScreen (the map)


Alpha
 Share

Recommended Posts

Question:

I use the default map size (30x30) and my PicScreen is basically 28x14 tiles (896x450). I have tried everything, but my map just doesn't work like it should. So how should i edit this code and is there someway to count the numbers there should be?
Link to comment
Share on other sites

  • Replies 79
  • Created
  • Last Reply

Top Posters In This Topic

i don t really know if it was because of this tutorial so i m just asking if someone had the same problem,the size of the screen is great and works fine but when i use attribut in map editor some times when i like click on a block i have to click the one next to it for it to appear and happens all over again.just asking to see if someone s had such a problem
Link to comment
Share on other sites

I think I must be doing something wrong. I just started editing source today, in fact this is the first edit I've done. I followed the directions word for word but I dont notice any difference in my game's screen resolution, it stays the same size. And I saved my edit and everything. :/
Link to comment
Share on other sites

ok well i guess it may be another tutorial or somthing i don t really know,forgot when all this started.can t find out what s causing it at all,some clicks work while others don t this is the only tutorial i can think of that has somthing to do with the map.
Link to comment
Share on other sites

I just did this recently and it worked so you must be doing something wrong

Heres the steps i toook:
In ModGameLogic, Search for this:

               ```
NewX = 10
                NewY = 7

                NewPlayerY = Player(MyIndex).y - NewY
                NewPlayerX = Player(MyIndex).X - NewX

                NewX = NewX * PIC_X
                NewY = NewY * PIC_Y

                NewXOffset = Player(MyIndex).xOffset
                NewYOffset = Player(MyIndex).yOffset

                If Player(MyIndex).y - 7 < 1 Then
                    NewY = Player(MyIndex).y * PIC_Y + Player(MyIndex).yOffset
                    NewYOffset = 0
                    NewPlayerY = 0
                    If Player(MyIndex).y = 7 And Player(MyIndex).Dir = DIR_UP Then
                        NewPlayerY = Player(MyIndex).y - 7
                        NewY = 7 * PIC_Y
                        NewYOffset = Player(MyIndex).yOffset
                    End If
                ElseIf Player(MyIndex).y + 9 > MAX_MAPY + 1 Then
                    NewY = (Player(MyIndex).y - (MAX_MAPY - 14)) * PIC_Y + Player(MyIndex).yOffset
                    NewYOffset = 0
                    NewPlayerY = MAX_MAPY - 14
                    If Player(MyIndex).y = MAX_MAPY - 7 And Player(MyIndex).Dir = DIR_DOWN Then
                        NewPlayerY = Player(MyIndex).y - 7
                        NewY = 7 * PIC_Y
                        NewYOffset = Player(MyIndex).yOffset
                    End If
                End If

                If Player(MyIndex).X - 10 < 1 Then
                    NewX = Player(MyIndex).X * PIC_X + Player(MyIndex).xOffset
                    NewXOffset = 0
                    NewPlayerX = 0
                    If Player(MyIndex).X = 10 And Player(MyIndex).Dir = DIR_LEFT Then
                        NewPlayerX = Player(MyIndex).X - 10
                        NewX = 10 * PIC_X
                        NewXOffset = Player(MyIndex).xOffset
                    End If
                ElseIf Player(MyIndex).X + 11 > MAX_MAPX + 1 Then
                    NewX = (Player(MyIndex).X - (MAX_MAPX - 19)) * PIC_X + Player(MyIndex).xOffset
                    NewXOffset = 0
                    NewPlayerX = MAX_MAPX - 19
                    If Player(MyIndex).X = MAX_MAPX - 9 And Player(MyIndex).Dir = DIR_RIGHT Then
                        NewPlayerX = Player(MyIndex).X - 10
                        NewX = 10 * PIC_X
                        NewXOffset = Player(MyIndex).xOffset
                    End If
                End If

                ScreenX = GetScreenLeft(MyIndex)
                ScreenY = GetScreenTop(MyIndex)
                ScreenX2 = GetScreenRight(MyIndex)
                ScreenY2 = GetScreenBottom(MyIndex)

                If ScreenX < 0 Then
                    ScreenX = 0
                    ScreenX2 = 20
                ElseIf ScreenX2 > MAX_MAPX Then
                    ScreenX2 = MAX_MAPX
                    ScreenX = MAX_MAPX - 20
                End If

                If ScreenY < 0 Then
                    ScreenY = 0
                    ScreenY2 = 15
                ElseIf ScreenY2 > MAX_MAPY Then
                    ScreenY2 = MAX_MAPY
                    ScreenY = MAX_MAPY - 15
                End If
```

Replace with this:
               ```
NewX = 12
                NewY = 9

                NewPlayerY = Player(MyIndex).y - NewY
                NewPlayerX = Player(MyIndex).x - NewX

                NewX = NewX * PIC_X
                NewY = NewY * PIC_Y

                NewXOffset = Player(MyIndex).xOffset
                NewYOffset = Player(MyIndex).yOffset

                If Player(MyIndex).y - 9 < 1 Then
                    NewY = Player(MyIndex).y * PIC_Y + Player(MyIndex).yOffset
                    NewYOffset = 0
                    NewPlayerY = 0
                    If Player(MyIndex).y = 9 And Player(MyIndex).Dir = DIR_UP Then
                        NewPlayerY = Player(MyIndex).y - 9
                        NewY = 9 * PIC_Y
                        NewYOffset = Player(MyIndex).yOffset
                    End If
                ElseIf Player(MyIndex).y + 11 > MAX_MAPY + 1 Then
                    NewY = (Player(MyIndex).y - (MAX_MAPY - 18)) * PIC_Y + Player(MyIndex).yOffset
                    NewYOffset = 0
                    NewPlayerY = MAX_MAPY - 18
                    If Player(MyIndex).y = MAX_MAPY - 9 And Player(MyIndex).Dir = DIR_DOWN Then
                        NewPlayerY = Player(MyIndex).y - 9
                        NewY = 9 * PIC_Y
                        NewYOffset = Player(MyIndex).yOffset
                    End If
                End If

                If Player(MyIndex).x - 12 < 1 Then
                    NewX = Player(MyIndex).x * PIC_X + Player(MyIndex).xOffset
                    NewXOffset = 0
                    NewPlayerX = 0
                    If Player(MyIndex).x = 12 And Player(MyIndex).Dir = DIR_LEFT Then
                        NewPlayerX = Player(MyIndex).x - 12
                        NewX = 12 * PIC_X
                        NewXOffset = Player(MyIndex).xOffset
                    End If
                ElseIf Player(MyIndex).x + 14 > MAX_MAPX + 1 Then
                    NewX = (Player(MyIndex).x - (MAX_MAPX - 24)) * PIC_X + Player(MyIndex).xOffset
                    NewXOffset = 0
                    NewPlayerX = MAX_MAPX - 24
                    If Player(MyIndex).x = MAX_MAPX - 12 And Player(MyIndex).Dir = DIR_RIGHT Then
                        NewPlayerX = Player(MyIndex).x - 12
                        NewX = 12 * PIC_X
                        NewXOffset = Player(MyIndex).xOffset
                    End If
                End If

                ScreenX = GetScreenLeft(MyIndex)
                ScreenY = GetScreenTop(MyIndex)
                ScreenX2 = GetScreenRight(MyIndex)
                ScreenY2 = GetScreenBottom(MyIndex)

                If ScreenX < 0 Then
                    ScreenX = 0
                    ScreenX2 = 25
                ElseIf ScreenX2 > MAX_MAPX Then
                    ScreenX2 = MAX_MAPX
                    ScreenX = MAX_MAPX - 25
                End If

                If ScreenY < 0 Then
                    ScreenY = 0
                    ScreenY2 = 19
                ElseIf ScreenY2 > MAX_MAPY Then
                    ScreenY2 = MAX_MAPY
                    ScreenY = MAX_MAPY - 19
                End If
```

In ModDirectX, Search for this

```
Public Function GetScreenLeft(ByVal Index As Long) As Long
    GetScreenLeft = GetPlayerX(Index) - 11
End Function

Public Function GetScreenTop(ByVal Index As Long) As Long
    GetScreenTop = GetPlayerY(Index) - 8
End Function

Public Function GetScreenRight(ByVal Index As Long) As Long
    GetScreenRight = GetPlayerX(Index) + 10
End Function

Public Function GetScreenBottom(ByVal Index As Long) As Long
    GetScreenBottom = GetPlayerY(Index) + 8
End Function
```

Replace with this

```
Public Function GetScreenLeft(ByVal Index As Long) As Long
    GetScreenLeft = GetPlayerX(Index) - 13
End Function

Public Function GetScreenTop(ByVal Index As Long) As Long
    GetScreenTop = GetPlayerY(Index) - 10
End Function

Public Function GetScreenRight(ByVal Index As Long) As Long
    GetScreenRight = GetPlayerX(Index) + 13
End Function

Public Function GetScreenBottom(ByVal Index As Long) As Long
    GetScreenBottom = GetPlayerY(Index) + 10
End Function
```
Next, visit frmMirage and you should put things similiar to this
![](http://i44.tinypic.com/2uzs2f4.png)

After that just fix around everything else on the screen to make sure it all fits, also make sure you extend the Window itself, and you GUI
Link to comment
Share on other sites

Okay, I got it to work.. somewhat. Now whenever I go to edit my map my mouse is severely misaligned from where I'm clicking. I'll click a spot to drop something and it'll show up like five tiles down and right from where I dropped it.. and also I'm getting a weird glitch thing at the end of the screen, but only at the bottom of the map. I editted the public functions in modDirectx to be bigger to compensate for the larger screen and it's still really weird looking, as if the tile repeats itself over and over.
Link to comment
Share on other sites

Okay, I figured out some stuff while trying to fix it. The reason why the mouse was misaligned with the x, y axis when placing things was because the New X and New Y are either too high or too low. You need to fiddle around with them until they fit your screen just right. For the 800x600 NewX should = 12 and New Y should = 9 as it says in the tutorial, but if you're making your screen bigger or smaller than that, then you need to fiddle with the numbers (bigger x,y for bigger picscreens and smaller for smaller screens) Also, the reason why sometimes the map skips on the sides or top/bottom is because the Public Functions need to also fit your Picscreen size. For example, for public function mine was screwing up because my Picscreen was at 600x806, I changed it to 600x800 and it works fine, those 6 pixels make a huge difference. For public functions GetScreen 13,10,13,10 you need to have your screen exactly at 600x800 no bigger no less otherwise you'll get the glitchy thing at the edge of your screen. At least this is what I have observed, it may be different for some of you but it's worth trying if you're still having trouble.
Link to comment
Share on other sites

  • 1 month later...
  • 4 weeks later...
  • 2 months later...
I understand the idea that the resolution cannot change, but is there a way to make it so the map would not scroll at all, Im using 30/30 map sizes, and My players would prefer a non-scrolling map. Ive tried editing the source code, the last few things I have edited are coming along great, but so far this is the only thing thats getting in my way.
Link to comment
Share on other sites

  • 2 weeks later...
  • 2 weeks later...
OK, so let me get this right. This edit does NOT stretch the screen and make everything look like crap?

This simply increases the total size of the window which also allow's you to have more more tiles? I really don't wanna read 4 pages. lol

Thanks, please answer. And to the topic starter, pelase put a screenshot if possible. This avoids reading 'words' in the entire topic. :)
Link to comment
Share on other sites

  • 1 month later...
  • 3 weeks later...
Alright straight up I need some help i've been trying to mess with it for a while but I havn't really gotten anywhere… My values are going to seem rather messed up i'm sure...

Could we try to break down what each numerical value is controlling? The reason I ask is that I have an issue where all my map sizes are appropriate now but on the client they either have the very last row of X and last row of y as a gray area or a black area... it's like a fringe that's pulled over the player ... Can't map on it; it's like it's there but the client isn't rendering it as part of the world; the player can walk under the black/gray and theres no glitchy movement or anything... I just can't map on it and it's drawn OVER player in game...

Correct me if i'm wrong on this but I removed the elseif's at first because they seemed to only relate to a scrolling map situation? I use static maps ... I'm aiming for 15x11

Any thoughts? Heres the edits I had done;
```
NewX = 7
                NewY = 5

                NewPlayerY = Player(MyIndex).y - NewY
                NewPlayerX = Player(MyIndex).X - NewX

                NewX = NewX * PIC_X
                NewY = NewY * PIC_Y

                NewXOffset = Player(MyIndex).xOffset
                NewYOffset = Player(MyIndex).yOffset

                If Player(MyIndex).y - 5 < 1 Then
                    NewY = Player(MyIndex).y * PIC_Y + Player(MyIndex).yOffset
                    NewYOffset = 0
                    NewPlayerY = 0
                    If Player(MyIndex).y = 5 And Player(MyIndex).Dir = DIR_UP Then
                        NewPlayerY = Player(MyIndex).y - 5
                        NewY = 5 * PIC_Y
                        NewYOffset = Player(MyIndex).yOffset
                    End If
              ElseIf Player(MyIndex).y + 7 > MAX_MAPY + 1 Then
                    NewY = (Player(MyIndex).y - (MAX_MAPY - 10)) * PIC_Y + Player(MyIndex).yOffset
                    NewYOffset = 0
                    NewPlayerY = MAX_MAPY - 10
                    If Player(MyIndex).y = MAX_MAPY - 7 And Player(MyIndex).Dir = DIR_DOWN Then
                        NewPlayerY = Player(MyIndex).y - 7
                        NewY = 7 * PIC_Y
                        NewYOffset = Player(MyIndex).yOffset
                    End If
                End If

                If Player(MyIndex).X - 7 < 1 Then
                    NewX = Player(MyIndex).X * PIC_X + Player(MyIndex).xOffset
                    NewXOffset = 0
                    NewPlayerX = 0
                    If Player(MyIndex).X = 7 And Player(MyIndex).Dir = DIR_LEFT Then
                        NewPlayerX = Player(MyIndex).X - 7
                        NewX = 7 * PIC_X
                        NewXOffset = Player(MyIndex).xOffset
                    End If
            ElseIf Player(MyIndex).X + 9 > MAX_MAPX + 1 Then
                    NewX = (Player(MyIndex).X - (MAX_MAPX - 15)) * PIC_X + Player(MyIndex).xOffset
                    NewXOffset = 0
                    NewPlayerX = MAX_MAPX - 18
                    If Player(MyIndex).X = MAX_MAPX - 7 And Player(MyIndex).Dir = DIR_RIGHT Then
                        NewPlayerX = Player(MyIndex).X - 8
                        NewX = 8 * PIC_X
                        NewXOffset = Player(MyIndex).xOffset
                    End If
                End If

                ScreenX = 0
                ScreenY = 0
                ScreenX2 = 15
                ScreenY2 = 11

                If ScreenX < 0 Then
                    ScreenX = 0
                    ScreenX2 = 15
                ElseIf ScreenX2 > MAX_MAPX Then
                    ScreenX2 = MAX_MAPX
                    ScreenX = MAX_MAPX - 20
                End If

                If ScreenY < 0 Then
                    ScreenY = 0
                    ScreenY2 = 15
                ElseIf ScreenY2 > MAX_MAPY Then
                    ScreenY2 = MAX_MAPY
                    ScreenY = MAX_MAPY - 15
                End If
``````
Public Function GetScreenLeft(ByVal Index As Long) As Long
    GetScreenLeft = GetPlayerX(Index) - 12
End Function

Public Function GetScreenTop(ByVal Index As Long) As Long
    GetScreenTop = GetPlayerY(Index) - 8
End Function

Public Function GetScreenRight(ByVal Index As Long) As Long
    GetScreenRight = GetPlayerX(Index) + 12
End Function

Public Function GetScreenBottom(ByVal Index As Long) As Long
    GetScreenBottom = GetPlayerY(Index) + 8
End Function
```
now again I should mention I've messed with this enough that some of the numbers don't make sense to why I picked that number; but hell.. it's the closest to working that I've gotten it…

Thanks fella's I appreciate the help; I've been on the forums for a few days now and figured okay I guess I'll post :(

MSN [email protected]/[email protected] if you want;
thanks for the responses.
Edit: They're only black (the x y rows) @ night so I guess I juts still have the same ol' gray box problem.
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...