Ranking
Original Post
[Lua] Water


Hello.
I've been working on a quick script, that as shown on the video above, adds semi-swim-able water.
Every body part that is inside a water object is subject to an upwards force.

It's still a beta, I'm probably gonna work more on it. I intend to make it so that you can add water objects inside your mod, and get the script to recognize it.
Right now, if you can work with lua, you can go inside the source and mess with the add_water function. It's parameters are equal to the draw_box function without the rotation.


The script now lets you add water objects through a mod.
To add a water object to your mod, create a line anywhere in the script that starts with "#water".
Then, add the object information separated by commas: x position, y position, z position, x size, y size, z size
To add more objects, simply put a space between them.

Example mod



The script doesn't add any water flow physics though, and I don't really expect to do anything like that.

That's pretty much all at the moment, hope you like it.



Changelog:
19-12-2012: Initial release.
20-12-2012: Script now adapts automatically to the gravity.
20-12-2012: Script is now customizable through mods.

Source

Attached Files
water.lua (2.0 KB, 284 views)
watertest.tbm (237 Bytes, 62 views)
Last edited by Yoyo; Dec 20, 2012 at 11:42 AM.
multiple texture uploader! updated: multiple texture remover!
updated pretty colorlist!

<BobJoelZ> ok ive just rebooted my pc and ive tried to activate my reflex on yahoo internet explorer :/ no luck

<Aracoon> I do not enjoy having anal sex with multiple men
I should expect swimming race mods. Or something like sparring in water.
That would be pretty cool.
So you're trying to simulate water by creating a kind of buoyancy effect inside objects by adding a upwards force inside them?
If I understood that correctly, you'll have to "calibrate" the effect for -30 gravity with another version of the script or so, won't you?
We're still kids in buses longing to be free.
You're pretty much correct, I set an upwards going force on every bodypart (not joints though) that is inside the water objects.

It is possible to make a self-adapting script, and it is something I'll add in the future, but right now it's only calibrated for -9.82.
I'll try to make an updated version asap.
Last edited by Yoyo; Dec 20, 2012 at 01:17 AM.
multiple texture uploader! updated: multiple texture remover!
updated pretty colorlist!

<BobJoelZ> ok ive just rebooted my pc and ive tried to activate my reflex on yahoo internet explorer :/ no luck

<Aracoon> I do not enjoy having anal sex with multiple men
This is an excellent script. I enjoy it very much. It warms my heart that this script is so good.
[23:23:53] <AndChat|700625> Blue eyes ultimate dragon best card
[23:24:29] <AndChat|700625> You know the one with 3 heads
[23:24:39] <~Lightningkid> just like my dick



[11:35:40] <box> Hampa suck
[11:36:21] <hampa> not the first to tell me that today
Always wanted something like this, great job, will try this out as soon as I can and give some feedback.
I figured out a proportionality constant that gives me the correct upwards force when multiplied by the gravity, so the script now adapts automatically to the gravity.

If anyone is interested, it's value is of -0.00305.

Gonna update the first post too.
Attached Files
water.lua (1.2 KB, 13 views)
multiple texture uploader! updated: multiple texture remover!
updated pretty colorlist!

<BobJoelZ> ok ive just rebooted my pc and ive tried to activate my reflex on yahoo internet explorer :/ no luck

<Aracoon> I do not enjoy having anal sex with multiple men
Wow. I was actually thinking of a sort of poolish sparring mod.
I'll check back next week to see if this is suitable for it.
Again, nice script Yoyo. This worked very well here.
But i agree with oblivion, calibrated would be cool.