PDA

View Full Version : Text-based Alice?


Chuma
03-03-2010, 01:45 PM
Hi!

I'm trying to make some simple 3D visualisations as part of a CS project, and Alice seems like the ideal thing for the job. Except for one thing - I want to program in another language, and let that program generate the input for Alice. Basically, I would like to get rid of that pretty user interface. Is there any way to do that?

Ideally I would like my other program (in, say, Perl or Java) to control the actions in the 3D world in real-time, but if I can get that program to generate an Alice program which I later run, that might do. Can I somehow import the code? Or do you have any other suggestions?
________
GLASS PIPE PICTURES (http://glasspipes.net/)
________
Videos Pornos (http://www.fucktube.com/)

dubastot
03-09-2010, 09:56 PM
I do recall a user saying that there was a way you could use typed codes. I am not sure what the function is called, but I think it is in the required file for alice.

dubastot
03-09-2010, 09:59 PM
I just checked and I believe the file is one of the three files in the resources folder which is in the required folder.

zonedabone
03-10-2010, 07:41 PM
It's called python. I wrote an article about it. Check it out, here (http://alice.wikia.com/wiki/Scripting), on the ALICE WIKI! Join today HINT HINT!

dubastot
03-10-2010, 10:10 PM
Oh! I thought you were using something called jython. I know python! Thanks zonedabone

King Gamer(gorit)
03-11-2010, 12:04 PM
It actualy is Jython but it is virtually the same as python because its only difrence is that it can use java modules.

Chuma
03-26-2010, 12:51 PM
This looks like it could possibly solve my problems, if I can just get it all to work.
The wiki article was very helpful thank you; I've managed to get that much to work after a series of peculiar bugs. But I can't find any more information about it anywhere, and this isn't quite enough. I now know how to change a variable using a script, and how to print things. But what about calling a method from within the script?
Typing world.methodname() gives an error. Without parenthesis it gives no error but also doesn't do anything.
________
Marijuana indica (http://strainindex.com)
________
DODGE POWER WAGON HISTORY (http://www.dodge-wiki.com/wiki/Dodge_Power_Wagon)

Niteshifter
03-26-2010, 02:21 PM
This looks like it could possibly solve my problems, if I can just get it all to work.
The wiki article was very helpful thank you; I've managed to get that much to work after a series of peculiar bugs. But I can't find any more information about it anywhere, and this isn't quite enough. I now know how to change a variable using a script, and how to print things. But what about calling a method from within the script?
Typing world.methodname() gives an error. Without parenthesis it gives no error but also doesn't do anything.

Click on "more details" and if it says things like "*starting world*", then scroll to the bottom and read that since it's the debugger and will tell you what's wrong.

Chuma
03-26-2010, 03:44 PM
I've looked at that as well, but it didn't make much sense to me. Let's see if it makes sense to you.

The script-defined method reads:

def scriptmethod():
world.othermethod()

The debugger info says:

Error during simulation.
Alice version: 2.2 8/01/2009
Throwable that caused the error:
Traceback (innermost last):
File "edu.cmu.cs.stage3.alice.core.property.ScriptProper ty[name=script,owner=edu.cmu.cs.stage3.alice.core.res ponse.ScriptResponse[world.my first method.__Unnamed1__]]", line 1, in ?
File "edu.cmu.cs.stage3.alice.core.property.ScriptProper ty[name=script,owner=edu.cmu.cs.stage3.alice.core.Wor ld[world]]", line 12, in scriptmethod
AttributeError: othermethod


There's also another small problem: About 90% of the time, when I try to start Alice, it resets the properties file, thus disabling scripting again. Also slightly annoying.
________
MAZDA MILLENIA (http://www.ford-wiki.com/wiki/Mazda_Millenia)
________
EXPERT INSURANCE (http://xpertinsurance.com/)

dragnet
03-27-2010, 01:02 AM
Awesome stuff, this is great information! I was looking for such an option. This is going to make Alice much more functional for me.

Any other backdoors we should know about?

Thanks.