Home   Help Search Login Register  

Author Topic: how to create a missil that flies towards a object?  (Read 1572 times)

0 Members and 2 Guests are viewing this topic.

Offline granQ

  • Contributing Member
  • **
    • Anrop.se
how to create a missil that flies towards a object?
« on: 25 Feb 2003, 17:50:39 »
Was thinking of using the new laser script for detecting where the player aims on. Then instead of create some bombs over the postion to simulate artilleri i want to create a missile that flies towards the object form like 2km.. so the player have to work with keeping the target in the sight, and since it probaly will be a moving target it can be a bit harder.. not sure about the actually mission design yet. I know there was this "scud goes to postion" but haven't looked on it, and since the missile from a chopper and other stuff can lock i wonder if i can create the missile and make it lock on the postion.. or any other way to solve it?
Cura Posterior

Offline Blanco

  • Former Staff
  • ****
Re:how to create a missil that flies towards a object?
« Reply #1 on: 25 Feb 2003, 21:19:18 »
dunno, if it's realistic , but I like the idea... ;D
Search or search or search before you ask.

Offline granQ

  • Contributing Member
  • **
    • Anrop.se
Re:how to create a missil that flies towards a object?
« Reply #2 on: 25 Feb 2003, 23:14:33 »
a tomahawk is pretty realistic.. thats what i want to create..
Cura Posterior

Offline MI_Fred

  • Members
  • *
  • AA
    • OFP Team Finlanders
Re:how to create a missil that flies towards a object?
« Reply #3 on: 26 Feb 2003, 06:26:15 »
Well, I don't deem this impossible, but all I got is the beginning for sure. well atleast kinda:  ;D

_rocket = "laserguidedbomb" camCreate [(getPos _target select 0) -2000  * (sin(getDir _target)),(getPos _obj select 1) - 2000 * (cos(getDir _target),(getPos _target select 2) + 10]

_rocket setVelocity [300*(sin(getDir _target)),300*(cos(getDir _target)),50]

Theoretically that could be a start heh. The LGB would be the only realistic "missile" sadly, as it'll tip over and such when dropped. Nothing new there but what follows that creation would be the corrections to its flight path. All relative to the _target. You should be able to control it well enough with setVelocity.
Apply that velocity again in a slowish loop, with the [(300 *(sin(getDir _target)) ... it might just work setting it's new heading again. When (_rocket distance _target) < 50 move to a faster loop so it really works harder to hitting it.
Add a smoke trace script for some realism...
And you'll need a loop to check the target, hmm that will be harder but very possible.

* MI_Fred shrugs

I'll give that a go later.
« Last Edit: 26 Feb 2003, 06:34:19 by MI_Fred »
There's gooks over there, there's mines over there, and watch out those goddamn monkeys talk, I'll bite ya.

Offline granQ

  • Contributing Member
  • **
    • Anrop.se
Re:how to create a missil that flies towards a object?
« Reply #4 on: 26 Feb 2003, 18:13:16 »
think thats all i need, for the smoke i don't think so, not sure but think they just make a glide path thing when they on the end. but i think i will use a hellfire missile if thats possible (why not?).. looks more true.. perhaps the explosive will be low.. for a toma.. but it is just a game right? ;)
Cura Posterior

Offline MI_Fred

  • Members
  • *
  • AA
    • OFP Team Finlanders
Re:how to create a missil that flies towards a object?
« Reply #5 on: 26 Feb 2003, 20:57:38 »
Yesh, here's what I use for the smoke:
Quote
_rocket = _this select 0

#trail
_pos = getPos _rocket
_rz = getPos _rocket select 2
drop ["cl_basic", "", "Billboard", 0.2, 2, _pos, [0,0,0], 0, 1.230, 1, 1, [0.1,0.5,1], [[0.5,0.5,0.5,0.1], [0.8,0.8,0.8,0.4], [1,1,1,0.2], [1,1,1,0.01]], [0,0], 0, 0, "", "",""]
? _rz < 0.1 : exit
~0.001
goto "trail"
exit
exec it when you create the "missile". Pretty much as little delay as possible w/o lag, possibly not. You may also wan't to add to the size ( [0.1,0.5,1] ) grows from 0.1 diameter to .5 to 1 meter before fading if you don't know  ;)

Yeah, all bombs will prolly be a bitch at the end to control. But, when you run that final loop, use a ? (getPos _rocket select 2) < 5 : _blast = "laserguidedbomb" camCreate getPos _rocket
and you have yourself all the kablee-yi you need  ;D
OR you could fit that stuff into the loop... or it to that...
« Last Edit: 26 Feb 2003, 21:00:00 by MI_Fred »
There's gooks over there, there's mines over there, and watch out those goddamn monkeys talk, I'll bite ya.

GeneralCoder

  • Guest
Re:how to create a missil that flies towards a object?
« Reply #6 on: 27 Feb 2003, 14:25:08 »
Hi this thread inspired me to make a samsite what I have planned a long time.  ;)

So far I have missile wich flies toward chopter and hits.. but theres still the realism part.
So first what projectile should I use? I have tryed maverick,hellfire and laserguidedbomb but they all seem to have mind of their own! I mean they rotate randomly to directions and after certain time periord they explode! (setting missiles velocity seems to effect its angle)

So does the game have any absolutely static missile wich I could use?

I gues u cant rotate objects in ofp just set their direction, but its ok for me becose u cant see their wierd angle in such a high speed, can u?

btw im using createcam to create missile.

Offline MI_Fred

  • Members
  • *
  • AA
    • OFP Team Finlanders
Re:how to create a missil that flies towards a object?
« Reply #7 on: 27 Feb 2003, 17:15:23 »
 ::) You mean camCreate. And yes that's the only way unfortunately. And there are only the few missiles that can be created and to which velocity affects. And yes they will be a beauty spot anywhere when created and flung with setVelocity. It will when applied, apply the gravitational setting again and make it "reset" its heading etc unrealistic stuff. Altho it great you can follow these created missiles with the cam, not so fun when they do the above.  :-\

