You are not logged in.
Pages: 1
We have a good script engine, but we need some really basic file functions.
new_file "path/filename.ext"
creates a new file in the path with the name given.
open_write_file "path/filename.ext"
opens the file for writing.
open_read_file "path/filename.ext"
opens the file for reading.
close_file "path/filename.ext"
closes the file.
file_read_string "string"
reads a string from the file
file_read_int "int"
reads an integer from a file
file_read_binary "bin"
reads binary from a file
file_write_string "string"
writes a string to a file
file_write_int "int"
writes an integer to a file
file_write_binary "bin"
writes binary to a file
file_write_newline
writes a new line to a file.
Just some ideas of commands that could be useful. Allegro has functionality to write to files no?
Offline
Won't be made. I will not provide direct file access.
You'll be able to save/load data from the disk when we implement the loading & saving system in the engine, which is more structured and more secure. At that point you'll be able to save the progress of the player, make your demo recorder, etc.
Offline
How about making it so that the save function can save the value of global variables when it is designed. I have an idea for a graphical level selector, in which players can enter a certain quest and play any levels that they have beaten and the next one in the story line, however I need the ability to store global variables. Not only that, but with the ability to keep track of global variables would make it easier to keep track of how many bonus stages the player has beaten.
If I knew then what I know now I'd tell you that the story's true. Cause whatever you do, it comes back to you. -Slaughter, Burning Bridges
Offline
I understand your skepticism regarding file functions, but please take into consideration the object developers for once. ![]()
When I created objects in Game Maker 8 I always make sure to have a debug export vital data regarding the objects to a readable file. Where it writes down what function is called and when. This way you can get a much deeper knowledge what is happening to your objects, when, where, and why. This way you can retrace what the object was doing before the crash, and you can give as much details as you can possibly want to. With the nanoparser as lousy as it is today this is a way to get the information needed to the developer of the object together with the level you're working on when the crash happened.
Today this information is not given out to the gamer, and for their convenience it is better to give them the means to send in a crash report as detailed as possible don't you think?
Your object "MyRing" crashed Open Surge when colliding with an enemy object.
This is as good error reports we can get today.
2011-01-10 23:37:10.005 MyRing created
x: 300
y: 417
id: 128
speed: 10
sprite: SD_RING
animation: 0
frame: 0
2011-01-10 23:37:10.011 MyRing executes state "Main"
x: 300
y: 417
id: 128
speed: 10
sprite: SD_RING
animation: 0
frame: 1
...And this is how good they can be if this functionality is added. The choice is up to the coder ofc, but I can't see any valid reasons why not to add this.
Offline
I understand your skepticism regarding file functions, but please take into consideration the object developers for once.
Also take into consideration security reasons, which is probably pretty important compared to doing file functions that may not be needed anyways, for once. Also, remember who made said object developing to begin with. ![]()
Load. Save. That's all we need. Nothing else. Everything else just seems unnecessary. I don't see any reason to complicate things further. Top priority is the characters system and physics engine. Personally, I'd rather have that first.
Even with just that, it will be low-medium priority. There isn't even any levels to save to right now.
Offline
I understand your skepticism regarding file functions, but please take into consideration the object developers for once.
Well, jobro... I'll explain it in details then. Please understand that Open Surge is not Game Maker.
There won't be direct file access because...
1) security. Example: a hacker could develop an object that overwrites the engine executable, making it become a computer virus. There are many other worse threats...
2) people may develop objects that conflict with the load/save system that will be developed later.
The load/save system is based on the following ideas:
i) Whenever an user plays a quest, there will be a number of independent virtual "files" to choose: file 1, file 2, ... file N. Pretty much like RPG games. Each one will contain the progress of the player. If you've cleared the game in file 1, you can start a fresh new game in file 2 without losing your progress in file 1.
ii) I don't want data from one game (file) affecting other, and direct file access is the ultimate threat to that
iii) (this is also to lunarrush) Will you be able to load/save data from/to the disk? Of course! This data will be entirely inside those virtual "files", not real files. The data will be completely isolated.
Will the load/save system be developed today? No. Really, we don't even have Surge's sprite to this day. I need to balance things. While I develop this highly modifiable engine that you people can play with, I still want to develop the game called Open Surge. I do not want to compete with Game Maker.
Offline
Hi there,
Please take into consideration Alexandre's point of view regarding direct file access since it's a kinda recurrent problem in game development.
I always make sure to have a debug export vital data regarding the objects to a readable file.
On the other hand, I do think Jobromedia is in need of a script log file to debug his scripts. Maybe some log functions can be considered?
Secondary note: IMHO, here we've got a very common case where someone (I'm not pointing anyone, I also do the same mistake sometimes.) is presenting some technical functionalities (see 1st post) without telling why he needs it.
My two cents would be to advise all interested developers (scripters, ect.) to try presenting a need (or use case) before considering the implementation, again without pointing anybody since I also do the same when I don't put attention to it.
I hope this will help future requests.
Best regards.
Offline
Is there a "Debug Mode" that shows the debug messages at certain points, I'm guessing in the log? You know, debug messages inserted throughout the code to identify where things broke.
Offline
If writing text to the log file is everything you need, then it's a much more feasible request. I still want to hear from jobromedia, though.
Offline
Top priority is the characters system and physics engine. Personally, I'd rather have that first.
I'll agree with SilverstepP on this point, the new physics engine has to come first. This will probably also have an effect on the way you build objects, so it should be given priority over a save/load system.
If I knew then what I know now I'd tell you that the story's true. Cause whatever you do, it comes back to you. -Slaughter, Burning Bridges
Offline
It would really help to have the posibility to log what happens when running an object, sometimes Open Surge crashes without giving me an error message. So if I can add log messages into my objects giving me more exact information on what happens then it would really help a lot. Maybe even logging to a different file if that is possible.
Offline
It would really help to have the posibility to log what happens when running an object, sometimes Open Surge crashes without giving me an error message. So if I can add log messages into my objects giving me more exact information on what happens then it would really help a lot. Maybe even logging to a different file if that is possible.
http://opensnc.sourceforge.net/wiki/ind … List#Tasks
If the game crashes without displaying an error message, then there's a bug somewhere.
http://opensnc.sourceforge.net/forum/vi … php?id=488
Offline
jobromedia wrote:It would really help to have the posibility to log what happens when running an object, sometimes Open Surge crashes without giving me an error message. So if I can add log messages into my objects giving me more exact information on what happens then it would really help a lot. Maybe even logging to a different file if that is possible.
http://opensnc.sourceforge.net/wiki/ind … List#Tasks
If the game crashes without displaying an error message, then there's a bug somewhere.
http://opensnc.sourceforge.net/forum/vi … php?id=488
When you define a variable without a '$' (like: let "something = 1") the game won't display an error message at all.
Offline
Yes, I've seen games with "Debug Mode". I think it's just a global variable that can be set to on or off (1 or 0, true or false, etc.). Within the code itself, you can put something like
if(debug_variable = 1)
writeToLog("Function braineater starts here!")
Of course, this is likely completely wrong syntax... just for demonstration purposes. You can place as many as you like with no interference in the game. In Bash scripting, you'd just use something like "echo" to just output that to a terminal instead of a file, if you wanted. You get the idea, I hope. It tracks how far the code made it before crashing, as if leaving breadcrumbs to follow.
Offline
When you define a variable without a '$' (like: let "something = 1") the game won't display an error message at all.
Thanks. It should be fixed in 446. You can use that, since the old physics aren't screwed up yet. But please hurry, because it will soon lose usability for a while.
Offline
Pages: 1