ID:170815
![]() Dec 11 2004, 6:23 pm
|
|
Anyone know of a demo with enemy vision, like on METAL GEAR SOLID where each enemy has a radar, and when he moves it aims a different direction?
|
It seems to me what you're trying to accomplish could be done with a simple view(radar_range,src) and an approximate directional test. Here's one example:
proc/get_approx_dir(atom/ref,atom/target) That gives the enemy about a 45° field of view. For a full 90° field of view like in your diagram, it'd be a tad different: mob/proc/CanSee90(atom/target, rng=world.view) Hopefully that'll make some sense. Lummox JR |
Siientx wrote:
Thanks Lummoxy. ;) too bad i don't know how in god's name to put it into my game.. That part should be child's play. Taking either proc, just plug in something like this: if(enemy.CanSee90(src)) If you want to loop through all enemies in view, I have an alternative format to show you: atom/proc/fov90(atom/target) With the fov90() proc, you can simply have each enemy check to see if it can see you. for(var/mob/M in view(src)) Lummox JR |
Okay dokie, but where do i plug all of this IN? i can't just throw it into the game and hope it to work?
|
Could you be a bit more specific? I hate obscure little references to game that not everyone has played, so please try to be more general. Perhaps some screenshot linkage would help.