A program that can compare 2 versions of a file?

lightwriter
OK, I thought it would be worth experimenting with using something like a program that compares 2 files and tells you what is added and loads it to a 3rd file.
This relates to quest because the game I'm working on will constantly have updates but maybe I can try to find a work around with updating so that the players don't have to constantly start over and can just copy the new code into their save file and perhaps it will work as DLC as well.
Basically I want to trick Quest into running a custom made save file

Pertex
I use Examdiff Pro for file comparison. The standard version should be free. With the master version you can merge changes from 2 files into another ($49.99).
http://www.prestosoft.com/edp_examdiffpro.asp?flm=1

The Pixie
I guess what you want is to be able to upload a new version of your game, in which changes are in files, rather than the game itself. The game will need the capability to load the file, and to change the game based on the file content. That is certainly possible; I have experimented with doing similar stuff. Use GetFileData to open the files (in theory you can also use AJAX):
http://docs.textadventures.co.uk/quest/ ... edata.html

Thinking this through... So suppose the game has two rooms, A and B, and a data file with rooms C, D and E. When the player saves, all five rooms will be saved.

Now you update your game, adding rooms F and G to the data file. The player reloads the save game, with rooms A to E. You need some way to recognise that the game has been reloaded. I am not aware of a way to do that, but as a last resort, the player could type a REOAD command. That would start the file reload process.

That process would have to recognise rooms C, D and E are already there, but to add F and G. If all you are doing is adding (and that would include adding exits to existing rooms), that should be (relatively) easy. If you want to change something, you need to think about whether the player has already changed an attribute on that object. Not trivial, but certainly doable.

I am not sure how scripts will work in your data files - as far as I know you cannot convert text (from a file) into a script. That may mean you need all your scripts defined in your original, either as types (and I would use types heavily), or as attributes that you assign to new objects.

Use the game.publishfileextensions attribute to define which file types Quest will include in your game.

Before you get very far at all, upload your game and check it works on-line. You are in terra incognito, and it is likely to work differently in the editor, the published game and the on-line game.

Good luck!

Pertex
I don't think it's possible to do this. There is for example an object that starts in room1 and is taken by the player, so that it is in the inventory when the game is saved. In the updated version the start position of this object is moved into room2. So when updating the saved game Quest must decide where to put this object, room2 or the inventory of the player.

lightwriter
What if you use CloneAndMove instead of MoveObject and then edit the Take Command to CloneAndMoveObject and then destroy the original object?
How do I read the file as code?

The Pixie
One way would be to have a text file looking like this:
new=bowtie/wearable
alias=Spotted bowtie
parent=kitchen
worn=false

find=hat
lookat=A tatty old hat

Then code in Quest that can read each line. When it gets to "new=" it creates a new object of that type and name, then all subsequent lines apply to that object. A "find=" would be for an existing objecting.
It would have to guess the type for each attribute, so "parent" would be an object, but "false" indicates a Boolean.

That would be relatively easy to code, but awkard to write the files.

An alternative would be to have the file in XML, like normal Quest files, and use a JavaScript library to convert it into Quest objects. I have no idea how to do that, or even if it is possible, but the data files could be extracted from Quest games very easily.

lightwriter
I may just have the player manually create a txt file and then code it where it reads it and somewhat acts as contiuing where the game is left off because this seems really complicated, what is the code to read a line from a txt file?
Something like this:

Tyler
1234
1
0
21

The Pixie
I had a go at a quick demo:
viewtopic.php?f=18&t=5512

This topic is now closed. Topics are closed after 60 days of inactivity.

Support

Forums