How do I create a mission system?

0 favourites
  • 4 posts
From the Asset Store
Fully commented source code/event sheet & sprites to create a space shooter game
  • I didn't know what to write as topic name...

    I want to implement a mission/task system into my game. Let's say 50 missions/task that the player must complete in order to receive exp or money or whatever.

    Player will have to kill n number of enemies, explode things, collect n numer of items, etc.

    With that said, I've been cracking my head trying to define if I should use JSON, XML, CSV (Rex's Plugin)... As I don't really know how they work. I've used ajax before on webpages but, only to save info to a database, and that was using JQuery, so I'm don't really get what is going on with the examples provided in the tutorials.

    I'm leaning towards CSV, making a table where I have Text info for the mission, reward, task to complete, etc

    So here's how I think I could do it:

    Load the csv file as a String using ajax.

    Do all Construct stuff to present the first mission to player... player kills 50 monsters and completes that mission.

    Set the "completed" row in the csv string to 1 and continue to the following mission using another variable which stores current mission.

    Now, this is where everything gets messy.

    How do I save all that? I can use webstorage but, won't my info be overwritten by the On start ---> Load from csv file?

    I don't know if what I'm writing makes sense. I can load, modify and set new values to the json string loaded from my csv project file. But how to save that info, so when the game is loaded again, player can check missions that are already completed?

    I want it to be offline as I don't like that the game needs access to internet to be "fully played", and I don't know if I can alter my project file during runtime to save the new info. Can I alter a JSON, XML or CSV file during runtime?

    Sorry for my english, hope you guys can help me or share some light on the subject.

    Thanks.

  • With savegame and webstorage you can save all the changes you want.

    Loading the CSV (If you decide on that) should therefor only be necessary the first time you play..

    Load the savegame and set a variable to check before loading the CSV..

  • Thanks LittleStain

    I think I was looking for confirmation, as I had doubts about the way I wanted to do things. I read a lot of stuff about xml, csv, and json so my head wasn't working properly. That means the file is only used once, am I right? Maybe I should just save to webstorage the mission number and its state "completed", "not completed" and keep loading al the text from the file. Guess I'll make some tests to see perfomance.

    So, I still have one doubt, is it possible to save to a file during runtime on mobile devices? I won't be needing it but, just to clarify that point.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Yes there is an action to save the game..

    Saving automatically after a mission is completed or when certain goals are reached, should be no problem..

    Just make sure it's a triggered event, I guess..

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