Alice Community  

Go Back   Alice Community > Alice 2 > How do I...?

Reply
 
Thread Tools Display Modes
Text-based Alice?
Old
Chuma
Junior Member
 
Status: Offline
Posts: 4
Join Date: Mar 2010
Default Text-based Alice? - 03-03-2010, 12: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
________
Videos Pornos

Last edited by Chuma; 05-11-2011 at 07:46 PM.
   
Reply With Quote
Old
dubastot
Senior Member
 
dubastot's Avatar
 
Status: Offline
Posts: 661
Join Date: Apr 2009
Location: Two Steps From Hell
Default 03-09-2010, 08: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.
   
Reply With Quote
Old
dubastot
Senior Member
 
dubastot's Avatar
 
Status: Offline
Posts: 661
Join Date: Apr 2009
Location: Two Steps From Hell
Default 03-09-2010, 08: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.
   
Reply With Quote
Old
zonedabone
Senior Member
 
zonedabone's Avatar
 
Status: Offline
Posts: 577
Join Date: Nov 2008
Location: In the interwebs
Default 03-10-2010, 06:41 PM

It's called python. I wrote an article about it. Check it out, here, on the ALICE WIKI! Join today HINT HINT!


'Apple Macintosh' - An anagram of 'Complaints Heap'

M.A.C.I.N.T.O.S.H. - Machine Always Crashes, If Not, The Operating System Hangs.

You're *such* a mac person.
   
Reply With Quote
Old
dubastot
Senior Member
 
dubastot's Avatar
 
Status: Offline
Posts: 661
Join Date: Apr 2009
Location: Two Steps From Hell
Default 03-10-2010, 09:10 PM

Oh! I thought you were using something called jython. I know python! Thanks zonedabone
   
Reply With Quote
Well
Old
King Gamer(gorit)
Guest
 
Status:
Posts: n/a
Default Well - 03-11-2010, 11:04 AM

It actualy is Jython but it is virtually the same as python because its only difrence is that it can use java modules.
   
Reply With Quote
Old
Chuma
Junior Member
 
Status: Offline
Posts: 4
Join Date: Mar 2010
Default 03-26-2010, 11:51 AM

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
________
DODGE POWER WAGON HISTORY

Last edited by Chuma; 05-11-2011 at 07:46 PM.
   
Reply With Quote
Old
Niteshifter
Guest
 
Status:
Posts: n/a
Default 03-26-2010, 01:21 PM

Quote:
Originally Posted by Chuma View Post
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.
   
Reply With Quote
Old
Chuma
Junior Member
 
Status: Offline
Posts: 4
Join Date: Mar 2010
Default 03-26-2010, 02: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.ScriptPrope rty[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.ScriptPrope rty[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
________
EXPERT INSURANCE

Last edited by Chuma; 05-11-2011 at 07:47 PM.
   
Reply With Quote
Old
dragnet
Member
 
Status: Offline
Posts: 38
Join Date: Jan 2010
Default 03-27-2010, 12: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.
   
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



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