willunited Posted March 7, 2013 Author Share Posted March 7, 2013 Im trying to do this in ModConstans:' Map constantsPublic Const MAX_MAPS As Long = 100Select Case Options.resolutionCase 800Public Const MAX_MAPX As Byte = (800 / 32 + 1)Case 1024Public Const MAX_MAPX As Byte = (1024 / 32 + 1)Case 1366Public Const MAX_MAPX As Byte = (1366 / 32 + 1)Case ElsePublic Const MAX_MAPX As Byte = (800 / 32 + 1)End SelectPublic Const MAX_MAPY As Byte = 18Public Const MAP_MORAL_NONE As Byte = 0Public Const MAP_MORAL_SAFE As Byte = 1But i get this error:Invalid Outside blocking. Link to comment Share on other sites More sharing options...
abhi2011 Posted March 8, 2013 Share Posted March 8, 2013 I don't think you can use any type of conditional statements in the declaration section of modules. The values will have to be edited during run time. This means that constants for MAX_MapX and MAX_MapY cannot be used, you will have to make a public variable. Link to comment Share on other sites More sharing options...
escfoe2 Posted March 24, 2013 Share Posted March 24, 2013 If this is Server-Side which I assume it is. It should be.In modGlobals add:```Public MAX_MAPX As Byte```Place this in frmServer Form_Load.```If Not Options.Resolution < 800 And Not Options.Resolution > 1366 Then MAX_MAPX = (Options.Resolution / 32 + 1) Else MAX_MAPX = (800 / 32 + 1)```If you have an array that requires MAX_MAPX in the declaration then take it out. As in change```YOURARRAY(1 to MAX_MAPX) as Long```To```YOURARRAY() as Long```EDIT:And change what I had you put in Form_Load to this.```If Not Options.Resolution < 800 And Not Options.Resolution > 1366 Then MAX_MAPX = (Options.Resolution / 32 + 1) Else MAX_MAPX = (800 / 32 + 1)If MAX_MAPX > 0 Then Redim YOURARRAY(1 to MAX_MAPX)``` Link to comment Share on other sites More sharing options...
RyokuHasu Posted March 26, 2013 Share Posted March 26, 2013 You can not do any kind of active programming outside of a function or sub. The only things that can be outside of a function or sub are the declarations of Global and module variables and constants, Enums, User defined types, and references to DLLs.… I think that covers most of them. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now