How do you activate "borrowed" animations?

Discussion of rolling-stock creation & re-painting.

How do you activate "borrowed" animations?

Unread postby MadMike1024 » Sun Nov 27, 2011 8:19 pm

I noticed there was a rotary beacon on the SD40T in Donner. I'm working with PapaExpress to add a rotary to the Cornell GP-38-2. The preliminary model is in the game and looks nice.

For some reason, none of the animations on the 38 seem to work. I don't know how to trigger them. I've copied all the related code for the beacon into the bin file, and the light shows up where it belongs. However, the animation won't run. Is there a way to start the animations as soon as the engine starts? TIA.
MadMike1024
Global Mod
 
Posts: 1730
Joined: Fri Jul 30, 2010 8:11 pm
Location: Vancouver, WA

Re: How do you activate "borrowed" animations?

Unread postby MadMike1024 » Thu Dec 01, 2011 12:28 pm

Failing any answer, does anyone know what software you use to create the animations?
MadMike1024
Global Mod
 
Posts: 1730
Joined: Fri Jul 30, 2010 8:11 pm
Location: Vancouver, WA

Re: How do you activate "borrowed" animations?

Unread postby Kali » Thu Dec 01, 2011 12:49 pm

I don't know how it works for the DP engines ( actually I don't know what sort of animation you're talking about either, does it loop? ). I know how to mess with animations from the engine script though although I don't know how to mess with pre-looped animations.

You make animations in a 3d editor - you have to have the 3d model source first, the animation is just moving parts of the 3d model around.
Kali
 
Posts: 1600
Joined: Mon Mar 14, 2011 1:00 am
Location: England-by-Sea

Re: How do you activate "borrowed" animations?

Unread postby MadMike1024 » Thu Dec 01, 2011 2:15 pm

Kali wrote:I don't know how it works for the DP engines ( actually I don't know what sort of animation you're talking about either, does it loop? ). I know how to mess with animations from the engine script though although I don't know how to mess with pre-looped animations.

You make animations in a 3d editor - you have to have the 3d model source first, the animation is just moving parts of the 3d model around.


The animation for the beacon appears to be a multi position loop that tweaks the matrix position of a standard spot light element so that it appears to sweep in a circle.

The original matrix is:

Code: Select all
<Matrix>
   <cHcRMatrix4x4>
      <Element/>
   </cHcRMatrix4x4>
</Matrix>


which places the light element at ground level center then, when the animation is started, it creates the matrix, and the light element becomes positioned on the top of the cab and begins to rotate.
MadMike1024
Global Mod
 
Posts: 1730
Joined: Fri Jul 30, 2010 8:11 pm
Location: Vancouver, WA

Re: How do you activate "borrowed" animations?

Unread postby Kali » Thu Dec 01, 2011 2:37 pm

Hmm. Now I want to see the mechanics of this! what does the engine script look like? there is a script call called setNearPosition but that used to at least only do translations.
Kali
 
Posts: 1600
Joined: Mon Mar 14, 2011 1:00 am
Location: England-by-Sea

Re: How do you activate "borrowed" animations?

Unread postby MadMike1024 » Thu Dec 01, 2011 3:27 pm

Kali wrote:Hmm. Now I want to see the mechanics of this! what does the engine script look like? there is a script call called setNearPosition but that used to at least only do translations.


That entry does not exist. The only reference to the beacon in the original is to shut it off on startup (commenting out that entry does not let it start BTW). Is there a way to decompile/edit a .ban file? I really think that the animation needs to be model specific.

Oh, the animation also creates 4 segments on the beacon itself, so what appears to be the half-lit portion moves with the beam.
MadMike1024
Global Mod
 
Posts: 1730
Joined: Fri Jul 30, 2010 8:11 pm
Location: Vancouver, WA

Re: How do you activate "borrowed" animations?

Unread postby Kali » Sun Dec 04, 2011 9:44 am

OK, I've been able to take a quick look at the DP files, but not actually mess around; the beacon seems to be in three parts:

* Animset animation, just like every other exterior anim
* relevant section in the RotaryLight control - and now I know how to turn continuous anims on and off at least. That will start & stop the animation itself.
* child object with a parent node of rotary_beacon - this is new and I'm not terribly sure how it works. At a guess I'd say the child offsets itself from a node rather than origin of the model which is why you don't have a matrix; I don't know what the child actually is, whether it's an emitter or a physical model? also don't know if the animation rotates the node it's attached to, I suspect it probably does.

Tieing child objects to nodes is awesome! no more mucking about aligning stuff and I think you can now attach things to bogies also. Admittedly all speculation given lack of docs and examples...

How does this help you attach one to a GP38? not at all. I'll go as far as to say you can't, you'll have to make your own.
Kali
 
Posts: 1600
Joined: Mon Mar 14, 2011 1:00 am
Location: England-by-Sea

Re: How do you activate "borrowed" animations?

Unread postby PapaXpress » Sun Dec 04, 2011 12:54 pm

Mike and I started a conversation with Ricksan on a related subject (we wanted his insight on occilating lights). His response is quite lengthy so I can't copy it all in here (at least not until I am at my desktop), but I think this section is relvant with your findings. Mind, that I just got this yesterday and I didn't realize you were looking at this or I would have shared it sooner.

Ricksan via email wrote:... In the Children block of the blueprint I added a spotlight and named it Fwd_Headlight_2. As with the light-glow quads, there's also a Fwd_Headlight_1 child for the stationary headlight. (As you may know, the naming of these children must be just so in order for the game engine to recognize them for what they are. Contact me if you need more information about this.) The important thing to note about Fwd_Headlight_2 is the entry titled Parent node name. It's here that I specify the animated light-glow quad's name, lights02_fwdhead.

If you've worked with child objects in the Asset Editor before, you know that usually they're initially are located at 0,0,0 and you have to drag them to their final position. When you save and quit, the lateral and rotational offset coordinates of the final position are added in matrix format to the blueprint XML file. You can tweak those coordinates in a text editor if need be and then re-export. In the case of a child that's parented to a node, the initial position in the Asset Editor is at the parent node's location. You still will probably have to rotate or translate the spot light to get it where it should be.

There are two RW bugs to deal with. First, no matter how smoothly and perfectly you have modeled the animation, it won't necessarily export that way. You may see jumps in the final animation. It appears the exporter has a problem with small angular rotations, but if I exaggerate the rotation a bit -- i.e. use wider angles -- the resulting export will be smoother. The other thing I've noticed is that after you've so carefully positioned the spot light in the Asset Editor, the next time you run the AE the spot light will be somewhere else -- nearby but not exactly where you originally put it. All you can do is try and get it as close as possible to where you want it. Ultimately, I "buried" the oscillating projected light within the main, stationary projected light so these discrepancies are less noticeable. ...
Image
"Just post some random unrelated text. We have members here who can help you with that." ~ Chacal
"When all else fails, read the instructions... if that doesn't work either, try following them." ~ Old Prof
Image
The Grade Crossing - Atlanta North Project - Virtual Rail Creations
User avatar
PapaXpress
 
Posts: 5147
Joined: Sat Oct 23, 2010 10:30 pm
Location: that "other" timezone


Return to Rolling-Stock Design

Who is online

Users browsing this forum: No registered users and 4 guests

cron