[Solved] Gespeichertes Objekt wieder setzen?/Set saved object?

  • #1, by klockbox-1Tuesday, 13. March 2018, 12:30 6 years ago
    Moin!

    Ich sitze gerade vor einem kleinem Problem. Und zwar bin ich gerade dabei die Türen unseres Spiels so zu konfigurieren, das bei Mausbewegung in den Objektbereich immer der Standartbefehl gesetzt wird und beim Verlassen der vorherige Befehl wieder reaktiviert wird um zu verhindern, dass letztendlich Texte wie "Benutze In Richtung Mensa" erscheinen werden. Klappt soweit auch alles ganz klasse, nur komm ich jetzt nicht weiter, wenn es um "gezogene" Objekte geht (Benutzen ein SCUMM-like).
    Den Befehl "Gegenstand setzen" gibt es ja schon und der macht auch theoretisch genau das, was ich brauche. Problem nur, dass der Actionpart immer auf ein Objekt beschränkt ist.
    Ich habe es auch schon ein wenig mit Scripten versucht bin aber zu keinem Ergebnis gekommen.
    Kann ich irgendwie das ausgewählte Objekt speichern und später wieder abrufen?

    /

    Hi!
    (sorry for my english)
    I'm having a minor problem right now. Im trying to configurate the doors of our game to set the current command to "walk" when entering the object-area and to revert the command back to the former when leaving again. Its works currently with one exeption. We are using a SCUMM-like Interface and I can't find a way to revert back to a selected obj when hovering in and out of the door areas.
    The "Set Object"-Actionpart does theoretically exactly what I want it to, but its limited to one specific object.
    Can I somehow save the selected object and recall it later?

    Newbie

    27 Posts


  • #2, by stothewSunday, 18. March 2018, 16:13 6 years ago
    Hi!

    Wenn ich richtig verstanden habe was du meinst dann ist das problem das die "traged Items" duch das hovern über die Bereiche verworfen werden.

    Hierzu würde ich ein kleines Script ausführen das vorher testet ob man ein Item in der Hand hat. z.b. so
    if not game.UsedItem:isEmpty ()
    

    ich würde also bei "enter area" sagen "script ausführen" und dann den Befehl ersetzen oder auch nicht.

    Zu dem Thema auch sehr intressant ist das Tutorial von Sebastian:
    https://youtu.be/K3rytWt9Sss

    Hoffe ich konnte helfen

    Forum Fan

    127 Posts

  • #3, by stothewSunday, 18. March 2018, 22:23 6 years ago
    ich habe vergessen zu erwähnen benutze: "wenn Lua-Rückgabewert" für das script.

    Forum Fan

    127 Posts

  • #4, by klockbox-1Monday, 19. March 2018, 12:13 6 years ago
    Hi stothew!

    Erstmal danke für die Antwort.

    Das Problem ist nicht, dass die gezogenen Objekte verworfen werden - das ist beabsichtigt -, sondern, dass ich sie beim Verlassen des Aktionsbereich wieder aufrufen möchte.

    Ich will quasi sämtliche Interaktion mit den Türen verhindern, damit diese wirklich nur zum Verlassen benutzt werden können.

    Ich habe leider nur ein (hoffentlich "noch") sehr eingeschränktes Verständnis von Scripts, aber ich stelle mir vor, dass das irgendwie so aussehen müsste:

    (Actionparts)
    Zeiger in Aktionsbereich:
    Objekt Speichern
    Standardbefehl setzen

    Zeiger aus Aktionsbereich:
    Vorherigen Befehl setzten (bis hier hin hab ich schon alles eingerichtet)
    Gespeichertes Objekt (Falls vorhanden) wieder dem Benutzten-Befehl hinzufügen.

    Das Folgende ist natürlich völliger Humbug und klappt nicht, aber das müsste doch irgendwie so aussehen:

    if not game.SavedObject:isEmpty() then

    game.usedItem() = game.SavedObject()

    Kannst du mir eventuell sagen, wie ich das korrekt einrichte?

    MfG

    Tim

    Newbie

    27 Posts

  • #5, by afrlmeMonday, 19. March 2018, 12:52 6 years ago
    They aren't functions.

    :isEmpty() is a function.

    if not game.SavedObject:isEmpty() then
     game.UsedItem = game.SavedObject
    end


    P.S: I didn't read/translate your entire post. I just replied based on the script you added.

    Imperator

    7278 Posts

  • #6, by klockbox-1Monday, 19. March 2018, 13:43 6 years ago
    Hi AFRLme!

    Thanks for the correction.

    I actually said thats its nonsense, I just imagined that the script I need is probably going to somewhat look like this.
    Without the brackets I at least get a reaction ingame.
    Im trying to save an object from a combined-command when the command is changed to the walk command and to get it back when the Cursor leaves the objectarea.

    Well, now the door becomes the item in the combined command. But hey, its something.

    Newbie

    27 Posts

  • #7, by klockbox-1Monday, 19. March 2018, 13:49 6 years ago
    I think I got it now!
    I save the object when its selected in the inventory, and with the script I can get it back.

    Newbie

    27 Posts