Home   Help Search Login Register  

Author Topic: Intersect command?  (Read 1569 times)

0 Members and 1 Guest are viewing this topic.

Offline dmakatra

  • Members
  • *
  • Better known as Armsty
Intersect command?
« on: 07 Jul 2007, 00:36:21 »
So, got Arma the other week but was delayed by a computer crash and a Hammond Organ (don't ask). I had another looksee at the new commands and ran into something quite interesting that I had misstaken for something that was only useful to addon makers before. However, I'm not quite sure so I'm requesting that someone could please explain the intersect command a little more in-depth. The way I understand it you can actually detect if someone is watching something else, which would be really cool. Problem is I have no idea how it works because I'm not an addon maker and I hardly know what a selection or a lod is.

If someone would write a quick crash-course to the intersect command I'd be really happy. I have two healthy kidneys and you never know with what you can come down with these days, so you'll be doing yourself a favour as well! Hurray! :)

Cheers. (We seriously need to bring back that smiley)
/Armsty

Offline Mandoble

  • Former Staff
  • ****
    • Grunt ONE and MandoMissile suite
Re: Intersect command?
« Reply #1 on: 07 Jul 2007, 00:48:14 »
http://www.ofpec.com/forum/index.php?topic=29174.0

http://www.ofpec.com/forum/index.php?topic=29643.0 (<- check attached file here)

Basically, you create a rect and check where does it intersect a LOD of the indicated unit. If the rect intersets the LOD, the command returns an array of the named selections "touched" by that rect. The "tricky" point is that the rect is spatial, you need to provide altitudes above ground level to the command, but need to calculate them carefully. Just an example, you are over a mountain, in front of you there is a valley. You are looking straight forward so you want to create a rect with two points, your currect position and a position ahead of you 100m away. Your currect altitude is 0 but the altitude above ground 100m away in front of you may be 100 (it is a valley). If you set 0 to the altitude of initial and final points, what you get is a rect that goes from you to the bottom of the valley. So be careful with that.

Offline LCD

  • Former Staff
  • ****
    • Everon Cartel
Re: Intersect command?
« Reply #2 on: 07 Jul 2007, 00:59:08 »
@ mandoble : da thing is even stranger dan dat  :confused: i use both ur script in ma mision... and in da 1st it doesnt detect if da unit is crouched or stanin (it gives me -1 4 crouchin and 1 4 standin)

.... in da second script i had 2 deduct 22 meters 2 make da detection work right w/ da target's fire LOD... but da unit itself was standin in da top floor of a hotel type building... cant explain dat (even tho i have a theory  :D)

@ Armsty

whats da tingy w/ da organ ?

u got ArmA ? nd i still havnt seen u in da beta board ?  :blink:  :o

well have 2 talk about dat :P ;)

btw

WELCOME 2 ArmA OFPEC

 :D :cheers:  :D

i also need dat smilie back :D

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

Offline dmakatra

  • Members
  • *
  • Better known as Armsty
Re: Intersect command?
« Reply #3 on: 07 Jul 2007, 01:10:37 »
Mandoble:
Cheers mate, appreciate it. I'm going to experiment a bit with it tonight. If I run into any problems I'll leave a message to your secretary. :)

LCD:
The organ was... in the way. Physically. And I haven't visisted the beta board 'cause I haven't even finished the official campaign yet. I have discovered that ArmA is the weirdest game ever though. I'm plauged by FPS drops and the only way I can get rid of it is by going into the difficulty settings every ten minutes. :blink:

Offline Mandoble

  • Former Staff
  • ****
    • Grunt ONE and MandoMissile suite
Re: Intersect command?
« Reply #4 on: 07 Jul 2007, 01:21:53 »
LCD, building roofs return wrong altitudes, that's the problem there.

Offline LCD

  • Former Staff
  • ****
    • Everon Cartel
Re: Intersect command?
« Reply #5 on: 07 Jul 2007, 01:25:29 »
da roof returned 0 (tested it) nd dat i can understand... nd i was standin on da top of a mountain... but why deduct ? if i had 2 add da altitude of da building i cud understand dat

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