Alice Community  

Go Back   Alice Community > General Discussion > The Lounge

Reply
 
Thread Tools Display Modes
Old
arty-fishL
Senior Member
 
arty-fishL's Avatar
 
Status: Offline
Posts: 1,878
Join Date: Mar 2008
Location: In the corner of your eye
Default 05-11-2012, 01:11 PM

Have a world level object variable set to the master spawner.
In the spawner object have a method that checks if the world level variable is not equal to the spawner before doing whatever is required of it.
When the object is cloned the world level variable will stay the same, but it will automatically change the if clause to check if it is not equal to the cloned object.

Does that make sense? Its hard to describe.

EDIT - here's some code that might (or might not) better describe it:
Code:
object world.master = spawnerObj

method spawnerObj.doStuff (){
    if ( world.master != spawnerObj ) {
        // do stuff here
    }
}

object clone = getCloneOf( spawnerObj )
and then the automatically created method upon the cloned object would be:
Code:
method clone.doStuff (){
    if ( world.master != clone ) {
        // do stuff here
    }
}


█░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░█
█░░▓░░░░░░░▓░░░░░░░░░░░▓▓░░▓░░░░░░▓░░░▓░░░░█
█░▓░▓░▓▓▓░▓▓▓░▓░▓░░░░░░▓▒▒░░▒░░▓▓░▓▓▓░▓▒░░░█
█░▓▓▓▒▓▒▒▒░▓▒▒▓▓▓▒▓▓▓░▓▓▓░░▓░░░▓▒▒▓▒▓▒▓▒░░░█
█░▓▒▓▒▓▒░░░▓▓░░▒▓▒░▒▒▒░▓▒▒░▓▓░▓▓▒░▓▒▓▒▓▒░░░█
█░▓▒▓▒░▒░░░░▒▒▓▓▓▒░░░░▓▓▒░░░▒▒░▒▒░░▒░▒▓▓▓░░█
█░░▒░▒░░░░░░░░░▒▒▒░░░░░▒▒░░░░░░░░░░░░░░▒▒▒░█
█░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░█

I have mostly moved on from Alice, but may still respond to messages if important [-]

Last edited by arty-fishL; 05-11-2012 at 01:26 PM.
   
Reply With Quote
Old
atrane365
Guest
 
Status:
Posts: n/a
Default 05-14-2012, 10:38 AM

so, make a world level if/else, where the function checks if the object is spawned or not, and have it do the method only if it is spawned?

Last edited by atrane365; 05-14-2012 at 10:42 AM. Reason: grammar
   
Reply With Quote
Old
atrane365
Guest
 
Status:
Posts: n/a
Default 05-14-2012, 10:45 AM

Also, where do you get the 'script' and 'increment' code that is present in your code??

Last edited by atrane365; 05-16-2012 at 11:10 AM.
   
Reply With Quote
Reply

Tags
clone, copy, creation, object, runtime

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.