Jump to content

Daspex WIP and other stuff.


Recommended Posts

  • 1 month later...
  • 8 months later...

553249595_TheKlub17-0131.png.8c392ade85c5699280fea4e0873e851a.png382825113_TheKlub17-0132.png.58302a6a2d56a395d44264d74635a69e.png993569565_TheKlub17-0124.png.b20b96e3974ffc970678354109a50867.png73988051_TheKlub17-0133.png.5b5399e316538f3b7bac797ccecdcacc.pngComing soon..

This is one of my wip rooms I want to show to you.It is a room

with scifi vessels and serveral animations and a lot of room Options.

For example you can switch between landed on a planet or being in space. :)

The skydome is switchable between night and day,also the planets can be switched on and off.The skymaps and ground are colorizeable via room options as well.  ;) Of course it will have TV Screen support too.

 

304297739_TheKlub17-0125.png.6ba140a05403cd98b050d8d60d1d1029.png1891921457_TheKlub17-0128.png.85ac4621d1936d5bfe57967f034143b4.png

Edited by Daspex
Link to comment
  • 1 month later...

Animated Wallclock

 

On a request Im trying to create a Wallclock with animated hands/pointers.This is not a big deal but the speed of the hands is.(At least without bs code documentation.)

 

The common workflow of animating and F-Curve modifier is not working with the ctk utils or I dont see how to do it.

 

So I just did the hands animations by approximation of start and end positions of them.Also math doesnt help cause the unsynced rotation starts very fast the first time the toy is loaded and continues very slow to faster.But I think its good enough to be used in our game as an animated wallclock.

 

Next is to add the clock sound...

 

Link to comment

"Synced" to what? If you're doing this in TRS, then you should be rotating your second hand plane in 6 degree increments every 1000ms, adding the other two consecutively every 60th turn. Is there no way to count seconds in this game?

 

EDIT: Sure there is, here's a snippet...

 

		ScSection . {
			.Label "TEMPLE-INIT";
			.Do [ ScTopic :ACT0001 . {
			};
			ScWait . {
				.Seconds 5f;
			};
			ScTopic :ACT0002 . {
			};
			ScWait . {
				.Seconds 5f;
			};
			ScTopic :ACT0003 . {
			};
			ScWait . {
				.Seconds 5f;
			};
			ScTopic :ACT0004 . {
			};
			ScWait . {
				.Seconds 5f;
			};
			ScJump . {
				.Jump "TEMPLE-EXIT";
			};
			];
		};

 

Edited by Curtis_S
Link to comment

As i already said the common method with 6 ° etc.

dont work.With sync I mean to apply an F-Curve modifier

To “sync“ the hands rotating in blender,this way one animation can be used for all three hands.

 

Seems to be I have to use three different

animations,which can be timed separately

but have to figure out if appimport works inside

of tool scripts cause the hands have to be imported

via appimport to work as one toy together.

I could also put all anims in one file but I like to have

serveral parts cause its easier to edit/update.

 

Ill try 3 single animations and see how it works.

 

Or I just add a sound and release it like it is,it

is not to be a realtime clock but the hands are moving around and that should be enough to give an illusion to a scene.

 

 

Edited by Daspex
Link to comment
18 hours ago, Daspex said:

As i already said the common method with 6 ° etc.

dont work.With sync I mean to apply an F-Curve modifier

To “sync“ the hands rotating in blender,this way one animation can be used for all three hands.

 

Seems to be I have to use three different

animations,which can be timed separately

but have to figure out if appimport works inside

of tool scripts cause the hands have to be imported

via appimport to work as one toy together.

I could also put all anims in one file but I like to have

serveral parts cause its easier to edit/update.

 

Ill try 3 single animations and see how it works.

 

Or I just add a sound and release it like it is,it

is not to be a realtime clock but the hands are moving around and that should be enough to give an illusion to a scene.

 

 

Why can't you just stick the whole thing inside of tool_group?

Link to comment

Example...

 

Two problems with this method: 1) 3dsmax performs all of its rotations in quaternions, but exports everything in euler; meaning that to get it working in the klub I'd  have to divide the animation into 90deg blocks to avoid gimbal lock. 2) The animation is 43200 keyframes long (number of seconds in a 12 hour period).

Link to comment

It needs to be setup to where you're just adding 6 degrees to each, at intervals of 1, 60, and 360 respectively. That's only like 4 lines of code. The problem getting it into the klub is you have your objects in one file and your scripts in another.. How in the hell are you supposed to pass variables back and forth?

 

Smarter people than me probably do this in their sleep!

Edited by Curtis_S
Link to comment
1 hour ago, Curtis_S said:

No, I mean the whole thing (however many objects). The only way it's going to stay together is if they all have the same parent (that's the whole idea of groups). I don't know how you would do them separately.

 

With AppImport function like in rooms but didnt found the right syntax yet,if its possible at all in toy scripts.I you put animations in every single part/bs file,they run forever in its ammount of frames,this way every animation has its single loop and constant animation speed,which is not the case if all animations run together in one animation.Thats the reason why.I dont know anorher way to do so.The appimport works like a group somehow but seems to work in its own environment and so the animations run at one time but in its own loop independently of each other.

Edited by Daspex
Link to comment
1 hour ago, Curtis_S said:

Example...

Two problems with this method: 1) 3dsmax performs all of its rotations in quaternions, but exports everything in euler; meaning that to get it working in the klub I'd  have to divide the animation into 90deg blocks to avoid gimbal lock. 2) The animation is 43200 keyframes long (number of seconds in a 12 hour period).

This is exactly the reason for appimport,think of my scifi room,without appimport groups of gliders all gliders would run a while than stop cause of its different framecount and only start by zero if the longest frame has been ended and start again.The keyframes for the hour hand would be over one million.lol

