Home   Help Search Login Register  

Author Topic: TREES AND BUILDINGS  (Read 848 times)

0 Members and 1 Guest are viewing this topic.

Offline SilentHunter

  • Members
  • *
  • frozen leg'o'lamb (every gamers most loved weapon)
TREES AND BUILDINGS
« on: 19 Mar 2005, 23:04:08 »
How do u make a trigger return a list of everything in its radius, even trees and buildings
[size=4.5]NERDS HAVE FEELINGS TOO! [/size] [size=2.5]*adjusts glasses*[/size]

Offline h-

  • OFPEC Site
  • Administrator
  • *****
  • Formerly HateR_Kint
    • OFPEC
Re:TREES AND BUILDINGS
« Reply #1 on: 20 Mar 2005, 09:53:17 »
I think you can't...

The objects placed on the map in some map editor (other than houses) are not configged in any way so they don't have a class that nearestObject or nearestBuilding would find...

But if someone knows a way I would have some uses for the method myself...
Project MCAR   ---   Northern Fronts   ---   Emitter 3Ditor
INFORMATIVE THREAD TITLES PLEASE. "PLEASE HELP" IS NOT ONE..
Chuck Norris can divide by zero.

scooter24

  • Guest
Re:TREES AND BUILDINGS
« Reply #2 on: 21 Mar 2005, 20:43:47 »
Hey!
Maybe it is possible. Operation Flashpoint: Resistance came with a feature within the editor that displayed ID's. Buildings, trees and bushs all had a unique ID. Perhaps there is a way of incorporating these IDs to work with infantry, armor and air units (counting them of course! ;)).
Scooter24.

Offline h-

  • OFPEC Site
  • Administrator
  • *****
  • Formerly HateR_Kint
    • OFPEC
Re:TREES AND BUILDINGS
« Reply #3 on: 21 Mar 2005, 22:19:55 »
True...
For me that is no use since I would need to get the objects (mainly bushes and trees) from anywhere without any triggers or mission maker input...

But in some mission that could be used...
Could develope into a pretty tedious job though...
depending on the trigger area and the amount of bushes etc. in it...
Project MCAR   ---   Northern Fronts   ---   Emitter 3Ditor
INFORMATIVE THREAD TITLES PLEASE. "PLEASE HELP" IS NOT ONE..
Chuck Norris can divide by zero.

Offline Wadmann

  • OFPEC Patron
  • ****
  • I'm the next evolutionary step after a llama!
Re:TREES AND BUILDINGS
« Reply #4 on: 22 Mar 2005, 17:49:01 »
As I am not the sharpest knife in the drawer, perhaps someone sharper could use the nearestObject command, the typeOf command, or GB's nearestObj function to determine the names of the objects within 50 meters.

You could also read spinor's post in this topic in which he describes how to find all objects in a grid area based on their height.

I hope that this is of some help to one of you sharp scipters.

                                                      Wadmann
Check out my Camouflage Collection! New items added 31 July 2005.

Offline h-

  • OFPEC Site
  • Administrator
  • *****
  • Formerly HateR_Kint
    • OFPEC
Re:TREES AND BUILDINGS
« Reply #5 on: 22 Mar 2005, 23:26:11 »
Quote
You could also read spinor's post in this topic in which he describes how to find all objects in a grid area based on their height.
Interesting...

I actually was not able to detect any trees/bushes with nearestObject that was executed in a circular pattern on and around a certain position (a tree) with less than 1 meter intervals, spanning out to cover about 10 meter radius...

Maybe I need to go back and test this stuff again...
That height thing I never even thought of... :P
« Last Edit: 22 Mar 2005, 23:26:43 by HateR_Kint »
Project MCAR   ---   Northern Fronts   ---   Emitter 3Ditor
INFORMATIVE THREAD TITLES PLEASE. "PLEASE HELP" IS NOT ONE..
Chuck Norris can divide by zero.

Offline Planck

  • Honoured
  • Former Staff
  • ****
  • I'm never wrong ....I'm just not always right !
Re:TREES AND BUILDINGS
« Reply #6 on: 22 Mar 2005, 23:52:39 »
Trees and bushes don't have class names so you won't find anything with nearestObject or typeOf.

The height thing is an interesting idea, but I think the accuracy would be patchy.

Forests, of course, do have class names as they are in the config.bin.


Planck
« Last Edit: 22 Mar 2005, 23:54:05 by Planck »
I know a little about a lot, and a lot about a little.

Offline h-

  • OFPEC Site
  • Administrator
  • *****
  • Formerly HateR_Kint
    • OFPEC
Re:TREES AND BUILDINGS
« Reply #7 on: 23 Mar 2005, 08:31:27 »
Actually nearestObject does return bushes etc...
When used in 'non-comref' style it will return *.p3d names of the objects...
It also seems to return the object ID too...

I don't know why I didn't get this to work earlier altough I used the exact same method... ::)
I did something wrong obviously... :P

Try this:
Put player on some map (which has objects), then put a trigger activated by radio alpha or something and repeatedly...
Then in the on Act field:
Code: [Select]
hint format ["%1",nearestObject [(position player select 0)+5*sin(direction player),(position player select 1)+5*cos(direction player),position player select 2]]
Now, run to some objects and press 0-0-1 or whatever radio you assigned the trigger to...
You will see different kind of names popping up, like cesta25 which crossreferenced into OFP models is cesta25.p3d which is a piece of road...

EDIT:
Code: [Select]
The height thing is an interesting idea, but I think the accuracy would be patchyIf it's good enough for CoC then it should not be too patchy... ;)

Altough this needs to be experimented on, of course...
« Last Edit: 23 Mar 2005, 08:34:27 by HateR_Kint »
Project MCAR   ---   Northern Fronts   ---   Emitter 3Ditor
INFORMATIVE THREAD TITLES PLEASE. "PLEASE HELP" IS NOT ONE..
Chuck Norris can divide by zero.

Offline Planck

  • Honoured
  • Former Staff
  • ****
  • I'm never wrong ....I'm just not always right !
Re:TREES AND BUILDINGS
« Reply #8 on: 23 Mar 2005, 21:50:24 »
Quote
You will see different kind of names popping up, like cesta25 which crossreferenced into OFP models is cesta25.p3d which is a piece of road.

This is true, but p3d file names don't often give an immediate clue as to what an object is.

I can mostly tell what an object is from its p3d name, but not always, unless I look it up.
Most players would not be able to tell though.

I suppose a very large script to check every name obtained this way could be written, but it would be rather large even though you would only need it for names not configed in the config.bin.


Planck
I know a little about a lot, and a lot about a little.

Offline h-

  • OFPEC Site
  • Administrator
  • *****
  • Formerly HateR_Kint
    • OFPEC
Re:TREES AND BUILDINGS
« Reply #9 on: 24 Mar 2005, 07:23:23 »
True, true...

The good thing working in some mod is that you can limit the stuff to include only the mod specific stuff ;)
Especially in my case...

And, if that height stuff Spinor talked about works then there's no need to build huge references of p3d names/huge scripts...
Few lines oughta do it...
Project MCAR   ---   Northern Fronts   ---   Emitter 3Ditor
INFORMATIVE THREAD TITLES PLEASE. "PLEASE HELP" IS NOT ONE..
Chuck Norris can divide by zero.