Weblink in the game ?

  • #1, by dorothee-rascleTuesday, 26. May, 12:12 A month 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, 12:39 A month 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")
    1

    Imperator

    6811 Posts

  • #3, by dorothee-rascleTuesday, 26. May, 13:00 A month ago
    Thank you !

    Newbie

    9 Posts

  • #4, by crazyduckgamesSaturday, 30. May, 20:19 A month 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

    7 Posts

  • #5, by afrlmeSunday, 31. May, 02:07 A month 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")
    1
    2
    3

    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

    6811 Posts

  • #6, by crazyduckgamesMonday, 01. June, 09:52 A month 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

    7 Posts

  • #7, by afrlmeMonday, 01. June, 12:42 A month 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

    6811 Posts

Write post