Alice Community  

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

Reply
 
Thread Tools Display Modes
Proximity & Function's help
Old
Coltrev
Guest
 
Status:
Posts: n/a
Default Proximity & Function's help - 09-17-2009, 04:46 PM

I am a high school student and I'm creating a FPS for the class, and I want to know how to have enemy characters begin following you after reaching their general threshold. additionally, my character is moved by the arrow keys and the camera is set to follow him if that matters in any way.
   
Reply With Quote
Proximity Function for follow/attack
Old
NivekNamttid
Guest
 
Status:
Posts: n/a
Lightbulb Proximity Function for follow/attack - 09-22-2009, 09:34 PM

Create a new method under World, and name it something like If enemy follows. THen, at the bottom of the screen, there are little tabs. Click and drag the loop one (light blue) onto your If enemy follows method. THen, drag a green If/Else tab into the loop. Set the true/false to true. Make the loop repeat infinity times. (Note: if that doesn't work or causes an error, try a recursive call at the end{put the same method you are working on into that method}). THen, take the "If character is <threshold> from <object>" function from the side menu and drop it onto the true part of the If/Else thing. Select a suitable distance (5 or 10 meters, depending on the size ratio of your game) and select "from: Enemy". Then, in the 'then' blank that says do nothing, put in an animation and attack program for that particular enemy. Copy it and change the Enemy to Enemy 2 or something like that for every reference and put it in the blank 'else' box in the first one. Repeat as neccesary.
   
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 ©2023, Carnegie Mellon University
Alice 2.x © 1999-2012, Alice 3.x © 2008-2012, Carnegie Mellon University. All rights reserved.