Allowing user to cancel walking towards a location that triggers a cut-scene

  • #1, by F_KalFriday, 17. February 2017, 04:01 3 years ago
    When the user left_clicks on a trailing path (that happens to be outside the way border region) the character first walks towards it (crossing outside the way borders) and then starts treading the path while the view gradually fades out before the new scene appears.

    I've implemented it as follows (it works but not sure if it's optimal):
    1. I created a second way system that contains the trailing path and a small overlapping area with the primary way-system.
    2. I send the character towards the overlapping area of the two way-systems (by supplying coordinates)
    3. I wait for the character to finish moving
    4. I switch to the trailing-path's way system
    5. I set the fade effect into fade out with duration 3000ms
    5. Now I send the character to the other end of the path without waiting for him to reach destination
    6. I trigger the scene switching

    Any bad practices you can see in the above method?

    My problem lies in the the following:
    I want to avoid initiating a cutscene(hiding the cursor) when the user left_clicks on the path. The path may be on the other side of the screen, so I'd rather take control away from the user only at the moment he crosses outside the way borders (enters the path and the fadeout sequence starts) but not before. 
    But I'm not sure how to do that. Any tips?

    Thank you!
    -Fotis

    Forum Fan

    107 Posts


  • #2, by sebastianFriday, 17. February 2017, 09:43 3 years ago
    actually it should trigger the action when the character reaches its object destination unless you set the action triggering to "immediately". 

    could you make a screenshot of the action which triggers the cutscene, please?  

    Thread Captain

    2336 Posts

  • #3, by F_KalFriday, 17. February 2017, 13:14 3 years ago
    Ah Sebastian! Such silliness, I didn't even test it - I assumed right off the bat that it wouldn't work! 

    Now that I understand a bit more, it seems that my script(image attached) had unnecessary steps. I didn't need to manually send my character to the entrance of the path. The character would have already gone there, thanks to the coordinates defined by the alignment of the character to the object setting. And apparently the action gets executed only after the character gets there - isn't it so?

    Now an interesting question would be - how can you interact with a scene object without triggering the character to move in order to align to the object? 
    (eg. the user left_clicks on a remote mountain in the background and the character makes a remark without walking first)

    Thanks again!
    -Fotis

    Forum Fan

    107 Posts

  • #4, by afrlmeFriday, 17. February 2017, 13:53 3 years ago
    It's best if you leave observation/examine type display texts to your examine command or right mouse click.

    One thing you could do is in the mouse over action check a condition then set another command (not a good idea to have both immediate & destination actions for same command inside of a scene object/characters action list because it will always trigger the immediate one instead - same goes for left click immediate action. Anyway, my point is that you could on mouse over query a condition or value & then set a command accordingly which you can then use to trigger certain actions. Now, what you could do is have it call the destination command action block at the end of the immediate command executed action block.

    Sorry if this is not making much sense. Don't seem to have my wordsmith hat on the day. I use this method a lot for when I want the player to be able to trigger an observation display text on a scene object with both right click & my standard left click command. It's useful because I only have to create the relevant action parts once & then I can use the call action action part to call either the command or right click action block.

    Imperator

    6805 Posts

  • #5, by F_KalSaturday, 18. February 2017, 04:03 3 years ago
    Thanks for the feedback AFRLme; while trying to understand your reply I realized that I wasn't clear on the difference between destination actions and immediate actions. It all falls to place now! Initially I hadn't noticed that both Destination and Immediate actions offer an Execute Command on the Object action - (Sebastian had mentioned it earlier but somehow it didn't sink in). Now this clarified both my initial question and the later one - Destination actions make my character walk and align to the target object before execution of the supplied action block, while immediate actions will execute the actions on the spot. Answering the second question, if I wanted to just look at the mountain without walking all the way there, I just had to write my actions inside an immediate command block (and not a destination one as I did).

    I understand your suggestion that it is "better to  leave the looking actions for the right mouse button/examine command". But if you must (eg. the mountain pass is covered in mist, but it occasionally clears - if you click on it when it's clear you start walking the path, if you click on it when it's misty, you make a remark about Eldritch varops lurking and stay where you are) then you say that I should avoid having both an immediate and a destination interfrace commands since the immediate always overrides the destination one. So far so good!

    Now the next part please feel free to leave unanswered; it's me trying to sqeeze more theoretical understanding - but it's not something I *need to know* at this time, I'm past my initial obstacle at the time of writing.

    You went a bit further in your explanation- You tried to answer the what if I wanted sometimes to look first and then walk towards the mountain; while other times only look at it. Yet Both times using the same mouse button. Did I get it right?
    While this was not my initial concern (the display text actions were there merely for debugging purposes) I'd like to understand your tip a bit better.

    So your suggestion boils down to this: use multiple interface commands and  swap/rewire them (via set cursor/set command). The swapping is based on criteria and is performed whenever the cursor enters the target object area (on mouse over). Is that what you meant?

    I also understood the usefulness of using the call action part inside another action in order to avoid doing twice the job if they share something in common; but to be honest I didn't quite catch the trick with triggering/calling a destination action block  from within an immediate command block...

    Thanks again for helping me out!

    Forum Fan

    107 Posts

  • #6, by afrlmeSaturday, 18. February 2017, 12:36 3 years ago
    What you have said more or less sounds about right to me.

    & sorry. It's sometimes hard to explain things with words alone & I often forget not everyone speaks English as their primary language & it doesn't help that I tend to ramble on a bit.

    Anyway, yeah basically you could check a condition or value on mouse enters an object to determine if x or y command should be set. I've had to do this myself sometimes as I've wanted to trigger certain specific actions or show a specific cursor depending on if player has already interacted with an object before. Let's say that I want the player to be able to use a scene object, maybe twist a water valve or move a box, so what I would do is on mouse over initially show the use cursor, but if player has already interacted with the object then I want to show the examine/look cursor instead.

    A more complicated thing for me was needing multiple object interaction positions for the same object. In 4.x & below (no idea about 5.x) it's not possible to update the interaction position with action parts or Lua script, so I ended up having to create multiple scene objects layers on top of each other with different interaction positions. The top most layer checks which command/item I'm currently holding then updated a condition or multiple conditions to hide the current object & show the one I wanted to interact with. It was a pain to rig up & would have been so much easier & less time consuming if I could have just updated the interaction positition with a single line of Lua script. It annoyed me to no end.

    Imperator

    6805 Posts

  • #7, by F_KalSaturday, 18. February 2017, 14:55 3 years ago
    thanks @AFRLme for explaining (and adding that last workaround for updating the interaction position - )! 

    Your efforts are much appreciated - Tell me about having a hard time explaining things with words alone! I'm apparently a non-native speaker but even in my native tongue I have difficulties getting simple meanings across without making them into lengthy convoluted word puzzles. I had a teacher who stricktly forbade me to place more than seven words in a sentence. For a time it worked. But now I am in my mid thirties. And now he's not around anymore. And he can't force me to use these horrible periods. And now I'm free to torture others on the web. With words.

    Those who are kind enough to reply to my posts.

    Thanks again :-)

    Forum Fan

    107 Posts

Write post