Spearhead 1944 Code Snippets

From Bohemia Interactive Community
Revision as of 12:47, 5 August 2023 by .kju (talk | contribs) (Created page with "= Useful code snippets = == Determine positions of craters on terrain == The craters that are part of the terrain, not objects. thumb They usu...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Useful code snippets

Determine positions of craters on terrain

The craters that are part of the terrain, not objects.

Normandy-Crater.jpg

They usually have crater decals in them. But the terrain ones do not link to the config versions so detecting them is harder.

There may be a better way than this to find them, but this is what came to mind first.

(nearestObjects [player, [], 10]) select {((getModelInfo _x) # 0) in ["spe_crater_decal_large.p3d","spe_crater_decal_small.p3d"]}