Recreate location as player moves

  • If you're still interested in my level streaming system, I will make the tutorial tonight.

    Basically, I made a family for Loadable Sprites and a Loadable tilemap, a MapSection object which was a tiled background with the same size as the screen, and used local storage to load and save information.

    The MapSection object is given a PID instance variable which stands for Positional based Identifier.

    I assigned LoadableSprites and LoadableTilemaps the same variable, but the value is given from the MapSection that these objects are created on top of.

    I then made a global variable called MapName, for the name of the map the player is playing or editing on.

    You must know how to use the TokenAt function within Construct 2. I use this to save within the local storage MapName_Sprites_MapsectionX_MapSectionY and MapName_Tilemaps_MapsectionX_MapSectionY

    I then would say, every tick, if player is not Overlapping a MapSection with the PID of round(PlayerOrCameraPosition/screensize)*screensize [this will check the current screensize grid section the players viewport is within]

    Load from the LocalStorage the keys of the corresponding position and the positions up, down, left, right and diagonally from the player.

    The keys themselves will hold the information for what Sprites and tiles to load when a MapSection is created. This is done by the player adding them.

    The values themselves will simply be the JSON value of the families at that point in time.

    After all that is done, just delete objects when the player is far enough away from them. Remember that they need to be saved with localstorage first though, or they will be completely gone.

  • By the way, you can export the save info as an Array in JSON format. I'll make a tutorial for it all if you need.

  • KTML5 So I'd be able to save objects only once and then use them as I want? Seems good enough for me.

    I intend to work by creating in my level-editor and deleting them once saved.

    I will look forward for your tutorial.

  • KTML5 So I'd be able to save objects only once and then use them as I want? Seems good enough for me.

    I intend to work by creating in my level-editor and deleting them once saved.

    Yup! Sorry that I didn't upload last night, my girlfriend and I have to share a computer right now and she's in school. I'll let you know when I get the tutorial finished.

  • KTML5 Not a problem. I have a lot of work to do aside from it anyway

  • XpMonster, Alright <img src="{SMILIES_PATH}/icon_e_smile.gif" alt=":)" title="Smile">. I've just started work on a website, http://c2develop.weebly.com/, which my tutorial will be uploaded to when it's complete. I have to work tonight, but I've started the tutorial and will have it ready for you tomorrow!

    Also, it'd be awesome if afterwords, you could help me by sharing the tutorial and example via social media. <img src="{SMILIES_PATH}/icon_e_smile.gif" alt=":)" title="Smile"> My tutorials will be Public Domain and adless, so they're completely open and available for use for all Construct 2 users.

  • KTML5 OK. It's a good deed.

    However I do not really use social media so don't got many friends to share with. Especially friends interested in C2.

    But I do keep the list of people who have helped me with my game. So I'll try to return the favor to you.

    Later I will create pages and such for my game and then won't forget to promote your project. Same applies for my website when it's done.

  • XpMonster, That's alright, thanks! What you choose to do is up to you, after all, it is public domain!

    Anyways, I apologize, the tutorial is nearly complete. Just making sure everything is perfect lol.

    Rather than getting it done today, I'm going to build an entire template. I've decided to make this a multi part Online RPG Maker game, where players can build maps and play on them. This way I can teach quite a lot with one project.

  • XpMonster, I've got the first part of the tutorial series posted. It won't be very helpful to you right now, I'm going to make an entire project expert level template out of this.

  • KTML5 Thank you!

    I'll check it out later. Anything related to map editor could be helpful to me as well.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • KTML5

    Good tutorial. Constructers with proper knowledge should understand it well enough.

    When do you planning to write next part?

  • XpMonster, sorry for taking so long! I've been working 60+ hours so I can afford funding the promotion and marketing of my current projects. It's a big workload right now, but I'll get back to this as soon as possible. I have the next two days off, so I'll try to fit it in!

  • KTML5,

    Hello! Don't want to bother you, but have you by any chance created something?

    I would be OK with just what I'm after. Can get editor working by myself.

  • XpMonster, Sorry, I'm not going to be finishing that tutorial any time soon.

    Instead, I'm going to give out the source .CAPX for the "free" version of my project, which includes the techniques required to save and load map data in the way you're wanting to do.

    The only difference between the way I was going to teach how to do it, and the way I'm doing it in my game, is that all maps are going to be created inside an editor, and then display on one half of the layout. This allows split-screen players to adventure through a big overworld, while existing in two completely separate levels at the same time. It's pretty fucking awesome.

  • KTML5 Haven't seen it yet of course, but does sounds cool when you say it.

    I'm currently in very early stage of my game and it's a huge project. First tech version includes root features for it and this is one of them.

    I may sound too ambitious sometimes, but I most likely die than won't finish this one. It's been beared in mind for too long and I have done so much already -_-

    I'll make sure to include you in early alpha testing. You won't hear of it soon tho.

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