Home   Help Search Login Register  

Author Topic: Over Object (TESTING)  (Read 2155 times)

0 Members and 1 Guest are viewing this topic.

Offline Mr.Peanut

  • Former Staff
  • ****
  • urp!
Over Object (TESTING)
« on: 09 Jun 2007, 05:03:58 »
Pre-release of a function that can detect when you are over given object types. No documentation, just a demo. Fly over the city and watch the building tops light up as you fly over (must be <100m altitude). Try to fly over a car and make it light up too, if you don't crash first!

Next project will be a spinoff of this. Detecting LOS intersection with object types.
« Last Edit: 01 Oct 2007, 15:55:25 by LeeHunt »
urp!

Offline DucusSumus

  • Members
  • *
  • I'm a llama!
Re: Over Object
« Reply #1 on: 09 Jun 2007, 10:27:55 »
I noticed that you used the spawn command in there, which is one thing I am still clueless about.  What's the difference between spawn and execVM?

Offline Mandoble

  • Former Staff
  • ****
    • Grunt ONE and MandoMissile suite
Re: Over Object
« Reply #2 on: 09 Jun 2007, 11:43:48 »
spawn accepts raw code, not just scripts.

Offline Mr.Peanut

  • Former Staff
  • ****
  • urp!
Re: Over Object
« Reply #3 on: 09 Jun 2007, 20:29:05 »
Spawn also accepts scripts that you have first run through compile preProcessFile just like functions. And like functions you call them using the name you assigned, not the script file name. In my case I did not need to use it, but did so as an example of its use. The difference is execVM must preprocess and compile a script before running, so for scripts you are executing many times it is better to use spawn because it will slightly reduce the CPU overhead.

As far as what Mandoble said above, I guess the other usage would be that you could dynamically create a code string and run it as a script i.e. in parallel (not freezing the game engine). In OFP you could only do it with functions which for most cases (in ArmA) run serially i.e. freezing the game engine until function is complete.
« Last Edit: 09 Jun 2007, 20:33:26 by Mr.Peanut »
urp!