There is a way to have a control on read/write on config.ini in viosionaire?

  • #10, by MortoAllegroSunday, 08. March 2015, 17:37 10 years ago
    ok.
    i have this object into "optionMenu" scene that i move to mark the position of the music level.

    move object works fine when i'm on the scene it goes up and down, but whenever i restart the game, the initial position of my object is restored to the original position of the object.

    how i can tell visionaire to save the last position of that object even when i quit?

    example:

    music : - -------||--- +

    i use move obj to change marker position and decrease music level.
    but as i say, whenever i leave the scene the position is restored

    may i need to use Lua?


    Newbie

    44 Posts


  • #11, by afrlmeSunday, 08. March 2015, 17:58 10 years ago
    Depends. If it's value based then you just need to create an if query at begin of scene to determine the value / offset. You could even query the volume amount, but that would require lua script.

    Imperator

    7285 Posts

  • #12, by MortoAllegroSunday, 08. March 2015, 18:08 10 years ago
    i place my object manually on screen.
    than move that mark when i press - or + using moving obj action.

    but when i quit and than reload my game, the position is always the same.

    there is something like:
    getObject("Scenes[optionMenu].SceneObject[MusicMark]").setPosition(100,100)
    


    i already have a code that change a variabile at the beginning of the scene

    if getVolume(eMusicVolume) == 0 then
        -- do something
        getObject("Scenes[optionMenu].SceneValues[Music_Volume]"):setValue(VValueInt, 0)
    end
    if getVolume(eMusicVolume) == 100 then
        -- do something
        getObject("Scenes[optionMenu].SceneValues[Music_Volume]"):setValue(VValueInt, 100)
    end
    


    i can insert there something that change the position of that object depending on the volume level.

    i think is the best and clear way to do that.

    Newbie

    44 Posts

  • #13, by afrlmeSunday, 08. March 2015, 18:30 10 years ago
    Yes but it wouldn't be .setPosition. It would be something like...
    getObject("Scenes[optionMenu].SceneObject[MusicMark]"):setValue(VObjectOffset, {x = 100, y = 100})
    


    P.S: did you know it's actually much easier to control the position of an animation as opposed to an object? ObjectOffset is actually an offset value whereas animations can be positioned to specific coordinates with VAnimationCurrentPosition, however the position is based on the top left pixel of the animation & not the center.

    Imperator

    7285 Posts

  • #14, by MortoAllegroSunday, 08. March 2015, 19:12 10 years ago
    unfortunately the code doesn't works.

    my scene name is optionMenu and the object i want to position is Music Mark.

    To use as you suggest Vanimation.
    i suppose i have to create an animation for my object and then moving that animation.
    there is something on the wiki?

    Newbie

    44 Posts

  • #15, by afrlmeSunday, 08. March 2015, 19:32 10 years ago
    To move an animation it has to be active (currently playing or preloaded).

    example...
    ActiveAnimations["test"].AnimationCurrentPosition = {x = 500, y = 100}
    

    or with tweening... (transition / slide between current position to new position).
    ActiveAnimations["test"]:to(3000, {AnimationCurrentPosition = {x = 500, y = 100}, easeQuintOut) -- slide to 500 by 100 over 3 (3000ms) seconds with smooth transition end.
    

    Imperator

    7285 Posts

  • #16, by MortoAllegroMonday, 09. March 2015, 13:17 10 years ago
    this is my config.ini

    FILE = utr.vis
    #
    # FULLSCREEN = {yes|no}
    # yes - starts the game in fullscreen
    # no - starts the game in a window
    FULLSCREEN = no
    #
    # RESOLUTION = {Auto|Desktop|Game}
    # Auto - wide-screen support is activated if a wide-screen display is detected
    # Desktop - current desktop resolution is used when game is started in full screen mode
    # Game - game is initialized with the resolution specified in the game
    RESOLUTION = desktop
    #
    # INTRO = {yes|no}
    # yes - Show the intro movie on start-up
    # no - Don't show the intro movie
    INTRO = yes
    #
    # LANGUAGE = {Italian|English|}
    LANGUAGE = Italian
    #
    # LOGLEVEL = {Info|Warning|Error}
    LOGLEVEL = error

    why my game even is setup by Fullscreen = no
    even that, my game start at fullscreen.

    seems my game dosen't read the config.ini at all.

    what i doing wrong?

    Newbie

    44 Posts

  • #17, by afrlmeMonday, 09. March 2015, 13:57 10 years ago
    Is this for a compiled (.exe) version of the game or is this for a game currently running through the VS editor?

    If it's the editor then the file needs to be in the correct folder located somewhere in appdata/local. If it's a .exe file then I'm not sure if it needs to be in the .exe root folder or in the appdata folder. In 3.7.1 both used to be in the root folder, but the paths have changed in 4.x, so I'm not 100% sure.

    P.S: if fullscreen = no then resolution must be an actual resolution value like 640x480.

    Imperator

    7285 Posts

  • #18, by MortoAllegroMonday, 09. March 2015, 14:59 10 years ago
    yes is a compiled one,that i made for mac.

    my folder contain:

    config.ini
    report.txt
    utr.app
    utr.vis

    cnfig.ini:

    FILE = utr.vis
    #
    # FULLSCREEN = {yes|no}
    # yes - starts the game in fullscreen
    # no - starts the game in a window
    FULLSCREEN = no
    #
    # RESOLUTION = {Auto|Desktop|Game}
    # Auto - wide-screen support is activated if a wide-screen display is detected
    # Desktop - current desktop resolution is used when game is started in full screen mode
    # Game - game is initialized with the resolution specified in the game
    RESOLUTION = 400x225
    #
    # INTRO = {yes|no}
    # yes - Show the intro movie on start-up
    # no - Don't show the intro movie
    INTRO = yes
    #
    # LANGUAGE = {Italian|English|}
    LANGUAGE = Italian
    #
    # LOGLEVEL = {Info|Warning|Error}
    LOGLEVEL = error

    Newbie

    44 Posts

  • #19, by MortoAllegroMonday, 09. March 2015, 23:35 10 years ago
    i have an option that use change Language.

    if i play in the editor, the action works fine.

    if i build my game. The same option doesn't work.

    all read/write method find on the net does not work on Visionaire 4.

    the config.ini that seems to be stored in Content/resources of the app seems even not to works..just the resolution seems to affect my game. the other options like Language..no.

    what i can do to change Subtitles?

    ok! may i'm in a rush but...how i can build a professional game if to create a simple configuration menu is so hard...

    once upon a time there is a Claim that say "Now it‘s child‘s play to create
    an Adventure Game."

    ok maybe i'm not a child any more...but.. ^^

    help me!

    Newbie

    44 Posts

  • #20, by afrlmeTuesday, 10. March 2015, 00:13 10 years ago
    Yes, I've got to admit that I'm not very fond of the new statement. I'm not even sure when that got added to the main download / start page. For me, that saying does not inspire confidence.

    Creating the menu, is the hardest part of making a game in Visionaire Studio; well a decent menu, at any rate. There's lots of things that can go wrong as they often require loads of conditions, values & if queries to make sure all your buttons & save menus etc, are working as they should.

    The config.ini is a little hard to explain, as it's mostly for professional / commercial based games where it is important for the game to remember the players option configuration, each time they boot up the game. Most indie games can probably get away with a minimal menu system.


    • new game
    • continue
    • credits
    • quit


    They may also let you adjust the brightness or volume levels but that's about as complex as they get.

    In regards to the read / write config.ini script I wrote: most of the parameters are not recognized by the engine itself. Most of them have to be manually read & then you define what should happen based on what the line returns. So you set a condition or a value, or start an action or play an animation, based on what each line says.

    The language line should define which text language is set on game launch, however you can also trigger that manually yourself based on what that line returns. So you could say..

    -- not actual code, just an example...
    if line = Language = English then
     game.StandardLanguage = Languages["English"]
    end
    


    P.S: since 4.x there's actually 2 language outputs now. Text & Speech can be set independently from each other in case you only have one or two talkie languages but multiple text only languages.

    Imperator

    7285 Posts