Alice Community

Alice Community (http://www.alice.org/community/index.php)
-   Share Objects (http://www.alice.org/community/forumdisplay.php?f=8)
-   -   File I/O Tool (http://www.alice.org/community/showthread.php?t=6758)

room14 06-16-2011 12:44 AM

Having the same error as densestu.:(
btw, you should add a method that converts strings into numbers:)

DensetsuNoKaboom 06-16-2011 06:20 AM

[QUOTE=room14;37562]Having the same error as densestu.:(
btw, you should add a method that converts strings into numbers:)[/QUOTE]

Yeah, so you can make it read a "number" that is in the file and change it to a number and set a variable to that number, so it wouldn't be just strings you can save!

David B 06-16-2011 08:12 AM

I haven't come up with anything to use it for yet, but it is sounds very cool!

arty-fishL 06-16-2011 01:17 PM

I updated it to a working version.
I'm considering the other suggested features.

DensetsuNoKaboom 06-16-2011 03:05 PM

[QUOTE=arty-fishL;37593]I updated it to a working version.
I'm considering the other suggested features.[/QUOTE]

Really now?

[quote]Error during simulation.




Alice version: 2.2 02/10/2011



Throwable that caused the error:

Traceback (innermost last):

File "edu.cmu.cs.stage3.alice.core.property.ScriptProperty[name=script,owner=edu.cmu.cs.stage3.alice.core.response.ScriptResponse[world.iOTool.event.__Unnamed0__]]", line 1, in ?

File "<string>", line 1, in ?

SyntaxError: ('future feature division is not defined', ('C:\\Documents and Settings\\*\\My Documents\\Alice22\\Required\\jython-2.1\\Lib\\javaos.py', 23, 6, ''))


[/quote]
Future feature division?

EDIT: I think you should also know that this error occurs when I start playing a world with the object in it.

Mr Kidnapper 06-16-2011 03:06 PM

If you want uses, then you could use it to save PoV locations, booleans, and other number variables constantly every second to, for example, make a game a bit like Harvest Moon or other example sim game. In fact, I would applaud you for making a persistent world sim game. Persistent World could be achieved by making the world relative to computer date time, if you didn't know how.

TauTrumpsPi 06-16-2011 04:02 PM

You know, I find it funny that I ask you to do this and then a week later I learn how to do it in C++. Odd coincedence.

arty-fishL 06-16-2011 04:58 PM

I worked out what was wrong, its fixed.
Its updated and definitely works now, I tested it on a non-modified Alice.

DensetsuNoKaboom 06-16-2011 05:59 PM

[QUOTE=arty-fishL;37628]I worked out what was wrong, its fixed.
Its updated and definitely works now, I tested it on a non-modified Alice.[/QUOTE]

[quote]Error during simulation.




Alice version: 2.2 02/10/2011



Throwable that caused the error:

Traceback (innermost last):

File "edu.cmu.cs.stage3.alice.core.property.ScriptProperty[name=script,owner=edu.cmu.cs.stage3.alice.core.response.ScriptResponse[world.iOTool.write_line.__Unnamed0__]]", line 1, in ?

File "<string>", line 153, in writeline

IndexError: index out of range: -1


[/quote]

Bbbbububbuubuubbubut...

At least this time, it didn't happen until I tried to write a variable to line 1.
EDIT: And hey, it works when I overwrite the entire file with text rather than one line! And it works when I load that file!
EDIT2: And this is my 600th post!

arty-fishL 06-16-2011 06:43 PM

No, that's just you using it wrong.

You cant write to line 1, because line 1 doesn't exist.
It is like a list, it starts at line 0.
If you want a new line at any time just add in [I]\n[/I] .
Once the line exists you can write to it.


All times are GMT -5. The time now is 02:37 AM.

Copyright ©2020, Carnegie Mellon University
Alice 2.x 1999-2012, Alice 3.x 2008-2012, Carnegie Mellon University. All rights reserved.