Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

3 Dimensional Chat / Restricting enemys

Author
Message
Eternal Darkness
21
Years of Service
User Offline
Joined: 12th Oct 2003
Location: Area 51
Posted: 19th Oct 2003 14:28
Hi,

is there a way i can set the bad guys in my game to only fight within a certain area.

If u have any idea please let me know
Dreamora
22
Years of Service
User Offline
Joined: 20th Sep 2002
Location: Switzerland
Posted: 20th Oct 2003 01:58
yeah programm the game that way that the bad guys know where to fight

Dell Inspiron 8200,P4-M 1,7ghz, GF4 440go (45.23 - DX9b), 512mb RAM
Black Hydra
21
Years of Service
User Offline
Joined: 2nd Oct 2003
Location:
Posted: 20th Oct 2003 06:45 Edited at: 20th Oct 2003 06:45
Make a command so that the if the enemies coordinates are higher or less than certain amounts that they will resume a programed patrol path.

Like
IF Object Position Y > 200 and Object Position X....

Another way is to have a hidden object that will be the "fence post" for the object if you want to make sure they don't go past a certain distance from it then whenever they move
(I have a GetDistance(obj1, obj2) function I will list it at the bottom)
a certain amount away from that post they will move back towards the post and resume a patrol path.


FUNCTION GetDistance(ObjNm1, ObjNm2)
x1# = Object Position x(ObjNm1)
x2# = Object Position x(ObjNm2)
y1# = Object Position y(ObjNm1)
y2# = Object Position y(ObjNm2)
distance# = sqrt(((x1#-x2#)*(x1#-x2#))+((y1#-y2#)*(y1#-y2#)))
ENDFUNCTION distance#
`Use to retrieve a float value that gives the distance between two objects

Login to post a reply

Server time is: 2025-06-27 10:41:39
Your offset time is: 2025-06-27 10:41:39