Is there a way to make a URL that could put a player in a particular part of a game?

0 favourites
  • 9 posts
From the Asset Store
Basic Rounded Vector Geometry Player Design with Glow for 3 player games
  • So if we have a website that has a construct game on it. is there any way to point to a particular part of it by clicking a unique URL? like imagine you shared a link to your game online but you want one person to jump right into a particular part of the game rather than always going ot the main menu?

    Thanks,

    Caleb

  • construct.net/en/make-games/manuals/construct-3/plugin-reference/browser

    There are various expressions you can use depending on how you want to set it up.

  • I'd recommend using the Hash expression of the Browser object. For example you could set it up so if someone visits example.com/index.html#settings, it goes directly to the Settings screen rather than the usual title screen.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • I'd recommend using the Hash expression of the Browser object. For example you could set it up so if someone visits example.com/index.html#settings, it goes directly to the Settings screen rather than the usual title screen.

    Ohhh sounds cool.

    Can hashes be used in QR-Codes as well? Not sure about how they are generated.

  • Yep, a QR code can contain any URL including hashes.

  • ah that's awesome! ok sweet. Thanks so much for this. Sorry I got side tracked with some other stuff and I guess I didn't check notify me for the thread!

    I don't need to do this much but I could definitely see sending people to a particular area could have it's advantages like my catalog of products vs going through the front door all the time.

    Thanks!

    Caleb

  • I'm going to experiment with this, but i'm a little unclear how this would work.. i mean i guess on the first event sheet i'd put some kind of listener? i guess i can't wrap my head around if I give someone a URL and i put a hash in it.

    So if someone visits "example.com/index.html#settings" what in the C3 project is listening for this URL?

    so there is a "on hash change" which i don't know if that's even relevant. so if i had three different "example.com/index.html#settings" like settings1 settings2 and settings3.. so the browser has "on hash change".. then it wants an action to follow that..

    As far as actions go there is "set hash".. but we're not setting the hash we're trying to listen to url with a certain hashtag to do a given action. i feel like neither of these browser objects would work as i would expect.

    I would imagine there is a browser listen event that is "listen for x hashtag" and if detechted do an action, but i'm not seeing this.

  • Hash

    The string after the hash at the end of the URL, including the hash. For example, if the current URL is example.com/index.html#hashpart, this returns #hashpart.

    System On start of layout,

    System Compare two values browser.hash = "#settings"

    ->Go to layout settings

  • oooooo gotcha, so it's inside that area for values. that makes sense! i forget those values can be tucked inside the compare value area. thanks!

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)