Water Water Everywhere ...

Post » Sun Nov 18, 2012 8:44 pm

But no way to find it?!

Yeah, I searched (awful pun intended)... I was sure I had seen - yonks ago - someone trying to find a useable water source (to put out a light, or something?)

But I can't find anything on this ... So probably its not possible (or I'm just being a dopey noob and its easy!)


(this is about Exterior Cells ... not about Interior Water Plane Objects .... which is easy)
  • I have a creature. It has behavious. One of those behaviours is that it needs to go for a drink (every now and then).
  • So, I could cheat and just place some XMarkers (and/or Locations) near some water, that it travels to every now and again
  • But that's a bit rubbish, because I'd need hard-coded locations to make it all work (and I don't want that).
  • I guess I could place markers all over the place, and then just use a FindNearestObjectOfType thingy to get the creature to find the nearest placed marker ... but that's about the same as above and also a bit rubbish
And so - Is there anyway to DETECT Water in Script?


Notes:
  • I've never done any Exterior Creation etc ... So I've no idea how rivers and such are placed when creating/editing exteriors - So stupidly simple instructions would be appreciated
  • I figure that I can use the Water-Type-Objects to figure out whether water I have detected (if I can detect it) is deep enough for my needs etc (maybe?)
  • There is a FINDWEATHER Papyrus command ... And Weather is - like Water - WorldData (not a "normal" object) ... So are we just missing a "function" ... and if we are, do I need to go seek out the SKSE-Crew, do you think?
User avatar
Anna Beattie
 
Posts: 3512
Joined: Sat Nov 11, 2006 4:59 am

Post » Mon Nov 19, 2012 4:40 am

Chesko posted up a tutorial/resource that can accomplish this but it might be a whole load of work to include all the sources of water in skyrim

http://www.gamesas.com/topic/1401506-resource-method-to-solve-if-reference-is-inside-complex-region-ispointinpolygon-function/

In that thread somebody also mentions "the little fish trick" which might be good for you. I have no idea what it is/how to set it up, but I'm sure somebody else will come along and fill you in

- Hypno
User avatar
Elle H
 
Posts: 3407
Joined: Sun Aug 06, 2006 3:15 am

Post » Mon Nov 19, 2012 5:56 am

"Nor any drop to drink."

Well the trick consists in a Ref of a new Actor with a new Race (copy of Child one) and with the lowest Height settings possible, who is moved & enabled at 50/60 feets forward the Player with the trigger of your choice. The "fish" has 2 Spells, one constant Invisibility and one with AME script with IsSwimming as Condition, which so indicates if there's water.

Positive side :

- works perfectly with sea borders (if Player is not swimming) and with every river, even some very small ones.
- can covers some areas that FindRef functions can not reach

Negative sides :

- it's pretty long, taking several seconds
- because of collisions, Player can bump in the fish
- there are still some zones, like Whiterun's entry or containing certain Movable Statics, where the fish can not swim

Maybe not really useful for your special utilisation of Water.
User avatar
barbara belmonte
 
Posts: 3528
Joined: Fri Apr 06, 2007 6:12 pm

Post » Sun Nov 18, 2012 8:42 pm

That's just such a lovely concept as a script I so want to use it just for that fact! :)

But it's not going to work on NPC cratures, is it .. although ... hmmmm

I don't really care if it goes away for ten seconds, then comes back with an answer (sea is no good, mind ;)) ... I do care if it grinds the game to a halt while it's at it ... Does it appear to thread itself OK? If a save is done while it is active, does the game load again ok? Any post I can read where anyone did any testing?

I have a (poor) way to do it now ... Also involving little fishes, in a way ... I can find an object that is present (in vanilla) in most decent bits of water (small lakes, rivers and the like) ... So I can FindRef those. This is quick (enough) and seems safe if I save when active then reload (though the real Little Fish probably would too?). But its all a bit quirky and means jumping through a few hoops to get it working even half how I wanted.

I might try the fish-spell thing ... Is there a post on here or Nexus, somewhere, with some examples or something?

Thanks for the help :)
User avatar
vicki kitterman
 
Posts: 3494
Joined: Mon Aug 07, 2006 11:58 am

Post » Mon Nov 19, 2012 5:08 am

I do care if it grinds the game to a halt while it's at it ... Does it appear to thread itself OK? If a save is done while it is active, does the game load again ok? Any post I can read where anyone did any testing?

I don't know at all, this is something i have not tested yet.

I might try the fish-spell thing ... Is there a post on here or Nexus, somewhere, with some examples or something?

Here's an example of code :

Spoiler
ObjectReference Property FishRef AutoFUNCTION WaterDetectionFunction()FishRef.MoveTo(PlayerRef, (50 * Cos(PlayerRef.GetAngleX() * -1) * Cos(PlayerRef.GetAngleZ() * -1 + 90)), (50 * Cos(PlayerRef.GetAngleX() * -1) * Sin(PlayerRef.GetAngleZ() * -1 + 90)), 3.0, 0.0)FishRef.Enable()int i = 0WHILE i < 31 && !YourScript.WaterDetection ; 31 is the detection time limitWait(0.01)i += 1EndWHILEif ( YourScript.WaterDetection ) ; variable set to 1 by Fish MagicEffect script	 Notification("Water Detected !")else	 Notification("No Water Detected !")endifClearWaterDetectionFunction()EndFUNCTIONFUNCTION ClearWaterDetectionFunction()FishRef.MoveTo(PlayerRef, 0.0, 0.0, 1000.0, 0.0)Wait(0.8)FishRef.Disable()FishRef.Enable()FishRef.Disable()YourScript.WaterDetection = 0EndFUNCTION
User avatar
Jordan Moreno
 
Posts: 3462
Joined: Thu May 10, 2007 4:47 pm

Post » Mon Nov 19, 2012 1:56 am

Thanks very much, Seigneur, that's very much appreciated :)

(I'll post the results I get when I've played with it)
User avatar
JLG
 
Posts: 3364
Joined: Fri Oct 19, 2007 7:42 pm


Return to V - Skyrim