Jump to content

How to adjust height (Z...) with Lua...


Empfohlene Beiträge

Good afternoon...

I wish to land a Zeppelin. I have one, flying slowly around my version of the 'Huge' layout, carried on the back of an invisible tram around an invisible track. I could have an invisible track taking the tram, with the Zeppelin, down to the ground, but the airship would be pointing down. I wish to have it horizontal at all times. My solution would be to change the 'Z' position of the Zeppelin, using Lua, but I don't know how to address this property. I think I can handle the 'loop' part of decrementing the 'Z' value; my question is therefore...
How to change the 'Z' property of a vehicle..? Thanks in advance for any assistance offered.

Guten Tag...

Ich möchte einen Zeppelin landen. Ich habe eine, die langsam um meine Version des 'Huge'-Layouts herumfliegt und auf der Rückseite einer unsichtbaren Straßenbahn um eine unsichtbare Strecke herumgetragen wird. Ich könnte eine unsichtbare Spur haben, die die Straßenbahn mit dem Zeppelin zu Boden bringt, aber das Luftschiff würde nach unten zeigen. Ich möchte es jederzeit horizontal haben. Meine Lösung wäre, die 'Z'-Position des Zeppelins mit Lua zu ändern, aber ich weiß nicht, wie ich diese Eigenschaft ansprechen soll. Ich denke, ich kann den 'Schleifen'-Teil der Dekrementierung des' Z'-Werts bewältigen. meine frage ist also ...
Wie ändere ich die 'Z'-Eigenschaft eines Fahrzeugs? Vielen Dank im Voraus für jede angebotene Unterstützung.

Douglas

Link zu diesem Kommentar
Auf anderen Seiten teilen

vor 5 Minuten schrieb Dad3353:

My solution would be to change the 'Z' position of the Zeppelin, using Lua, but I don't know how to address this property.

The position is addressed like thus:
 

vehicle.transformation.position = {x=0, y=0, z=0}
-- resp.
vehicle.transformation.position.z = 0

 

But in my opinion, it would be better to drive an invisible vehicle down a track and attach your blimp carrier to that vehicle.
Because your blimp carrier won't tilt, if you tilt the invisible track first and then attach your blimp to the invisible vehicle upon.

Link zu diesem Kommentar
Auf anderen Seiten teilen

37 minutes ago, Goetz said:

...Because your blimp carrier won't tilt, if you tilt the invisible track first and then attach your blimp to the invisible vehicle upon.

Thanks for the 'transformation' info; always useful.

Here's my Height Test layout; the Blimp tilts once we start the descent. I suppose I could have some level track, and a separate tilted track, and change the attachment from one to the other for the descent. Would that work..? Hmm...

Vielen Dank für die 'Transformation' Info; immer nützlich.

Hier ist mein Layout für den Höhentest. Das Luftschiff kippt, sobald wir den Abstieg beginnen. Ich nehme an, ich könnte eine ebene Spur und eine separate geneigte Spur haben und die Befestigung für den Abstieg von einer zur anderen ändern. Funktioniert das..? Hmm ...

Heig_Test_01.mbp

I'll try the 'Z' trick, just the same.

Ich werde trotzdem den 'Z'-Trick ausprobieren.

Bearbeitet von Dad3353
Link zu diesem Kommentar
Auf anderen Seiten teilen

vor 2 Minuten schrieb Dad3353:

I suppose I could have some level track, and a separate tilted track

Indeed, that would do the trick: staggered tracks, each in itself straight

But don't change the attachment. Instead, let one track carry and move the other. The resting place will vary a bit from one run to the next, but with the blimp, that may be sufficient?

(haven't seen your example yet. Thet's next ...)

Link zu diesem Kommentar
Auf anderen Seiten teilen

and here's my attempt at using to coupled tracks:

0DA552F3-2864-4F19-8A84-5B890A3B03FF

I've published it as "experimental", rather than attaching it to the posting here, because that's how Neo prefers it.
These experimental layouts vanish after 30 days. So you may want to store your own copy locally.

Link zu diesem Kommentar
Auf anderen Seiten teilen

28 minutes ago, Goetz said:

and here's my attempt at using to coupled tracks:...

This works perfectly. I see what you've done, but I can't see what you've done..! The carriers are fine, but the splines..? They remain invisible. How are they created/edited..?

My current Zeppelin is on standard, but invisible, track. Can I convert this to spline, and, if so, how to see and edit it..?

