Import or Export code

Gng

Heyall

Is it possible in Quest to export or import a line code into the start script?

I want to have different start script based on what happened in the middle of the game so that every time the player opens the game file, the game acknowledges what had happened in the last game and a new turn of events happen.

Is this possible or is it too ambitious?


When you start a game, it starts a new copy of the game; all attributes are set back to their default values.

I have seen achievement systems which work by not starting a new game; instead there's a "restart" command within the game, which resets a lot of stuff back to the start but leaves the achievements untouched. You might be able to do something like that. However, it's likely to end up as a very complex script.

For games played online, you could use Javascript to set cookies and/or LocalStorage, allowing you to save values between different instances of the game. The main drawback with this is that it won't work with the desktop player, which clears cookies on startup.


I know I am writing funny stuffs. =D
Whenever the player enters a new game, the game always start by asking the player "Do you have a game seed?"

A simplified game seed would be 00111100,
after the pc gets the player input it would recognize that the player have been through event 3,4,5,6 as stated in the game seed.
Therefore in this new game, the game would strongly pushes the player into the other events that the player have never been to.
After the player reached a new event which is also a new ending, the game updates the seed as 10111100, and informs the player to use this game seed for the next game to have a higher chance to get a different ending.

A complicated game seed works the same as 00111100, but it hides the number through a formula, so the player does not knows what is happening or what is inside the game seed, and a formula game seed can possibly store much more event datas than a 1 or 0 simplified code.
However I do not know maths and can't tell you how to do it, so this is my imagination of a complicated game seed:
d348854
The game understands d as the player's fourth game.
The game automatically divides 348854/3.14 = 111100, which then updates it as 00111100.


Gng

Woah that sounds very complicated.

I don't suppose there's a way to change codes in each seed or is there?


A simplified game seed would be 00111100,
after the pc gets the player input it would recognize that the player have been through event 3,4,5,6 as stated in the game seed.

The pc calculates the given game seed by the player, an example would be 00111100.
00111100/1000000=0 (This means event 1 is nil.)
(0x1000000) - 00111100 = 00111100 which is simplified as 0111100
0111100/1000000=0 (This means event 2 is nil.)
0x1000000 - 0111100 = 0111100 which is simplified as 111100
111100/100000 = 1 (This means event 3 is true.)

The same goes on for event 4 to event 8.
I got 0 in my math exam, so someone else will probably have a better calculation or explanation for this.

But if you get the point, continue the code.
You save each of the "true" or "false" attribute into the game.event1, game.event2, game.event3 to game.event8,
when the game takes in the player's seed and calculates if it is a 1 or 0.

During your gameplay code,
simply add in if game.event1 = true,
msg player a hint, "You have been down this road before, you should return and try an alternative path for a different ending."

if game.event1 = true and game.event3 = true,
msg player a hint, "The axe looks ominous, you have always feared to touch it, but guess what is going to happen if you take it this time round."


Another advanced method is hexadecimal to binary converter,
I understand you can easily convert it using google but in the quest app itself, I am not sure how to do that,
possibly you need another math background to do a formula to work it out.

So for 00111100 (Binary) = 3C (Hexadecimal).
So why is this good?

  1. Automated cover up of how the game works.
  2. 3C is easier to remember than 00111100
  3. 3C is faster to type than 00111100
  4. Make a longer data code like 3C3D

So I am going to try another method retrieve the true or false of each binary value, which is probably the faster way, but seriously, this is my first time and I possibly have no idea what I am doing.

if 00111100 > 10000000, game.event1 = "true", else game.event1 = "false"
if game.event1 = "true", 10000000 - 00111100.
if 0111100 > 1000000, game.event2 = "true", else game.event2 = "false"
if game.event2 = "true", 1000000 -0111100
if 111100 > 100000, game.event3 = "true", else game.even3 = "false"
if game.event3 = "true", 100000 - 111100
and so on.

Remember that as it is a calculation, you probably should not be feeding the game app "00111100",
you should store the value as a variable like "gameseed" or attribute like game.seed which then the value can be changed.
I wrote it as 00111100 in the calculations for easier understanding.


Log in to post a reply.

Support

Forums