Home   Help Search Login Register  

Author Topic: Artillery Strike with the Laser Designator  (Read 6206 times)

0 Members and 1 Guest are viewing this topic.

Offline bardosy

  • Honoured Contributor
  • ***
  • campaign designer
    • CartooDiv
Re: Artillery Strike with the Laser Designator
« Reply #15 on: 24 Apr 2007, 09:35:13 »
Maybe you didn't understand...(it's my fault)
setDir is set only the horizontal direction. But I want change the vertical direction.
Fix bayonet!

Offline RaymondLu

  • Members
  • *
Re: Artillery Strike with the Laser Designator
« Reply #16 on: 24 Apr 2007, 09:49:32 »
Maybe you didn't understand...(it's my fault)

how about these :

vectorDir
Description:
Return object's direction vector in world coordinates as [x, z, y].

Syntax

vectorDir obj
Parameters:
obj: Object
Return Value:
Array


vectorUp
Description:
Return object's up vector in world coordinates as [x, z, y].

Syntax:
vectorUp obj
Parameters:
obj: Object
Return Value:
Array


i've never tried , hope it works

Offline bardosy

  • Honoured Contributor
  • ***
  • campaign designer
    • CartooDiv
Re: Artillery Strike with the Laser Designator
« Reply #17 on: 24 Apr 2007, 09:56:46 »
I tried... Not work.

But it's not too important now, because I used Mandoble missile script.

It's just the curiosity... ;)
Fix bayonet!

Offline Novusordo

  • Members
  • *
Re: Artillery Strike with the Laser Designator
« Reply #18 on: 24 Apr 2007, 09:58:19 »
ofcoz it is.

the key is to get the the laser targeted�  object(position)

try this :

_postarget =position ( (position player nearObjects["LaserTarget",1000]) select 0)

1000 is the radius.

then u can have those arties fire on that position.

what??? where does that coding go???

Offline Mandoble

  • Former Staff
  • ****
    • Grunt ONE and MandoMissile suite
Re: Artillery Strike with the Laser Designator
« Reply #19 on: 24 Apr 2007, 15:44:05 »
Novusordo, what do you mean with that message? Aside of filling up the screen with already said contents ...  If you have a particular question, ask it, if not, please, help us to keep this, and any other thread, as clean of redundant info as possible.

Offline Captain Crunch

  • Members
  • *
Re: Artillery Strike with the Laser Designator
« Reply #20 on: 24 Apr 2007, 15:59:18 »
@RaymondLu

Hi there, like Novusordo, I still don't understand Your very first post in this thread. Your idea seems nice and simple but for example, I don't know where to put this code:
Code: [Select]
_postarget =position ( (position player nearObjects["LaserTarget",1000]) select 0). Or I don't  know if it is all I need to make the laser designator function. I doubt so. Could You please explain in a little more details for us? Thanx!
Back to the forest!

Offline Novusordo

  • Members
  • *
Re: Artillery Strike with the Laser Designator
« Reply #21 on: 24 Apr 2007, 16:17:22 »
@RaymondLu

Hi there, like Novusordo, I still don't understand Your very first post in this thread. Your idea seems nice and simple but for example, I don't know where to put this code:
Code: [Select]
_postarget =position ( (position player nearObjects["LaserTarget",1000]) select 0). Or I don't  know if it is all I need to make the laser designator function. I doubt so. Could You please explain in a little more details for us? Thanx!

x2

.....

Offline Mandoble

  • Former Staff
  • ****
    • Grunt ONE and MandoMissile suite
Re: Artillery Strike with the Laser Designator
« Reply #22 on: 24 Apr 2007, 16:27:43 »
The line step by step:
position player nearObjects["LaserTarget",1000]
that returns an array of objects of type "LaserTarget" closer than 1000m to the player's position ordered by distance. Of course, if no "LaserTarget" object is found, the returned array will be empty. But if one or more objects of that type were found, they will be placed in the returning array with the closest the first. So:

(position player nearObjects["LaserTarget",1000]) select 0
Selects the first item of the supposedly not empty returned array.

And as it is, in fact, an existing object, with:
position ( (position player nearObjects["LaserTarget",1000]) select 0)
you get the position of the lasertarget object closest to the player.

Now that code has a little problem, because if no lasertarget is present, the returned array of objects would be empty, so you cannot select index 0 from it, much less to get the position of a non-existant array element.

but all in all, with that line of code you get the position of a laser designator target, if any. Now, with that position you may do whatever you want to do. Note also that _postarget is a local variable, so it is suited to be placed inside a script.