[ACS] Basic Rectangular Radar

Requests go in THIS forum!
Forum rules
The Projects forums are only for projects. If you are asking questions about a project, either find that project's thread, or start a thread in the General section instead.

Got a cool project idea but nothing else? Put it in the project ideas thread instead!

Projects for any Doom-based engine (especially 3DGE) are perfectly acceptable here too.

Please read the full rules for more details.
Post Reply
User avatar
SamVision
Posts: 2425
Joined: Tue Apr 13, 2010 4:47 pm
Location: Behind You

[ACS] Basic Rectangular Radar

Post by SamVision »

Basically I need an enemy radar that is rectangular in shape. I'm having some trouble figuring out where to start with this.
User avatar
Arctangent
Posts: 1235
Joined: Thu Nov 06, 2014 1:53 pm
Contact:

Re: [ACS] Basic Rectangular Radar

Post by Arctangent »

Well, I see two ways of going about this:
  1. Give literally every enemy ( except those that never appear on the radar, I suppose ) a unique TID, and keep track of the highest TID placed on an enemy so that you can use a for loop to iterate through all of them and get their location.
  2. Store stuff like x position, y position, etc. in an array, then make every enemy execute a looping script that assigns them an index in those arrays so you can constantly update those arrays with the values from the actor.
Once you do that, it's mostly just a matter of making sure the location data you're getting is within a bounding box centered around the player ( though you're going to have to deal with some trig if you want the radar to rotate with the player ) and if so, translating the positional offset from the player into a graphical coordinate to use with HudMessage.

That all said, this is obviously some pretty heavy stuff to do with "enemies" meaning "monsters," especially when the monster total climbs up. I've had success with the second method when it comes to making a radar that only works with players, but I'm not sure if ACS is gonna be anywhere near as efficient enough for your purposes.
Post Reply

Return to “Requests”