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

[CS:DE]Change Map Size(Scrolling)


Rithy58
 Share

Recommended Posts

EDIT : ReDim the AutoTile array did the trick. I should have known.

So I tried to change the map size a few minutes a go and I got subscript out of range.
```
Public Sub cacheRenderState(ByVal x As Long, ByVal y As Long, ByVal layerNum As Long)
Dim quarterNum As Long

    ' exit out early
    If x < 0 Or x > Map.MaxX Or y < 0 Or y > Map.MaxY Then Exit Sub

    With Map.Tile(x, y)
        ' check if the tile can be rendered
        If .Layer(layerNum).Tileset <= 0 Or .Layer(layerNum).Tileset > Count_Tileset Then
            Autotile(x, y).Layer(layerNum).renderState = RENDER_STATE_NONE
            Exit Sub
        End If

```
Autotile(x, y).Layer(layerNum).renderState = RENDER_STATE_NONE is highlighted.

And I mean changing the map size in Map Property when editing a map.
This is a vanilla CS:DE. Nothing was changed.

I'm not really sure how I would go on about and fix this.

Sincerely,
Rithy
Link to comment
Share on other sites

  • 1 month later...
I'm not at the computer at the moment but look for where it does the other redim for the tiles and put the redim auto tile code there.

Another work around is once you've changed the map max x and Mac y sizes, if you delete all of your maps and let the server create empty maps you won't run into this error.  But to have dynamic sizes for different maps you'll want to add in the new redim for autotiles
Link to comment
Share on other sites

If you hadn't figure out how to fix it yet,

In the Map Property, when you send the new data over, you ReDim the MapTile(X, Y) to the the MaxX and MaxY value from the textbox. Just do the same for AutoTile(X, Y).

Sincerely,
Rithy

PS: I don't have the source with me so I'm just telling you from memory.
Link to comment
Share on other sites

grrr. Not bashing Robin especially since I should know this stuff inside and out by now… but we really need an EO with only these small fixes inside.

His personal projects is way beyond the version he released publicly so I don't blame him for the little buggers we find here and there.
Link to comment
Share on other sites

@Shadowwulf:

> I think I have it.
>
> If I change the map size then walk, map editor crashes and doesnt save the changes…
> The game is still running and working fine so thats ok to live with for now.

That bug is not really a bug but more of a limitation, in my opinion. That happen not because of the programmer made a mistake but it's because of how map work.

Sincerely,
Rithy
Link to comment
Share on other sites

Yes and no, I believe it is because we changed the map size, so when we walk and then check the map size we have a conflict which is handled by simply closing the map editor.

Haven't fully researched it but I am sure it can be cured… but it isn't important. saving should be done constantly during edits and changing the map size is enough of a change to need it in my opinion...
Link to comment
Share on other sites

There is no one here who is both skilled enough to work on it and motivated to actually come around to doing it.

I'm afraid you're on your own. Hell, the reason I started programming in the first place was because all the programmers I came across couldn't do their job properly.
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...