How to add an option to Config.ini

Bit stuck on this one, I spent 20 minutes yesterday trying to work it out but I seem to be missing something. Could someone please explain fully how to add an option to the Config.ini file?

checked these subs?


Public Sub SaveOptions()

    PutVar App.Path & "\data\options.ini", "OPTIONS", "Game_Name", Options.Game_Name

    PutVar App.Path & "\data\options.ini", "OPTIONS", "Port", STR(Options.Port)

    PutVar App.Path & "\data\options.ini", "OPTIONS", "MOTD", Options.MOTD

    PutVar App.Path & "\data\options.ini", "OPTIONS", "Website", Options.Website

End Sub

Public Sub LoadOptions()

    Options.Game_Name = GetVar(App.Path & "\data\options.ini", "OPTIONS", "Game_Name")

    Options.Port = GetVar(App.Path & "\data\options.ini", "OPTIONS", "Port")

    Options.MOTD = GetVar(App.Path & "\data\options.ini", "OPTIONS", "MOTD")

    Options.Website = GetVar(App.Path & "\data\options.ini", "OPTIONS", "Website")

End Sub

Yeah added a resolution option in but says I havnt defined the resolution option.

options are defined in the optionsrec in modtypes server side.


Public Options As OptionsRec

Private Type OptionsRec

    Game_Name As String

    MOTD As String

    Port As Long

    Website As String

End Type

but would a res option not go clientside?

that file is called config.ini i think.

same principle applies though :P


' options

Public Options As OptionsRec

' Type recs

Private Type OptionsRec

    Game_Name As String

    SavePass As Byte

    Password As String * NAME_LENGTH

    Username As String * ACCOUNT_LENGTH

    IP As String

    Port As Long

    MenuMusic As String

    Music As Byte

    Sound As Byte

    Debug As Byte

End Type

Derp, I meant the config.ini xD. Is it still defined in ModTypes?

yes, same stuff, just other options ^^

And all handled client side yeah?

yes, client options are handled clientside :P

yes, client options are handled clientside :P

Self Explanitory ;) Thanks for your help, I was just missing where to define it 🙂

np mate :)

Log in to reply