Alice Community  

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

Reply
 
Thread Tools Display Modes
"Resetting" a single object from a list
Old
thirdflare
Junior Member
 
Status: Offline
Posts: 5
Join Date: Jan 2012
Default "Resetting" a single object from a list - 01-18-2012, 09:35 PM

Right now, I have random dummies scattered around a map. What I want to do is make a single object from a list move to a random dummy (the object is selected when it's in between two posts - it's done using if/else statements). I can't figure out what to do, and I need help with this.

If you need to look at my game, it's in the link below.
The method is called "dealDamageTo".

http://www.mediafire.com/?u64c2kot3kbp457



Cheers.
   
Reply With Quote
Old
dakota95
Senior Member
 
dakota95's Avatar
 
Status: Offline
Posts: 426
Join Date: Aug 2011
Location: like I would tell you. ;)
Default 01-18-2012, 10:51 PM

the way to make it totally random would be to use functions. But you could get something similar(although not random) by saying, if (object you want to reset) is within "x meters" of (anything you want to use) then move to dummy 'x'. Else if (object you want to reset) is within "x meters" of another object, move to dummy 'y'


<Insert_Signature_Here>
   
Reply With Quote
Old
thirdflare
Junior Member
 
Status: Offline
Posts: 5
Join Date: Jan 2012
Default 01-19-2012, 07:31 PM

Thanks for your input, but this doesn't entirely help. To be more specific, whenever I shoot a hostile, I want the object to move back to any designated dummy set on the map. The object is selected when it's in between two posts, and those objects are grouped together in a list to get the "shoot" method to work. Whenever I shoot a hostile (with the code that I have), the game crashes. I'm not sure how to go around this.

Last edited by thirdflare; 01-19-2012 at 07:33 PM. Reason: More detail
   
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.