This is the blender way but the result is oc not readable for ctk...

 https://blenderartists.org/t/seconds-hand-animation-of-60-seconds/577795

Edited by Daspex
Link to comment
16 minutes ago, Curtis_S said:

It needs to be setup to where you're just adding 6 degrees to each, at intervals of 0, 60, and 360 respectively. That's only like 4 lines of code. The problem getting it into the klub is you have your objects in one file and your scripts in another.. How in the hell are you supposed to pass variables back and forth?

 

Smarter people than me probably do this in their sleep!

Yeah,maybe lua script but i also have no clue...

Link to comment

If you could poll the system clock it'd be a piece of cake. You just poll the clock once a second, then plug those values (Hx30, Mx6, Sx6) into your rotation vectors. I know it's doable, there are different length loops running all over the place (water, palm trees, tentacles...).

Edited by Curtis_S
Link to comment
2 hours ago, Curtis_S said:

If you could poll the system clock it'd be a piece of cake. You just poll the clock once a second, then plug those values (Hx30, Mx6, Sx6) into your rotation vectors. I know it's doable, there are different length loops running all over the place (water, palm trees, tentacles...).

Yeah,It looks like Marburg called rotations defined in anim01.bs.They are containers to which the mesh will be linked to,thats how I understand that.But if I look deeper inside of anim01.bs it looks horrible to me.

Edited by Daspex
Link to comment
14 hours ago, Daspex said:

Yeah,It looks like Marburg called rotations defined in anim01.bs.They are containers to which the mesh will be linked to,thats how I understand that.But if I look deeper inside of anim01.bs it looks horrible to me.

anim01 is just a library. You don't _need_ to call from it, you can write it directly into the script, or call from a separate file. It just wants for a bit of code reference that probably doesn't exist anywhere outside of 3X HQ.

Link to comment

That said, here's a realtime clock in javascript, if someone knows how to translate it to BS... You just need to substitute VAR NODE for your three rotation vectors (H, M, S):

 

 <script type="application/x-javascript"><![CDATA[
    var Clock = new function()
    {
      window.addEventListener("load", setClock);

      function setClock()
      {
        var sec;
        var min;
        var hr;
        var deg;
        var node;
        
        var dt = new Date();
        var deg=0;
      
        min = dt.getMinutes();
        sec = dt.getSeconds();
        ms = dt.getMilliseconds();

        deg = (360/60)*(sec+ms/1000);
        node = document.getElementById("seconds");
        deg %= 360;
        node.setAttribute("transform","rotate("+deg+",0,0)");

        deg = (360/3600)*(60*min+sec);
        node = document.getElementById("minutes");
        deg %= 360;
        node.setAttribute("transform","rotate("+deg+",0,0)");
        
        hr = dt.getHours();
        deg = 30*hr + 30/60*min;
        var node = document.getElementById("hours");
        deg-=150;
        deg %= 360;
        node.setAttribute("transform","rotate("+deg+",0,0)");
        
        document.getElementById("asec").beginElement();
        document.getElementById("amin").beginElement();
        document.getElementById("ahr").beginElement();
        
        var timeout = ((60-dt.getSeconds())%60)*1000;
        timeout-=dt.getMilliseconds/1000;
        
        setTimeout(setClock,timeout);
      }
    }();
  ]]>
  </script>

 

animationclock.svg

Edited by Curtis_S
Link to comment
2 hours ago, Curtis_S said:

anim01 is just a library. You don't _need_ to call from it, you can write it directly into the script, or call from a separate file. It just wants for a bit of code reference that probably doesn't exist anywhere outside of 3X HQ.

Anyway he calls rotations from ingame,but its the same problem,the toy script needs a different syntax it dosnt accept the syntax from AvRoom.bs,like the animation loops

I also called them from ingame but the syntax is different

to AvRoom.bs.If I figure out the syntax for time scale all will run fine...

 

Link to comment
2 hours ago, Curtis_S said:

That said, here's a realtime clock in javascript, if someone knows how to translate it to BS... You just need to substitute VAR NODE for your three rotation vectors (H, M, S):

 

 <script type="application/x-javascript"><![CDATA[
    var Clock = new function()
    {
      window.addEventListener("load", setClock);

      function setClock()
      {
        var sec;
        var min;
        var hr;
        var deg;
        var node;
        
        var dt = new Date();
        var deg=0;
      
        min = dt.getMinutes();
        sec = dt.getSeconds();
        ms = dt.getMilliseconds();

        deg = (360/60)*(sec+ms/1000);
        node = document.getElementById("seconds");
        deg %= 360;
        node.setAttribute("transform","rotate("+deg+",0,0)");

        deg = (360/3600)*(60*min+sec);
        node = document.getElementById("minutes");
        deg %= 360;
        node.setAttribute("transform","rotate("+deg+",0,0)");
        
        hr = dt.getHours();
        deg = 30*hr + 30/60*min;
        var node = document.getElementById("hours");
        deg-=150;
        deg %= 360;
        node.setAttribute("transform","rotate("+deg+",0,0)");
        
        document.getElementById("asec").beginElement();
        document.getElementById("amin").beginElement();
        document.getElementById("ahr").beginElement();
        
        var timeout = ((60-dt.getSeconds())%60)*1000;
        timeout-=dt.getMilliseconds/1000;
        
        setTimeout(setClock,timeout);
      }
    }();
  ]]>
  </script>

 

animationclock.svg 43.27 kB · 2 downloads

Thanks,but I just need someone to translate the AvRoom bs-code syntax of time scaling to theTcToolsVx syntax...

Link to comment
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more information, see our Privacy Policy & Terms of Use