I'll do a similar set-up using ordinary rail track, just to see how it'll work (it's just like the 'Helicopter' example, it seems...). Thanks for the effort so far; it's much appreciated.

(Meanwhile, I'm not building the model aircraft I'm supposed to be making for Our Eldest..! :$ )

Das funktioniert perfekt. Ich sehe, was du getan hast, aber ich kann nicht sehen, was du getan hast ..! Die Träger sind in Ordnung, aber die Splines ..? Sie bleiben unsichtbar. Wie werden sie erstellt / bearbeitet?

Mein aktueller Zeppelin ist auf Standard, aber unsichtbar. Kann ich dies in Spline konvertieren und wenn ja, wie kann ich es sehen und bearbeiten?

Ich werde ein ähnliches Setup auf einer normalen Schiene durchführen, um zu sehen, wie es funktioniert (es scheint genau wie das Beispiel 'Hubschrauber' ...). Vielen Dank für die bisherige Anstrengung; es wird sehr geschätzt.

(In der Zwischenzeit baue ich nicht das Modellflugzeug, das ich für Our Eldest bauen soll ..! :$ )

Douglas

Link zu diesem Kommentar
Auf anderen Seiten teilen

Hallo / Hello @Dad3353,

Du kannst auch folgenden Trick benutzen:
You can also use the following trick:

Positioniere exakt neben dem Fahrzeug, mit dem Du den Zeppelin antreibst, eine Benutzer-Kamera, verknüpfe sie mit dem Fahrzeug und lasse sie immer auf dieses Fahrzeug zeigen (auf das Fahrzeug fixieren). Den Zeppelin, der sich genau über diesem als "Antrieb" benutzten Fahrzeug befindet, verknüpfst Du nun nicht mit diesem Fahrzeug, sondern mit der Kamera. Die Kamera selbst muss sich genau seitlich neben dem angetriebenen Fahrzzeug und exakt auf dessen Höhe befinden. So ist gewährleistet, dass die Kamera unabhängig davon, ob sich das Fahrzeug in der Horizontale oder in einer Steigung bewegt, immer genau horizontal auf das angetriebene Fahrzeug für den Zeppelin ausgerichtet ist (die Kamera bleibt, wenn sich auf ein Ziel ausgerichtet ist, seitlich immer aufrecht).
Position a user camera exactly next to the vehicle you are using to power the zeppelin, link it to the vehicle and always have it pointing to that vehicle (fixate on the vehicle). The zeppelin, which is located exactly above this vehicle used as "drive", is now linked to the camera and not to this vehicle. The camera itself has to be exactly beside the driven vehicle and exactly on its height. This ensures that the camera is always aligned exactly horizontally with the powered vehicle for the zeppelin, regardless of whether the vehicle is moving horizontally or on an incline (the camera always remains laterally upright when aligned with a target).

Wenn nun der "Antrieb" für den Zeppelin in Bewegung gesetzt wird, bewegt sich der Zeppelin wie bisher automatisch mit, bleibt aber auch dann in horizontaler Position, wenn sich das antreibende Fahrzeug neigt (weil die Kamera, mit welcher der Zeppelin verknüpft ist, die Neigung des Fahrzeugs, mit dem die Kamera verknüpft ist, wegen der gleichzeitigen Fixierung nicht mitmacht).
If now the "drive" for the zeppelin is set in motion, the zeppelin moves automatically as before, but remains in a horizontal position even if the driving vehicle tilts (because the camera to which the zeppelin is linked does not follow the tilt of the vehicle to which the camera is linked due to the simultaneous fixation).

Als Anwendungsbeispiel für diese Technik findest Du hier eine Kleinkabinen-Seilbahn, bei der die Kabinen ebanfalls über diesen Mechanismus immer in gerader Position gehalten werden.
As an example for the application of this technique you will find here a small cabin ropeway, where the cabins are also kept in a straight position by this mechanism.

Viele Grüße / Many Greetings
BahnLand

 

 

Bearbeitet von BahnLand
Link zu diesem Kommentar
Auf anderen Seiten teilen

56 minutes ago, BahnLand said:

...Du kannst auch folgenden Trick benutzen:
You can also use the following trick: ...

This looks to be a very elegant solution; many thanks for the explanation, which makes perfect sense. I'll try it out now. 

Dies scheint eine sehr elegante Lösung zu sein. Vielen Dank für die Erklärung, die durchaus Sinn macht. Ich werde es jetzt ausprobieren.

R91KekF.gif

Edit This works nicely, and will be the easiest to adopt with my present circuit. I've noted the 'linked spline' track for later use. Now all that's left is to get the 'Z' method to work, which will be useful for many things.

Bearbeiten: Dies funktioniert gut und ist mit meiner derzeitigen Schaltung am einfachsten zu übernehmen. Ich habe die 'verknüpfte Spline'-Spur für die spätere Verwendung notiert. Jetzt müssen Sie nur noch die 'Z'-Methode zum Laufen bringen, was für viele Dinge nützlich sein wird.

Bearbeitet von Dad3353
Link zu diesem Kommentar
Auf anderen Seiten teilen

I finally decided to use the vertical spline method, much easier to implement on my existing layout. It now works fine, so thanks to all contributors. It'll be good to be able to manipulate the 'Z' axis, but it can wait, now that the Zeppelin lands and takes off nicely.

Ich entschied mich schließlich für die vertikale Spline-Methode, die in meinem vorhandenen Layout viel einfacher zu implementieren ist. Es funktioniert jetzt gut, also danke an alle Mitwirkenden. Es wird gut sein, die 'Z'-Achse manipulieren zu können, aber es kann warten, jetzt, wo der Zeppelin landet und gut abhebt.

R91KekF.gif

Link zu diesem Kommentar
Auf anderen Seiten teilen

Erstelle ein Benutzerkonto oder melde dich an, um zu kommentieren

Du musst ein Benutzerkonto besitzen, um einen Kommentar verfassen zu können

Benutzerkonto erstellen

Neues Benutzerkonto für unsere Community erstellen.

Neues Benutzerkonto erstellen

Anmelden

Du hast bereits ein Benutzerkonto? Melde dich hier an.

Jetzt anmelden
×
×
  • Neu erstellen...