Treppengeländer, Sichtbarkeit Hero/Grafik austauschen

  • #1, by MooreelMonday, 17. February 2014, 21:58 11 years ago
    Guten Abend,

    ich arbeite erst seit kurzem mit der Engine bin aber begeistert ob der Einfachheit die trotzdem große Komplexität ermöglicht.
    Deponia hat gezeigt was zustande gebracht werden kann und ich bin mir sicher mein Projekt mit dieser Engine zu entwickeln.

    Zwei Fragen

    1) Angenommen man hat eine Computer an/aus Grafik. Gibt es außer per LUA und 2 Objekten in der Szene(ein OBJ_PC_ON und eins PC_OFF) welches man per Sichtbarkeit mittels Aktion ausschaltet eine Möglichkeit die Grafik umzuschalten?
    Zuerst dachte ich ich könnte eine Animation mit 2 Bildern dem Objekt hinzufügen mit der ON und der OFF Grafik und dann simpel den bestimmten Frame anzeigen, hab dafür aber keine Möglichkeit gefunden(und auch nicht die Animation einmal verkehrt und einmal normal abzuspielen hat leider nicht geholfen da sie zurückgesetzt wird).
    Gibt es da eine intuitivere Möglichkeit als die obengenannten, die Grafik im laufenden Spiel zu ändern? Ansonsten wäre eine neue Aktion mit der man einen bestimmten Frame anzeigt spitze.

    2) Ist mein Ansatz ein Treppengeländer auf png alpha Grafikebene transparent zu machen(also die Zwischenräume des Geländers) der richtige?
    Oder kann man das auch in der Engine irgendwie hinbekommen? Das ein Bereich durchsichtig wird damit man nicht ein eigenes Objekt für die Treppe machen muss?

    Vielen Dank für jede Hilfe und einen schönen Abend!

    Nico

    Newbie

    5 Posts


  • #2, by afrlmeMonday, 17. February 2014, 22:14 11 years ago
    1a. you can create multiple animations for objects/buttons etc & define a default animation or none at all. using the animation > play/hide animation action part, you can tell the engine which animation to play or hide/stop.

    1b. you can also force frames with Lua using "VAnimationFirstFrame" & "VAnimationLastFrame" - using these 2 data structure commands, you can force the animation to play between a & b values you assigned.
    -- animation will play between frames 2 to 5...
    getObject("ActiveAnimations[animation_name]"):setValue(VAnimationFirstFrame, 2)
    getObject("ActiveAnimations[animation_name]"):setValue(VAnimationLastFrame, 5)
    


    1c. you could also use 2 separate objects & assign a condition to the properties tab for both (one with the negate button ticked) & then you can switch between which object is active by changing the condition value between true & false.

    2. Sorry, not sure what to say here... The translation from bing isn't making much sense to me.

    Imperator

    7278 Posts

  • #3, by MooreelMonday, 17. February 2014, 22:20 11 years ago
    Sorry for writing the post in german and many thanks for your very fast response.

    Ah, thats true, i think 1a is a good way to go("animation" with just one frame ON/OFF then).


    My second question was about finding the best way to have a stair-rail looking good in game, so that only parts of my hero character are shown when walking up the stairs.

    I probably have to create a whole stair object image with the right alpha areas, right?

    many thanks
    Nico

    Newbie

    5 Posts

  • #4, by afrlmeMonday, 17. February 2014, 23:19 11 years ago
    no problem. smile

    1. you need to make sure the animation is set to infinite loop if you intend to have it constantly displayed while it's playing otherwise it unloads after it reaches the loop amount.

    2. you would most likely do this by chopping up the stairs graphic into tiles/layers (if you like) & then assigning each tile into a scene object & setting the object center for each piece to determine if character should be in front of, behind it, or walkable. hopefully this makes sense to you?

    Imperator

    7278 Posts

  • #5, by MooreelMonday, 17. February 2014, 23:23 11 years ago
    Hi,

    ad 1) thanks for mentioning, i will do so.
    ad 2) it does. Great :- )

    Many thanks for your help!

    Newbie

    5 Posts

  • #6, by afrlmeMonday, 17. February 2014, 23:52 11 years ago
    welcome smile

    Imperator

    7278 Posts