Alice Community  

Go Back   Alice Community > Alice 3 > How Do I?

Reply
 
Thread Tools Display Modes
"New" keyword in Alice
Old
mcgski
Junior Member
 
Status: Offline
Posts: 5
Join Date: Jul 2011
Location: Forest Hill
Default "New" keyword in Alice - 12-09-2011, 09:23 PM

Is there such a thing?

For example, if I want to instantiate a penguin class to I have to explicitly show it in my scene or is there a way to do it programatically throughout the execution of the code?
   
Reply With Quote
Old
David B
Senior Member
 
David B's Avatar
 
Status: Offline
Posts: 1,143
Join Date: Dec 2010
Location: The Twilight Zone!
Default 12-09-2011, 10:14 PM

I am having a hard time understanding what you are asking for.


██████████████████████
█░░░░░░░░░░░░░░░░░░░░█
█░▓▓▓▓░░░▓░▓░▓░░▓▓▓▓░█
█░▓░░░▓░░▓░▓░▓░░▓░░░░█
█░▓▓▓▓░░░▓░▓░▓░░▓▓▓░░█
█░▓░░░░░░▓░▓░▓░░▓░░░░█
█░▓░░░░░░░▓░▓░░░▓░░░░█
█░░░░░░░░░░░░░░░░░░░░█
██████████████████████

________________

Alice Hater? Rant Here!: http://tinyurl.com/HateAlice
   
Reply With Quote
Old
mcgski
Junior Member
 
Status: Offline
Posts: 5
Join Date: Jul 2011
Location: Forest Hill
Default 12-11-2011, 10:08 AM

I could not figure out a way to instantiate a class object in code per se. For example, if I want to fill a scene with penguins by instantiating them in code and filling an array with these objects, the only way I can see to do this is by adding the penguin to the scene first, then using the object instance.

pseudo code:

class penguin;

array penguins;

penguins [0] = new penguin;
penguins [1] = new penguin;
   
Reply With Quote
Old
legolizard
Senior Member
 
legolizard's Avatar
 
Status: Offline
Posts: 242
Join Date: Jan 2011
Location: Aboard the Hyperion escaping the zerg.
Default 12-11-2011, 04:17 PM

You must instatiate all objects[within the world] before using them in code.


"Two things are infinite: the universe and human stupidity; and I'm not sure about the the universe."-Albert Einstein
   
Reply With Quote
Old
TauTrumpsPi
Senior Member
 
TauTrumpsPi's Avatar
 
Status: Offline
Posts: 399
Join Date: Mar 2011
Location: The diamond layer
Default 12-11-2011, 05:31 PM

Actually, there is no inborn way to do it with Alice, but Arty figured out a way a while ago to breed them in the world, see here: http://alice.org/community/showthread.php?t=6831


--------------------------------------------------------------------------------------------------------------------------
I have plenty of common sense. I just choose to ignore it.
-Calvin and Hobbes

Wondering about my Avatar?
http://en.wikipedia.org/wiki/Tardigrade

Wondering about my username?
http://www.youtube.com/watch?v=jG7vhMMXagQ
   
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 ©2017, Carnegie Mellon University
Alice 2.x 1999-2012, Alice 3.x 2008-2012, Carnegie Mellon University. All rights reserved.