Smooth Character turning / Natürlich Charakterdrehung

  • #1, by Lord7evenThursday, 21. August 2014, 15:04 10 years ago
    Hi everyone

    I'm still not that experienced in Visionaire Studio but my game is getting biger and the puzzles more complex.
    I'm sadly new to LUA but I've got knowledge in Java, PHP and other languages. I red something about smooth character turning via LUA script and that there might be a hook function for this. I also searched the forum and templates for scripts to solve this problem. I found several small scripts to determinate where an object is or which object underneath the cursor is but I have no idea how to merge all together.

    The best solution for me would be a hook function for the action "turn person" (Person ausrichten in German). So if the person is looking to the left and I click an object right of the person, the person first turns to the front and then to the right.
    Till now I solved this with action areas and complicated if, else statements without any LUA script but this way it's a pain in the ***.

    Does anyone knows how to get it to work with LUA?

    ----------------------------------------------------------------------------------------------------------------

    Hallo zusammen

    Ich bin noch nicht sehr erfahren in Visionaire Studio aber mein Spiel wird grösser und die Puzzles komplexer.
    Leider habe ich noch keine LUA Erfahrungen aber ich kenne mich mit Java, PHP und anderen Programmiersprachen aus. Ich las etwas darüber, natürliche Charakterdrehung via LUA Script und dass es vermutlich eine hook Funktion für das gibt. Ich durchsuchte das Forum nach Scriptbeispielen um dieses Problem zu lösen. Ich fand einige kleine Scripts um zu definieren, wo sich ein Objekt befindet oder welches Objekt sich unterhalb des Cursors befindet aber ich habe keine Ahnung wie ich alles zusammensetzen soll.

    Die beste Lösung für mich wäre eine hook Funktion für die Aktion "Person ausrichten". Damit, wenn die Person nach links schaut und ich ein Objekt rechts von der Person anklicke, sich die Person erst nach vorne und dann nach rechts dreht.
    Bisher habe ich das mit Actionareas und komplizierten if, else Abfragen, ohne LUA Script, gelöst. Aber auf diese Weise wird es sehr mühsam.

    Weiss jemand wie man das ganze mit LUA zum laufen bekommt?

    Newbie

    40 Posts


  • #2, by afrlmeThursday, 21. August 2014, 18:29 10 years ago
    I'm still waiting on Alex to create an hook function to make this a bit simpler. I'm sure I could probably write a function myself that could be added as a definition script but it would definitely be much easier if it could be added to a premade hook that listens out for character states, direction current & next direction etc.

    Imperator

    7278 Posts

  • #3, by vectracocoFriday, 22. August 2014, 11:40 10 years ago
    Those so sharp turns are very annoying. Especially in high resolution games.
    It would be wonderful to find an appropriate solution turn or change direction.

    Newbie

    19 Posts

  • #4, by vectracocoFriday, 22. August 2014, 11:53 10 years ago
    Adventure game studio has is option to turn and it seems that it is very nice.

    Wintermute think it also has something similar.

    Visionaire is superior in everything else. I think the turn of character is
    the only thing missing. Games earn much quality in that detail.

    By the way, the new shaders follow character, camera scrolling, etc... are super amazing. Visionaire is great!

    wink

    Newbie

    19 Posts

  • #5, by HasuakSaturday, 06. September 2014, 05:09 10 years ago
    Bump for great justice.

    Newbie

    26 Posts

  • #6, by MehrdadMonday, 22. September 2014, 07:29 10 years ago
    This is a main reason for me that I don't work with Visionaire yet. I'm 2D animator and actually I want show my artworks at best situation.
    Alex said 4 months before for add this feature to engine.
    Adventure Game Studio use same South-East +Down + South- West for turn to right and use North-West and......for left operation . I think it's enough for show a turn.Is it really hard?

    Newbie

    39 Posts

  • #7, by afrlmeMonday, 22. September 2014, 12:46 10 years ago
    maybe... or maybe they've just been busy working on other features... for me a simple hook that could be triggered on new destination & destination reached would be enough to sort out some character start/stop/turn transitions, I believe, but this is just in theory.

    Imperator

    7278 Posts

  • #8, by MachtnixMonday, 22. September 2014, 17:03 10 years ago
    I'm not sure about picking up particular frames in an animation. But if I can do this (maybe by LUA script) I would create an 360° animation with the character on a turntable. F.e.: in frame 1 the person has an angle of 0°, in frame 12 an angle of 90°. For a turn from 0 to 90° I have to start a little animation with frame 1 and end with frame 12. The problem is: you have to pick up all actions with items and objects or walks into other directions. I don't know how...

    I tried to use a blowing dress. The character starts running from his idle or standing pose with 3 or 4 frames blowing the cloth and he stops with 3 or 4 frames again. You can do the same with turns. But it's a lot of work ;-)

    Machtnix

    Thread Captain

    1097 Posts

  • #9, by afrlmeMonday, 22. September 2014, 17:11 10 years ago
    I tried to do starting, stopping & individual leg animations by controlling the active frames or via character animation index. It sorted of worked but not as well as I would have liked.

    Ideally as I mentioned: a simple hook function that registers begin, end & new destination would work quite well.

    Imperator

    7278 Posts

  • #10, by MachtnixMonday, 22. September 2014, 17:30 10 years ago
    I tried to do starting, stopping & individual leg animations by controlling the active frames or via character animation index. It sorted of worked but not as well as I would have liked.

    Ideally as I mentioned: a simple hook function that registers begin, end & new destination would work quite well.


    I think that would be the best solution: you call a LUA function on every movement. On mouseclick the function picks up the target coordinates and compare them with your current position. Depending on your gimbal lock (shortest turn way) the function decides to turn left or right into the finale angle.
    I think, AFRLme, you need 10 minutes for this, do you..? ;-) ;-)
    I need 10 weeks....

    Machtnix

    Thread Captain

    1097 Posts

  • #11, by afrlmeMonday, 22. September 2014, 17:39 10 years ago
    I don't know how long it would take me to me write functions for this but first things first would be for the devs to create the internal hook function code.

    Otherwise it means we have to mess about ourselves creating loops to listen out for the various character states, main character is no problem but things start getting more complicated if you take any npc characters into account that move around the screen.

    Imperator

    7278 Posts