Outerra forum

User mods, screenshots & videos => Static models => Topic started by: Levi on September 01, 2014, 04:39:25 am

Title: Animated wind turbine
Post by: Levi on September 01, 2014, 04:39:25 am
Download (http://download1483.mediafire.com/seb5nl1rd8pg/0hrfepsye8j5gbg/turbine.Levi.otx)
(September 01, 2014)
As you may have noticed, the user pedropp222 (http://forum.outerra.com/index.php?action=profile;u=114285) already posted a static wind turbine. Then, I was immediately motivated to import one as a vehicle, and animate it. :)

I know this is made as a vehicle, but it's meant to be a static model. You can spawn it just like you spawn static models, but it will be removed after you quit the game...

The 3D model is a free model I just found here: link (http://www.3dmodel777.com/Download-3d-model/Other-design/Windmill-3d-Max-model.html#.VAQt9_mSyDN)

If you open the script file(or ALT+E), you have two variables you can change:
Code: [Select]
var hub_speed = 1.0;
var head_speed = 0.01;

Feel free to play with those :)

Video:
Outerra Anteworld - Animated Wind Turbine (http://www.youtube.com/watch?v=EEUQVvroNRs#ws)

Screenshots:
(http://i.minus.com/iqWJfuaBTeQrz.jpg)(http://i.minus.com/iktLtN2jiZ2mT.jpg)(http://i.minus.com/ixCzz1lPfbF2g.jpg)(http://i.minus.com/ibre7N1uWZBE7m.jpg)
Title: Re: Animated wind turbine
Post by: pedropp222 on September 01, 2014, 05:45:48 am
Thanks for making this! :D
I knew it had to be a "vehicle" in order to make animations. Maybe in the future we could import animations onto our static models!
And yeah, that model sure looks better, i should have spent more than 5 minutes modelling, oh well :P
Title: Re: Animated wind turbine
Post by: Levi on September 01, 2014, 06:09:00 am
Thanks for making this! :D
I knew it had to be a "vehicle" in order to make animations. Maybe in the future we could import animations onto our static models!
And yeah, that model sure looks better, i should have spent more than 5 minutes modelling, oh well :P
You're welcome! I've always wanted to test this, but no real motivation :D :P
I think it can be done as an aircraft too, but I guess it's more complicated because of the FDM's...
Title: Re: Animated wind turbine
Post by: HiFlyer on September 01, 2014, 06:17:48 am
Very nice job, Levi! You're getting to be the Outerra grand master at this stuff.

Looks like you have the stutters during video recording as well. Makes me feel a bit better, as I've have been turning my poor computer inside out running tests to find out what was wrong. At least its not just me!

Also, sounds like there may be need for a new class of objects!
Title: Re: Animated wind turbine
Post by: Levi on September 01, 2014, 06:23:35 am
Sounds like there may be need for a new class of objects.
Yep, we definitely need scriptable objects for this kind of things...
But I don't think it's too complicated to implement this. Is it?

EDIT: ahh I have to edit this now  ;D ;D

Very nice job, Levi! You're getting to be the Outerra grand master at this stuff.

Looks like you have the stutters during video recording as well. Makes me feel a bit better, as I've have been turning my poor computer inside out running tests to find out what was wrong. At least its not just me!
Thanks, but with this one wasn't hard at all. I've done it in 10 minutes :P

Yes, the stutters are very annoying to me. It may be also because of the Anti-aliasing and my not so updated PC...
Title: Re: Animated wind turbine
Post by: Acetone on September 01, 2014, 06:26:02 am
Sad part is that we can spawn vehicules as permanent static objects, but it's impossible to use them :(
Title: Re: Animated wind turbine
Post by: Levi on September 01, 2014, 06:34:13 am
Sad part is that we can spawn vehicules as permanent static objects, but it's impossible to use them :(
You can enter the vehicles after placing them as permanent static objects, but sometimes it's somehow bugged, and impossible to enter...

I've tested with this one, and I was able to use it, even after restarting Outerra...
Title: Re: Animated wind turbine
Post by: bomber on September 01, 2014, 07:05:10 am
What’s needed is a 'look at’ bit of js code for such things as AAA positions.

Over a TW we had a flex gun object, that could be added into a building or vehicle, very handy.
Title: Re: Animated wind turbine
Post by: Acetone on September 01, 2014, 07:12:08 am

I've tested with this one, and I was able to use it, even after restarting Outerra...

Oh? It didn't work for some reason for me :) So we just need a way to make vehicule animations start directly when they are loaded and we will have basic animated structures!
Title: Re: Animated wind turbine
Post by: HiFlyer on September 01, 2014, 07:30:36 am

I've tested with this one, and I was able to use it, even after restarting Outerra...

Oh? It didn't work for some reason for me :) So we just need a way to make vehicule animations start directly when they are loaded and we will have basic animated structures!

So...... Windmills, rotating radar dish's, Wind socks and waving flags? Maybe hanger doors.....  :D

Trying to think of a list of objects this would be useful for, but its too early in the morning, here.
Title: Re: Animated wind turbine
Post by: jonslynn on September 17, 2014, 02:11:18 am
Can you or anyone explain the .js script?  What part is the head and hub?  They both have a speed.
Title: Re: Animated wind turbine
Post by: Levi on September 17, 2014, 07:09:33 am
Can you or anyone explain the .js script?  What part is the head and hub?  They both have a speed.
Code: [Select]
var hub_speed = 1.0;     <<------- This is the speed multiplier for the hub/propeller. Rotates on the horizontal axis.
var head_speed = 0.01;   <<------- This is the speed multiplier for the head turning. Rotates on the vertical axis.

You can always play with those, and see what each one does in case you're not sure...

Btw, you can open the script within the game with ALT+E and see the result immediately without having to restart Outerra, in case you didn't know it :)
Title: Re: Animated wind turbine
Post by: jonslynn on September 17, 2014, 02:15:48 pm
If I wanted to try to make my own windmill or something similar.  What the parts be named or how would that be set up?  This is a neat idea you came up with and the script is so short and simple.
Title: Re: Animated wind turbine
Post by: Levi on September 18, 2014, 07:05:56 am
If I wanted to try to make my own windmill or something similar.  What the parts be named or how would that be set up?  This is a neat idea you came up with and the script is so short and simple.
It's very simple, for this turbine I just named the moving parts('head' and 'hub') and wrote in front of them 'BONE_'. This way you tell the importer that the objects with 'BONE_' in front of their names can be accessed via script. In the modelling software, those objects's names will look like: 'BONE_head' and 'BONE_hub'.

Also, don't forget to place the pivots in the right location, as the objects will be moved/rotated based on the object's local pivot point.

Within the JavaScript you get the objects form the imported package like this:
Code: [Select]
head = geom.get_joint('head');
hub = geom.get_joint('hub');

For more detailed info, check the importer Wiki here: Importer (http://xtrac.outerraworld.com/trac.fcgi/wiki/Importer).
or the Modding: Importer, Tools & Utilities (http://forum.outerra.com/index.php?board=22.0) board.
or this tutorial by bugsblake: full vehicle setup 3ds max to outerra (http://forum.outerra.com/index.php?topic=1946.0).
Title: Re: Animated wind turbine
Post by: jonslynn on September 19, 2014, 01:13:47 am
Thanks,  I was able to make one of my own.  I don't know much about JavaScript.  Since this one was short and simple I figured I could get it to work.

How about a script that makes something rotate the part back and forth like a radar or oscillating fan?

Thanks again.  Very useful.
Title: Re: Animated wind turbine
Post by: Levi on September 19, 2014, 05:36:53 am
Thanks,  I was able to make one of my own.  I don't know much about JavaScript.  Since this one was short and simple I figured I could get it to work.

How about a script that makes something rotate the part back and forth like a radar or oscillating fan?

Thanks again.  Very useful.
Glad you figured it out!
You can take a look at the Ilyushin_Il14P's script for the cab fans. I think that's exactly what you're looking for.

This is the code:

Code: [Select]
Line 544   //Misc
                //CabFans
//base
if(fans_base>=1){fans_inv=1;}
if(fans_base<=-1){fans_inv=0;}
if(fans_inv==0){fans_base+=dt*0.5;}
if(fans_inv==1){fans_base-=dt*0.5;}
geom.rotate_joint_orig(left_fan_base, fans_base, {x:0,y:0,z:1});
geom.rotate_joint_orig(right_fan_base, fans_base, {x:0,y:0,z:-1});

The variables are declared at the beginning of the script.

Code: [Select]
var fans=0;
var fans_base=0;
var fans_inv=0;
Title: Re: Animated wind turbine
Post by: HiFlyer on October 10, 2014, 04:10:12 pm
Love how Acetone has these scattered around his test scenery. I would love it if they were spinning.
Title: Re: Animated wind turbine
Post by: jonslynn on October 15, 2014, 01:09:30 am
Thank you Levi.  It helped me.  Are there any books or links on the scripting?  How come you know so much?
Title: Re: Animated wind turbine
Post by: HiFlyer on October 15, 2014, 01:51:26 am
Thank you Levi.  It helped me.  Are there any books or links on the scripting?  How come you know so much?

Cause' his brain is so large he has to learn how to drive a truck to carry it around in!  ;D
Title: Re: Animated wind turbine
Post by: Acetone on October 15, 2014, 03:54:44 am
Love how Acetone has these scattered around his test scenery. I would love it if they were spinning.

I tried to keep them on a realistic pattern (oriented toward the north entry of the valley where I suppose most of the wind come from) but it's purely a fantasy, there are no wind turbine here in reality. Same thing with the various water tower, there is not a single one in this area, but I've placed them in realistic locations (a higher than the other buildings).
Side note : have you found that poor guy trapped on the top of one of the turbine?  ;D

And I would cut my arm for a way to set some animations as automatic when the object is loaded on the scene, it will really be a nice addition to make the scene a bit more living :)
Title: Re: Animated wind turbine
Post by: Levi on October 15, 2014, 06:02:47 am
Thank you Levi.  It helped me.  Are there any books or links on the scripting?  How come you know so much?
Glad it helped!

I know very little about scripting, that's only basic stuff...

But you could start reading this book: JavaScript: The Definitive Guide, 6th Edition (http://filepi.com/i/stNZbNj). It's one of the best books about JavaScript out there. :)


Cause' his brain is so large he has to learn how to drive a truck to carry it around in!  ;D
lol, you made my day! ;D ;D :D
Title: Re: Animated wind turbine
Post by: HiFlyer on March 14, 2015, 06:23:15 pm
Is it possible for these windmills to autostart when Outerra is launched, yet?
Title: Re: Animated wind turbine
Post by: Levi on March 14, 2015, 06:40:19 pm
Is it possible for these windmills to autostart when Outerra is launched, yet?
No, not yet, unfortunately.