I'm not sure you can setDir a projectile. Object u can, but u can't setVelocity an object.
There's gooks over there, there's mines over there, and watch out those goddamn monkeys talk, I'll bite ya.

Offline LCD

  • Former Staff
  • ****
    • Everon Cartel
Re:how to create a missil that flies towards a object?
« Reply #8 on: 27 Feb 2003, 19:01:52 »
dont u ppl ever look @ da editors depot ? y we have it ?

dere is kool script by sefe dat do dat things exactly ;D

LCD OUT
"guess being the community has downsides .." - cheetah
Help Perfecting Da Next Best Thing - O-Team Beta

GeneralCoder

  • Guest
Re:how to create a missil that flies towards a object?
« Reply #9 on: 27 Feb 2003, 20:57:09 »
dont u ppl ever look @ da editors depot ? y we have it ?

dere is kool script by sefe dat do dat things exactly ;D

LCD OUT

Seems to be, but I dont think thats the best missile u can create. So on whit the samsite..

Offline MI_Fred

  • Members
  • *
  • AA
    • OFP Team Finlanders
Re:how to create a missil that flies towards a object?
« Reply #10 on: 27 Feb 2003, 21:12:00 »
Why not to resort to already existing material:
a) It might be obsolete
b) you might not learn anything yourself
c) you might learn to create new material doing it yourself
d) you might come up with a better version

Here's something if you decide to camCreate the plane (and throw in a pilot + wp) to simulate an actual fly by. CamCreate the projectile a few meters below the plane and setVelocity:

_rocket setVelocity [(speed plane/10)*(sin(getDir plane)),(speed plane/10)*(cos(getDir plane)),0]

and it will look very convincing  ::) You might also wanna set the planes combatmode to blue, and delete it when it's about 700 meters from the target, just so that it won't be left doing nothing there. And that would be easy to repeat.

There's gooks over there, there's mines over there, and watch out those goddamn monkeys talk, I'll bite ya.

GeneralCoder

  • Guest
Re:how to create a missil that flies towards a object?
« Reply #11 on: 28 Feb 2003, 13:43:21 »
Why not to resort to already existing material:
a) It might be obsolete
b) you might not learn anything yourself
c) you might learn to create new material doing it yourself
d) you might come up with a better version

Here's something if you decide to camCreate the plane (and throw in a pilot + wp) to simulate an actual fly by. CamCreate the projectile a few meters below the plane and setVelocity:

_rocket setVelocity [(speed plane/10)*(sin(getDir plane)),(speed plane/10)*(cos(getDir plane)),0]

and it will look very convincing  ::) You might also wanna set the planes combatmode to blue, and delete it when it's about 700 meters from the target, just so that it won't be left doing nothing there. And that would be easy to repeat.



Well I got the missile launcher ready now, it fires a missile and it flies towards target vehicle and PUM! Works good but Im butting this project to halt now becose the missile looks so dump.  :-\  Only if u could rotate things in ofp.. and static missile would be apreciated....

Offline granQ

  • Contributing Member
  • **
    • Anrop.se
Re:how to create a missil that flies towards a object?
« Reply #12 on: 01 Mar 2003, 16:35:07 »
make one?

not so hard if you got some skills (me don't) but give me some photo's and stuff and i will tell my boys to do one for you ;)
Cura Posterior

GeneralCoder

  • Guest
Re:how to create a missil that flies towards a object?
« Reply #13 on: 02 Mar 2003, 16:43:56 »
make one?

not so hard if you got some skills (me don't) but give me some photo's and stuff and i will tell my boys to do one for you ;)


Sorry dont have the skills either.  But photos for the boys?  :) I dont what kind of photos I would give, the missile can be just plain white pipe whit usual sharp edge and cross in the tail.  But im not sure do I have time for this right now... ::)