Jump to content
Dramacius

Create an array of all shooting targets in marker

Recommended Posts

I have a bunch of popup targets scattered around the map (built into the map) and would like to create arrays of the targets for each area so that I can setup a noPop and reset system for the different areas.

I can't figure out how to create the array of targets though.

They are all of the class "TargetP_Inf_F". could someone help me with this please?

Share this post


Link to post
Share on other sites

Using countType would seem like an obvious answer, however...

2 hours ago, Dramacius said:

built into the map

...if by the above you mean those targets were not placed in editor by you, then I don't think there's any solution aside from manually typing all the object IDs in an array.

Share this post


Link to post
Share on other sites

I was hoping something like this would work however I don't know what I should put in place of "StaticWeapon" to get an array of the shooting targets

vehicles select { _x isKindOf "StaticWeapon" } inAreaArray "myMarker"

 

Share this post


Link to post
Share on other sites

Assuming you mean that the targets are terrain objects, which terrain are you using? 

Share this post


Link to post
Share on other sites
11 hours ago, Dramacius said:

I was hoping something like this would work however I don't know what I should put in place of "StaticWeapon"

Well, the parent class of "TargetP_Inf_F" is "TargetBase". And the parent of that is simply "Static". But from your first post I suppose you already tried checking for "TargetP_Inf_F", so that method may not work at all.

 

For what it's worth - apparently for vanilla pop-up target model, the class defined in "class" property of Geometry LOD is simply... "house". Beats me how it's even working on that map (assuming it really works - gets down when shot, gets up after few seconds - I haven't seen that map before).

Share this post


Link to post
Share on other sites
1 minute ago, krzychuzokecia said:

Well, the parent class of "TargetP_Inf_F" is "TargetBase". And the parent of that is simply "Static". But from your first post I suppose you already tried checking for "TargetP_Inf_F", so that method may not work at all.

 

For what it's worth - apparently for vanilla pop-up target model, the class defined in "class" property of Geometry LOD is simply... "house". Beats me how it's even working on that map (assuming it really works - gets down when shot, gets up after few seconds - I haven't seen that map before).

its a new map but very well designed. They work 100% tested, added the noPop and it stops them popping up, removed it and the return to poping up after a second or 2.

Share this post


Link to post
Share on other sites

is there a version of this

position nearObjects [typeName, radius]


that can detect objects in a marker rather than radius of position?

Share this post


Link to post
Share on other sites

Markers can have a position and radius (assuming a circular marker.)

 

_pos = markerPos "myMarker";
_rad = (getMarkerSize "myMarker") #0;
_pos nearObjects [typeName, _rad]

 

Share this post


Link to post
Share on other sites
1 minute ago, Harzach said:

Markers can have a position and radius (assuming a circular marker.)

 


_pos = markerPos "myMarker";
_rad = (getMarkerSize "myMarker") #0;
_pos nearObjects [typeName, _rad]

 

would this work with rectagular markers?

At least one of the ranges has multiple positions that if multiple players are using it at the same time would need each "Lane" to have its own reset.

I think I am going to have to hide and replace every target manually on the map 😞 there are thousands and doing this is going to inflate the mission file size dramatically especially as the objects are already there!

Share this post


Link to post
Share on other sites

I might have to put a bunch of small markers or gamelogics down for each section of some of the ranges just to cover the various lines of targets in each lane on the ranges with multiple lanes.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×