sowens 71 Posted September 29, 2011 Is there a way to detect if a vehicle is in water? I need to add an additional statement to below, but only if not in water if (_dead) then Share this post Link to post Share on other sites
buliwyf 4 Posted September 29, 2011 surfaceIsWater :rolleyes: Share this post Link to post Share on other sites
.kju 3239 Posted September 29, 2011 You might find this page helpful: http://community.bistudio.com/wiki/Category:Scripting_Commands_ArmA2 Share this post Link to post Share on other sites
sowens 71 Posted September 29, 2011 Thanks PvPscene...that is one page I didnt have bookmarked. Share this post Link to post Share on other sites
Feint 137 Posted February 26, 2012 The surfaceIsWater command only works in the ocean, not in ponds. Is there a way of detecting when you are in any kind of water? There must be because weapons stop working in water, and it doesn't matter if it is a pond or the ocean. Share this post Link to post Share on other sites
buliwyf 4 Posted February 26, 2012 _anim = animationState _unit; _anim = toArray _anim; _anim resize 4; _anim = toString _anim; if (_anim == "aswm") then { ...bla... }; Got it somewhere from this forum and works fine for me... :) Share this post Link to post Share on other sites
Feint 137 Posted February 26, 2012 (edited) That's good if you are swimming, but what if you are just standing in water but not swimming? See, I'm working on a script for thirst and water and I want to be able to fill a water container while standing in a lake. Going swimming to fill the container is a quick solution to the problem, but I'm hoping to find another more realistic method of finding the water at my feet. I tried isFlatEmpty, but the water check is for sea water, not any water. :( Edited February 26, 2012 by Feint Share this post Link to post Share on other sites
[aps]gnat 28 Posted February 26, 2012 Can't detect that a nearby object is the pond object? Share this post Link to post Share on other sites
Feint 137 Posted February 26, 2012 I tried finding it with nearObjects and nearEntities, but no joy. nearestObjects found the pond finally when I did it like this: ...from the Biki _list = nearestObjects [position _caller, [], 10]; Share this post Link to post Share on other sites
demonized 20 Posted February 26, 2012 maybe this one works for you: http://community.bistudio.com/wiki/surfaceIsWater Share this post Link to post Share on other sites
[aps]gnat 28 Posted February 26, 2012 The surfaceIsWater command only works in the ocean, not in ponds. Quote it before Feint gives a *sigh* ;) Share this post Link to post Share on other sites
demonized 20 Posted February 26, 2012 Gnat;2111970']Quote it before Feint gives a *sigh* ;) right, :D Share this post Link to post Share on other sites
Feint 137 Posted February 26, 2012 (edited) lol. Ideally, surfaceIsWater would /thread. But alas, the world is not always perfect. So there are something like 140 different pond p3ds in the game, and in the game, they all have the numbers and colon in front of the name similar to: 123456: pond_big_42_18.p3d How do I test if the word "pond" appears in the string? I want to be able to say _list = nearestObjects [position _caller, [], 20]; _count_ponds = 0; {if (_x contains the word "pond") then {_count_ponds = _count_ponds + 1}} forEach _list; I just don't know how to find a specific keyword like "pond" in a string that can vary in length from "123456: pond_big_42_18.p3d" to "12345678: pond_big_01.p3d". isKindOf doesn't work. It always returns false because the ponds don't have classnames typeOf also does not work (_x == "specific name of p3d file") always returns false because of the numbers and colon in the string Edited February 26, 2012 by Feint Share this post Link to post Share on other sites
.kju 3239 Posted February 26, 2012 http://kronzky.info/snippets/strings/index.htm Share this post Link to post Share on other sites
Feint 137 Posted February 26, 2012 (edited) Oooh, looks good! I'll try this. Thanks! EDIT: It works. Thanks a lot! Edited February 26, 2012 by Feint Share this post Link to post Share on other sites
_William 0 Posted February 29, 2012 Just a warning: I recently discovered in VBS2 that the pond object dimensions reported in game, just as the bridge span object dimensions, do not always reflect the full size of the pond/bridge. For ponds consisting of a single object, you should be fine. For large lakes composed out of multiple ponds, the inner part of the pond wasn't covered by the object dimensions reported (VBS2 map Easterneuropeangeotypical25km). I wouldn't be surprised to see a a similar problem in Arma2. William Share this post Link to post Share on other sites
Feint 137 Posted March 1, 2012 OK, good to know. Thanks. I'm not currently querying the pond dimensions. I've just set the search parameter to 25 meters and it seems to accurately find ponds as soon as I enter their shorelines. With weird shaped ponds with undulating shorelines, sometimes the pond isn't found and sometimes the land is listed as the pond, but I've handled that with "too muddy" sideChat when you don't find it. So for half of the time that the pond water finding is inaccurate, it's well explained. Just walk along the shoreline and you'll find "less muddy" water eventually. It's a workaround, but feels like it makes sense when playing. Share this post Link to post Share on other sites
[aps]gnat 28 Posted March 1, 2012 ... but I've handled that with "too muddy" sideChat ..... Just walk along the shoreline and you'll find "less muddy" water eventually. lol ... cool. Nice fix with a realism element ;) Share this post Link to post Share on other sites
celery 8 Posted March 1, 2012 Just a suggestion: find the pond object's top dimension related to the world and check if the player is under that height inside the pond's XY boundaries. That way you can have more accuracy with larger ponds. Share this post Link to post Share on other sites