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

Adding the .resolution Option in options.ini


boyesjs03
 Share

Recommended Posts

SO Im trying to add a resolution option to my options.ini file. Ive coded the option into ModDatabase and ModConsants but I get an error saying "Circular dependencies between modules".

Im guessing this is due to my ModConstants looking like this:

```

Public Const MAX_MAPX As Byte = (Options.ResolutionH / 32 - 1)

Public Const MAX_MAPY As Byte = (Options.ResolutionW / 32- 1)

```

Any ideas? Im trying to make it so the Max map x and y equals the resolution values in the options.ini file, these will be set by control boxes ( I can do that ).
Link to comment
Share on other sites

A user-defined type or constant in one module references a user-defined type or constant in a second module, which in turn references another user-defined type or constant in the first module. Remove the dependent references.

no idea for the rest though O.o
Link to comment
Share on other sites

> Could you explain this in code, Im still learning xD

Since your learning you should try this out on your own. I'll try to break it up for you.

ResolutionH and ResolutionW (In general the entire Optionsrec) is a variable. They are assigned values only during run time. While constants are automatically assigned valued the first thing on start up. So your best bet would be to change the Map_X and Map_Y global variables. (Public….)

After that you will have to set these variables values. In VB6 if the sub Main exists then it will be first sub to run. Therefore meaning that variables initialization and other important stuff should be initialized here. So find the Main sub and from there manipulate the variables Map_X and Map_Y. Make sure you do the initialization after the options have been loaded. Otherwise unexpected results might occur.
Link to comment
Share on other sites

> are you using Dx7? if yes you can do it like this
>
> Public Const MAX_MAPX As Byte = Options.ResolutionH
>
> Public Const MAX_MAPY As Byte = Options.ResolutionW

That is what caused the error. And ResolutionH and ResolutionW will be 0 when the constant is declared.
Link to comment
Share on other sites

> Abhi - I think I get this, so I change them as variables in ModConstants then I can manipulate them in the Sub Main.
>
> And I set it as a variable by announcing it as Public MAX_MAPX…

Yep. They should be global variables. (Public VarName As VarType)

This ensures that they can be accessed from everywhere in the game. And also make sure that the manipulation occurs only after the options are loaded. (There should be a call to a sub that loads the options in the Main procedure)
Link to comment
Share on other sites

Eurgh I cant do this. I announced them as Variables in modGlobals and removed them from the constants and created a sub to manipulate them and called it from modGeneral Main but it still needs a constant for the hotbar but if I put it in then it screws up ;(
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...