The Daily Click ::. Forums ::. Klik Coding Help ::. Random Movement of an object (NPC) within an area in a frame?
 

Post Reply  Post Oekaki 
 

Posted By Message

Harvest Sun O_O

Sin Binned (Broke The Rules)

Registered
  30/12/2004
Points
  -16
15th March, 2005 at 11:16:06 -

I'm creating an RPG and I need to have some NPCs randomly walk around within a small area e.g. by their house. Also, how can i make them walk, then stop for a time, then walk, tehn stop etc.

Thanks for the help.

 
zip/

Destroyer (CrobaSoft)



Registered
  10/10/2004
Points
  1106
15th March, 2005 at 11:53:46 -

just make some invisible detectors around the house and make them bounce if they collide with it.
to make them stop just do something like every 3 second stop.
every second start

 
Visit www.crobasoft.com or you're a Noob.

axel

Crazy?

Registered
  05/02/2005
Points
  4766

Game of the Week WinnerYou've Been Circy'd!
15th March, 2005 at 13:47:18 -

EZ!
-----------------------------
Every [??:??]
-toggle flag 0

Flag 0 is on
-stop

Flag 0 is off
-Stop
-----------------------------
as for them to move around randomly:

Every [??:??]
Set direction to [select all directions]


 
n/a

Harvest Sun O_O

Sin Binned (Broke The Rules)

Registered
  30/12/2004
Points
  -16
16th March, 2005 at 21:51:04 -

Thanks guys.

 
zip/

SculptureOfSoul



Registered
  14/03/2005
Points
  52
23rd March, 2005 at 03:14:43 -

Harvest, don't worry about this. I'm going to be creating a very easy method of doing this within the tile engine world builder.

 
Current Project: Undertaking the design of my mammoth RPG. Utilizing all of the knowledge gained while coding the now defunct "Shadow Reign".

AndyUK

Mascot Maniac

Registered
  01/08/2002
Points
  14560

Game of the Week WinnerSecond GOTW AwardHas Donated, Thank You!VIP Member
23rd March, 2005 at 09:53:46 -

I made one where it randomly sets their A value to either

1 for upward (y-1)
2 downward (y+1)
3 left (x-1)
4 right (x+1)

every seconds or two seconds

and if they were overlapping an obstacle

overlapping + a = 1 then (y+1)
overlapping + a = 2 then (y-1)
overlapping + a = 3 then (x+1)
overlapping + a = 4 then (x-1)

which would cancel out any movement when they were overlapping

 
.
   

Post Reply



 



Advertisement

Worth A Click