Home   Help Search Login Register  

Author Topic: IR/Laser Guided  (Read 1609 times)

0 Members and 1 Guest are viewing this topic.

Offline Luke

  • Members
  • *
  • Thank God! The OFPEC Staff are here!
IR/Laser Guided
« on: 02 Dec 2008, 06:06:43 »
How does someone script a laser/unit-detecting object?

i.e. given a shell and seeker size, object finds a target within seeker,
tracks the target, collides with target and,

KA-BOOM!

So can anyone help me do that?

Luke
Pesky Human!!
Wort Wort Wort.

Offline Tyger

  • Former Staff
  • ****
  • I was at OFPEC when it still had dirt floors...
    • OFPEC
Re: IR/Laser Guided
« Reply #1 on: 03 Dec 2008, 02:13:22 »
Sounds like you're looking for something along the lines of Mandoble's MandoMissles.
"People sleep soundly at night only because rough men stand ready to do violence on their behalf." - George Orwell

MSG Mike Everret - We Will Never Forget - '75-'08

Offline Luke

  • Members
  • *
  • Thank God! The OFPEC Staff are here!
Re: IR/Laser Guided
« Reply #2 on: 03 Dec 2008, 05:49:50 »
Yes, but with nothing against Mando,

I am tired of being a sub-level to others work.  >:(

The entire purpose of this is to make something of my own,
something I can be proud of,
something I can show a friend, turn to him, and say,
"Ya know, I made that."

But I cannot do it alone.

Enough lamenting,

does anyone know how to do such a thing?

Luke

EDIT:I would prefer consultants, not others project.
« Last Edit: 03 Dec 2008, 05:54:04 by Luke »
Pesky Human!!
Wort Wort Wort.

Offline Tyger

  • Former Staff
  • ****
  • I was at OFPEC when it still had dirt floors...
    • OFPEC
Re: IR/Laser Guided
« Reply #3 on: 03 Dec 2008, 07:22:28 »
;) That was a form of consulting.

I suggest that first you first take a look at Mandoble's scripts to get an idea of what needs to happen in order to guide an object onto a target. I believe that the basics work something like this though. The script finds angle and direction of the "missile" in relation to the "target" and ground level. It then calculates a velocity based upon these variables. Then you loop through this rapidly each second readjusting the velocity to hit the target.

The other method is as above, but using setPos with very, very small distance increments. This can give the effect of stuttering though, if the object is moving too much distance.
"People sleep soundly at night only because rough men stand ready to do violence on their behalf." - George Orwell

MSG Mike Everret - We Will Never Forget - '75-'08

Offline Luke

  • Members
  • *
  • Thank God! The OFPEC Staff are here!
Re: IR/Laser Guided
« Reply #4 on: 08 Dec 2008, 22:12:21 »
Sorry about that, just venting  :P

I've looked and I believe that it just targets a pre-defined logic.

What I am looking for is a way to detect units rather than focus on a predefined unit.

Anyone with trigger experience and who is willing to help would be great.

Luke
Pesky Human!!
Wort Wort Wort.

Offline Tyger

  • Former Staff
  • ****
  • I was at OFPEC when it still had dirt floors...
    • OFPEC
Re: IR/Laser Guided
« Reply #5 on: 09 Dec 2008, 05:11:16 »
Well, I understand that you want to detect a unit close to a shell fly in the air, inside a given area.

You will want to detect a unit within a seeker area.

So:
Code: [Select]
_unit = nearestObject [_shell, "Man"]
This will detect the unit nearest the shell who is type man (any walking unit). If you are looking for a unit inside a specified area, change _shell to the name of the trigger, or change the class type to something other than man.

Then, using setPos or another method, you can steer the shell into the target because you know the direction and distance to the target. For instance:
Code: [Select]
_unit = _this select 0;
_unitPos = getPos _unit;
_shell = _this select 1;
_shellPos = getPos _shell;

// Find the direction to a detected unit
_dir = (_unitPos select 0 - _shellPos select 0) atan2 (_unitPos select 1 - _shellPos select 1);
_shell setDir _dir;

_distance = sqrt((_unitPos select 0 - _shellPos select 0)^2 + (_unitPos select 1 - _shellPos select 1)^2);
// Make a step every 50 meters
_steps = _distance / 50;
// At this point, guide the shell in on the target using the above information

I hope that gives you some help. If you are looking for something more/else, just say the word.
"People sleep soundly at night only because rough men stand ready to do violence on their behalf." - George Orwell

MSG Mike Everret - We Will Never Forget - '75-'08

Offline Luke

  • Members
  • *
  • Thank God! The OFPEC Staff are here!
Re: IR/Laser Guided
« Reply #6 on: 09 Dec 2008, 22:00:44 »
I have a point where I can guarantee with no IR/Laser tracking that the shell will hit.

For a strix shell, (terminally guided, IR guided shell)
What I am trying to do is find the nearest vehicle to this hitpos with the engine running.

Then track that vehicle.

For laser doing the same thing, but I need a better way to grab and organize the laser points.

As it stands, It scans looks for the nearest laser point and follows that. 
I should update the impact point continuously in case the laser stops um... lazing.

So really what I am asking for is a refined way of tracking and sorting vehicles and laser targets,
and continuously guiding it (not stepping).

Not with my files now, so watch for an edit with them in this post.

Luke

EDIT: Here they are.
« Last Edit: 11 Dec 2008, 06:12:31 by Luke »
Pesky Human!!
Wort Wort Wort.