[Vorschlag] Anpassung der Programmierung von Cursor verstecken/zeigen

  • #1, by andiThursday, 21. April 2022, 20:18 2 years ago
    Die Grundidee: 
    Die "Cursor verstecken/zeigen"-Programmierung in Visionaire Studio anpassen.

    Der Vorschlag im Detail:
    Wenn "Aktionstext bei Cursor anzeigen" aktiviert ist und anschließend irgendwo der Aktionsteil "Cursor verstecken" angewandt wird, führt automatisch vor dem Verstecken game.DrawActionText = 0 aus und wenn "Cursor zeigen" wieder angewandt wird, fügt eine Pause für 1 Millisekunde ein und wendet danach wieder game.DrawActionText = 1 an.

    Die Begründung anhand eines Beispiels:
    Ich möchte etwas ansehen. Die Person läuft zum Objekt und ich verstecke den Cursor, da gleich ein Dialog startet. Wie die Programmierer sicher wissen, sieht man den Cursor dann nicht, aber im Hintergrund ist er nach wie vor aktiv. Wenn ich also während des Dialogs aus dem Objektbereich komme und mein Cursor wieder auf default wechselt (da ich es so eingestellt habe), updated er diese Information (in der neues Version von Visionaire) erst dann, wenn er wieder angezeigt wird. Während dieser kurzen Zeit passiert es dann, dass, für den Bruchteil einer Sekunde, der alte Aktionstext des Posters (bei mir hier "Look at") angezeigt wird und erst dann updated er und wechselt zum Default-Cursor, da sich der Cursor nicht mehr auf dem Poster befindet. 

    Diese visuelle Ungereimtheit sieht man auch sehr gut bei der Deponia-Reihe. Ist dies ein großes Problem? Neee. Aber es sieht auf jeden Fall wesentlich hübscher aus und braucht vermutlich auch keine größere Codeanpassung. Ich zeig es mal im Video, was ich genau meine. Zuerst zeige ich dort die aktuelle Methode wenn ich nur "Cursor zeigen/verstecken" (siehe Code unten) verwende und danach "meine" angepasste Methode. Wäre cool, wenn das standardmäßig eingeführt werden könnte, sobald man den Cursor-Aktionsteil verwendet. Und übrigens danke für das Programm... es ist genial. =)

    Video:


    Code für normales Verhalten von Visionaire (im Video das erste Ansehen):

    Von mir angepasster Code (im Video das zweite Ansehen):



    Newbie

    4 Posts


  • #2, by afrlmeThursday, 21. April 2022, 22:40 2 years ago
    You could probably do that globally with a loop & a single variable & the setDelay function to reshow the action text. By the way did you know that you can assign a cursor that will shown whenever the hide cursor action part is executed or when any cutscene event that hides the cursor is triggered? You can assign it in the main game settings area of the editor, it's called "wait cursor" on the English version of the editor.

    Anyway, here's a quick example of a script that should do what you are asking for (add it as a definition type script)...

    local cutsceneState = false
    
    
    
    function checkCutsceneState()
    
     
    
      if (not game.CutsceneAction:isEmpty() or not game.CurrentText:isEmpty() or game.HideCursor) and not cutsceneState then
    
        cutsceneState = true -- update variable state to prevent looping (used to prevent setDelay function below from looping)
    
        game.DrawActionText = eDrawNoActionText -- hide action text
    
      elseif game.CutsceneAction:isEmpty() and game.CurrentText:isEmpty() and not game.HideCursor and cutsceneState then
    
        cutsceneState = false -- reset variable state
    
        setDelay(100, function() game.DrawActionText = eDrawActionTextAtCurrentPos end) -- enable action text after 100ms
    
      end    
    
    
    
    end
    
    
    
    registerEventHandler("mainLoop", "checkCutsceneState")

    Imperator

    7278 Posts

  • #3, by andiThursday, 21. April 2022, 23:38 2 years ago
    Oh, very interesting. Thank you! Your script fixes my main problem as shown in the video as well. The only problem is that after I look at the poster the first time the action text gone forever.

    Newbie

    4 Posts

  • #4, by afrlmeFriday, 22. April 2022, 01:30 2 years ago
    Sorry, there was a couple of typos. I updated the script in the previous post.

    Imperator

    7278 Posts

  • #5, by andiFriday, 22. April 2022, 08:20 2 years ago
    Amazing! This should be in the next Visionaire Engine by default. Thank you very much.

    Edit: Hm, okay. Almost! ^^ 

    It isn't working when the cursor has a another hotspot with text below after the cursor is restored again (flickering at stairs. It should always have the default command, but I can see for a moment the "look at" symbol. Actiontext seems to be good there, though): https://streamable.com/lq32n3

     

     
    Maybe you can help me with something else as well in form of a definition type script. When I look at the lookout the first time, the cursor enters the character area with the command "look at". But when I've talked to him before it should be the command "talk to". This is working well, but when I've looked at him and the cursor is still on him, the "talk to" command does not update automatically. So I have to leave the character area again and enter it. Is this fixable so it is updating instantly? 

    Video:

    Newbie

    4 Posts

  • #6, by afrlmeFriday, 22. April 2022, 17:50 2 years ago
    It could be to do with how you have setup your command interface. It's kind of hard to tell what the issue is from your videos, as all they are showing me is what's happening & not why.

    By the way, you will probably get a faster response on our discord server than on here, but it's up to you if you want to join that via here.

    Imperator

    7278 Posts

  • #7, by mulewaTuesday, 26. April 2022, 02:34 2 years ago
    Hey Andy,
    Darf man fragen von wo du die Source vom MonkeyIsland bekommen hast?

    Newbie

    21 Posts

  • #8, by afrlmeTuesday, 26. April 2022, 02:58 2 years ago
    Icons, etc seem to be from this: https://forums.scummvm.org/viewtopic.php?t=16331

    As for the backgrounds & game sprites you can find them easily by googling for them. Spriters resource & various other sites share ripped character sprites & game backgrounds for lots of old games.

    Imperator

    7278 Posts

  • #9, by andiFriday, 29. April 2022, 16:56 2 years ago
    Eigentlich ist nur der Kreis für die Befehle ein Icon von Monkey Island RECODED. Der Rest wurde von mir per LucasRipper und ScummEditor aus dem Originalspiel exportiert. Vom Laden von Sprites würde ich abraten, die haben oft nicht zu 100% die gleichen Bildeigenschaften und es fehlen Details. Bei LucasRipper am besten mit "True Color" alles extrahieren.

    Newbie

    4 Posts