Door animation help! (Solved)

Willkommen in der Transport Fever Community

Wir begrüßen euch in der Fan-Community zu den Spielen Transport Fever und Train Fever, den Wirtschaftssimulatoren von Urban Games. Die Community steht euch kostenlos zur Verfügung damit ihr euch über das Spiel austauschen und informieren könnt. Wir pflegen hier einen freundlichen und sachlichen Umgang untereinander und unser Team steht euch in allen Fragen gerne beiseite.

 

Die Registrierung und Nutzung ist selbstverständlich kostenlos.

 

Wir wünschen euch viel Spaß und hoffen auf rege Beteiligung.

Das Team der Transport-Fever Community


  • That are the IDs of the meshes you want to animate. The game throws different events wich you can use to trigger animations. If a train stops in a station with the platform to its left, the game will throw the event open_doors_left. All passengers will leave and then the next will enter and then the event close_doors_left comes. So your door has the ID 2, then you call it with [2]. With name you access a specified animation of that mesh.


    Hmm... You can use Antons ID Counter Tool, wich is a great help: TF ID Counter


    Open your mdl with it and have a look, which mesh has ID 2 or 5. Then open that .msh file and have a look at the start of the file. There should be an animations block. Im pretty sure, you will find animations named open1 or open2 ;)


    The forward parameter lets you declare if the animation is played forward or backward. Lets have the simple door-animation closed = rotation 0°, open = rotation 90°. You dont need to define a closing animation, you simply call the open-animation again, with forward = false - thats it. Sometimes you need explizit closing animations, but in most and simple cases open backwards is enough.


    Hope that helps you a bit to understand this. Feel free to ask again :)

  • Exactly :) You know what an array is? See the Meshes as a list/array and you gain access to its members via array[id] ;) The same here. Only difference is, that you start at 1 instead of 0. Well, its not completely correct. 0 is the calling file itself. So lets say you have a group. That group can have an animation-block too. Also it can react to events. So you say event open [0] = open1 and so on, then you access the groups animation block. You can use my railway gate as example - or any bus with a ... hinge? >< The AG300 or AGG300 or any other.

  • A small correction: You don't have to use the ID-Counter in that case, you can just use the index inside the children list (starting at 1 as alreay mentioned). If you want to animate a mesh inside a group, you have to call an event of that group, which then calls the animation of the mesh.

  • Thanks for the explaining, I am not sure I fully understand the last bit but I guess you mean the animation-block could do something like a Ferris wheel. I can do a rotate animation for the whole group and also rotate each car inside that group, right?

  • Right.


    You can animate a group consisting of various meshes/groups, basically treating the group as one single part animation-wise. All the included parts can then receive their own individual animations which they will show while being dragged along by the animated group.


    This takes a structured approach though.


    1. Declare the required animations in the .grp and all included meshes/subgroups.


    2. In the .grp, call up all the animations to the meshes/subgroups, adressing them by their sequence number. Also call up the group animation; this requires a recursion to the file itself. The sequence number of a file is 0. I´ll add a code example later to make it clearer.


    3. Have the .grps animation called from the .mdl file. Take care to properly name the animations - misnaming them is an easily made error and will cause the game and the model viewer to crash without any comment.


    This is a fairly simple .grp file that animates the inner main gear doors on my Boeing 707. These doors consist of 2 parts and fold in the middle when opening.


    Lines 1 to 30 define the animation that is applied to the entire group and name it "HF_Tuer_1".


    The animations are called up starting in line 46. In the mdl, a call for an animation named "close_wheels" is sent to the .grp. This animation is then defined in lines 47 to 56. [0], as already mentioned, calls back to the .grp file itself and the animation defined earlier. Part number 1 would be the inner gear door that is simply moving with the group and holds no animation of its own, so it needs not be called up here. Part number 2 is the outer gear door that folds during the groups movement, so it has an animation defined in its .msh file that is called up from here.


    "Open_wheels" simply calls for the same animations, but played backwards during gear extension. This is achieved by the line "forward=false", causing the animation to start at the end.

    Einmal editiert, zuletzt von DH-106 ()

BlueBrixx