Arodicus Posted April 21, 2012 Share Posted April 21, 2012 How can I detect if an object (MISC is best) is currently swimming, floating or under water? Does papyrus have any collision or proximity functions that dont require me to lay down trigger areas across all of Skyrim? I'm trying to make a carryable, useable fishing net. Drop it in water, catch fish. Drop on land, catch dirt (or maybe rabbits). I made a hacky solution by spawning a Slaughterfish at the objects current location when dropped. In the console I can then target the fish and check "isSwimming" to determine if the object was dropped in deep water... but I cannot figure out how to get the value of isSwimming (console command) into my Papyrus script. There's a page describing how - http://www.creationkit.com/Passing_Conditions_to_Papyrus - but it's poorly written and I don't really understand what he's doing or if it applies to my case. Would SKSE or ScriptDragon help me? (for that matter, are there any docs for these on the web???) Any help is appreciated. Link to comment Share on other sites More sharing options...
steve40 Posted May 2, 2012 Share Posted May 2, 2012 I'm not sure, but I also need a reliable way to detect water myself. In the CK, there are WaterType forms defining all the water. The ocean uses WaterType "DefaultWater" for example.So, perhaps you could place a dummy LandingMarker on the spot where you want to cast the net. The dummy marker will run a script that calls FindClosestReferenceOfType(DefaultWater, marker.x, marker.y, marker.z, radius), where the search "radius" would be a very small number (perhaps 1). You would pass the WaterTypes into your script as properties, of course. As there are quite a number of WaterTypes, you would probably need to use a FormList of watertypes and use a while loop to walk through each watertype in the list. Perhaps you could be more efficient by limiting what watertypes the net could work on... There might even already be a pre-defined FormList of watertypes in the CK? In terms of determining if something is underwater, you will find for example, that the sea-level in Tamriel is Z = -14000. So once you have determined that your marker is in the water, if it's Z is less than -14000 then it's gotta be underwater :) I think all the water heights are defined somewhere in the REGIONS forms or in the World forms somewhere (sorry, I can't remember exactly where off the top of my head, just hunt in the World menu at the top of the CK main window. each "world" has a different water height). If you need more info on how to place a dummy landingmarker, look in the scripts folder and study the scripts that are used for spawning critters (moths, etc). Oh, and you might want to do a "HasLOS()" check from the player to the landingmarker to make sure that there are no obstacles between the player and the water, you don't want him casting through a wall or something :whistling: Well, that's the only way I can think of, and I haven't tested this method yet :tongue: . Link to comment Share on other sites More sharing options...
Recommended Posts