OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: benreeper on 23 Nov 2005, 23:29:35
-
What is the easiest/best/only way to detect if you are near a forest.
--Ben
-
Hmmm.......
Open your eyes?
Wait till you walk into a tree? ::)
Or maybe nearestobject........if it works with forest pieces that is.
Planck
-
LOL, it does sound like I'm dealing with blind soldiers. Maybe I should use the force.
I was thinking about nearest object. Is there a superclass for the forest or tree(s) that I can use?
The reason for this question is that I have a series of random waypoints. When one is reached, another one is created. However, if they cannot get to the waypoint (i.e. the waypoint is at a building or in a forest and you're in a vehicle, etc) the next one will not be created.
--Ben
-
Well........below are the classnames of all forest pieces....the standard BIS ones from CWC and Resistance..
"Forest001T1"
"Forest001T2"
"Forest002"
"ForestRes01"
"ForestRes01T1"
"ForestRes01T2"
"ForestRes02T1"
"ForestRes02T2"
"ForestRes03"
"ForestRes02"
"Forest003"
"Forest003T1"
"Forest003T2"
"Forest004"
They are all sub-classes of class "Forest".
You could try just detecting class Forest first.
If that fails maybe you can find out which forest pieces are on the island you are using and try detecting those.
Planck
-
You could place an editor bush like the ones you find in the forests, right in the middle and do a distance command on that.
-
or a different way a load of triggers set around the forest with a slightly bigger size which sets a variable like
nearforest = true and on deactivation sets the variable to false again
(remember to make the trigger repeated)
the only thing with this method is that it can cause a lot of lag and can be very confusing looking at a ton of triggers all over the editor but i would say its more simpler if the mission isnt a huge one and it wouldnt suffer from lag it might be a good idea
just how i would probaly do it