Weblink in the game ?

  • #1, by dorothee-rascleTuesday, 26. May 2020, 12:12 4 years ago
    Hello there,

    I'd like to know if it's possible to include a link to a web page inside the game. 
    Like, if you click on an object, it opens a web page.

    Thanx a lot,
    Doo.

    Newbie

    9 Posts


  • #2, by afrlmeTuesday, 26. May 2020, 12:39 4 years ago
    Yeah it's just a single line of code. Create an execute a script action part inside of a left click action for the object & add this line of code inside of it...

    Quick note: it will minimize the game & open up the players default internet browser or will open up a new tab if their default browser is already open.

    startDefaultBrowser("http://visionaire-studio.net")

    Imperator

    7278 Posts

  • #3, by dorothee-rascleTuesday, 26. May 2020, 13:00 4 years ago
    Thank you !

    Newbie

    9 Posts

  • #4, by crazyduckgamesSaturday, 30. May 2020, 20:19 4 years ago
    Sorry for hijacking this thread, but creating a new one seems like a waste of space.

    Would it be possible to start another program this way, too? And maybe close this one afterwards.

    Newbie

    8 Posts

  • #5, by afrlmeSunday, 31. May 2020, 02:07 4 years ago
    You can use os.execute() function (just google Lua & os functions for examples) to launch something else. os.exit() to close the game. But why would you want to do that? I don't think anyone would appreciate your game randomly closing the game & randomly launching another application without warning.

    Just as a quick example to show that os.execute works. I have created a new text file on my desktop called "hello_world.txt".

    I ran this code via atom text editor with the code type set to Lua.

    local dir = os.getenv("userprofile") .. "\\Desktop\\"
    
    
    
    os.execute(dir .. "hello_world.txt")

    It immediately popped open the txt file, but again. I really don't think it's a good idea forcing a new app to be opened up as it looks messy & will likely not be appreciated by the player.

    Quick note: accessing anything that is not in your games root directory or a sub-folder in your games root directory is not very simple.

    Imperator

    7278 Posts

  • #6, by crazyduckgamesMonday, 01. June 2020, 09:52 4 years ago
    I'm planning on making small game chapters that are separate games each. They belong together, but each is its own project. The function I asked for would be used for a kind of chapter menu. A bit like some modern point and click adventures are doing with their episodes. This way I could bundle them together. 

    Newbie

    8 Posts

  • #7, by afrlmeMonday, 01. June 2020, 12:42 4 years ago
    Ah, you don't actually have to launch them separately. You can use the replaceGame() function to swap out the .vis file, so just make sure each chapter/episode data is stored in its own unique folder.

    Imperator

    7278 Posts