|
Development Forum |
 |
| making objects buoyant in water | |
|

xan
    
|
7/12/2015 | |
I'm trying to code an object (C3/DS) that floats in water and am having a hard time. I could swear I've seen agents that are buoyant, or at least hydrophobic, but I'm searching and coming up with nothing. I also can't see any CAOS commands regarding it.
The best I've been able to come up with is a drop/collision system that tries to detect the room type and change accg appropriately, but it's ... not going well, and I feel like there should be a more intuitive way to do this. Am I wrong? |
 Tea Queen
Laura
    

|
7/12/2015 | |
It's definitely possible to code buoyant objects. I think this past topic will be of some use to you! Kezune made a Floating Duck Toy for C3/DS.  |

xan
    
|
7/12/2015 | |
definitely helpful. Thanks much! |
 Peppery One
Papriko
    
|
7/13/2015 | |
As you can see in the topic Laura linked, there is sadly no easy and intuitive way of doing it. Your guess was pretty good already, you do need a timer script that keeps checking the room type and adjusts physics properties accordingly.
Lets play plants! Photosynthesis... Photosynthesis... Photosynthesis... |
 Prodigal Sock
Ghosthande
    

|
7/13/2015 | |
^ Precisely.
You can check some of my agents if you'd like a reference... I've done it multiple times and more than one definition of the phrase. Some of the objects in KT will bob at the surface... and the Fun In The Sun fish "hover" when underwater and look like they're drifting around in the current, but don't necessarily float upwards.
 |

xan
    
|
7/13/2015 | |
I've got a nasty allergy to fast ticks, so I've been working on a system that falls 'asleep' once its velocity falls under a certain value... not sure yet how I'm going to prevent it drifting up out of the water, though, so it might get scrapped. It would be nice if we had a 'entered new room' callback... |