Smooth Character turning / Natürlich Charakterdrehung

  • #60, by TinTinSunday, 31. January 2016, 14:07 5 years ago
    Sorry for old topic
    It's nice script and helpful.
    How can I get optimize this script for 12 directions ? Is it possible ?

    Forum Fan

    194 Posts


  • #61, by Lord7evenMonday, 01. February 2016, 17:09 5 years ago
    Set the below variable to each direction the character can turn to, starting with the largest number.
    You can set multiple characters with different amount of direction.
    Examples:
    smt_animation = {Car = {315, 270, 225, 180, 135, 90, 45, 0}}
    smt_animation = {Hero = {270, 180, 90, 0}, Car = {315, 270, 225, 180, 135, 90, 45, 0}}
    1
    2
    3
    4
    5
    6


    In this section of the code (variables definition script) you can add as many directions you want. The script should be able to handle as many directions as you want. In the example the heroe has 4 directions and the car has 8. It should be also possible to have characters with different amount of turning directions. Your main character can have 12 directions and others can have X.
    I'm not currently working on Visionaire Scripts, but let me know if I'm wrong.

    WARNING!!!
    If you use this turning script, be aware that there are some problems with sending characters to a destination! The command "wait until character reaches his destination" will be triggered every time the turning script turns the character for 1 anamition. So if you have a cutscene with a character walking from A to B, be sure to insert enought "wait until character reches its destination" otherwise the action that should happen on point B will trigger to early... (Turning from 0° to 180° with 4 direction animations needs 2 "wait until character..." in order to work correctly in a cutscene or scriptet action.)

    I hope you know what I mean ;-)

    Newbie

    40 Posts

  • #62, by TinTinMonday, 01. February 2016, 18:34 5 years ago
    OK thanks for reply
    For testing I made 330 direction and added it to script
    smt_animation = {Hero = {330,315, 270, 225, 180, 135, 90, 45, 0}
    smt_turningAniNames = {Hero = {"character_turn_330","character_turn_315", "character_turn_270",........
    1
    2
    3

    And works perfect.
    But I didn't exactly understand for "wait until character reaches his destination"
    command .Where is this command in your example for change amount it?

    Forum Fan

    194 Posts

  • #63, by Lord7evenMonday, 01. February 2016, 18:52 5 years ago
    This command is in Visionaire itself. You only need it if you setup some (complex) cutscenes or so. I have a character that should walk to a door, open it, and leave the room. the character has to turn with the turning-script. And while walking to the door, there is another character that says something after 2 secends of that walk from the first character.... In order to do this I had the following actions (I don't exactly know the english names):

    1. move character X to door - don't wait until character arrives.
    2. wait 2 seconds
    3. display speach text from character Y
    4. wait until character X arrives. <--
    5. play animation for character X (open door)

    now the door open animation will be played to early because "wait until character X arrives" just waits until the character turned 1 direction in the script... if the character doesn't turn at all then the actions above work, but I had to include this "wait until..." 2 more times because the character x turns from 90° to 135° to 180° before it should play the open-door animation.

    maybe a better way to say this is that the turning script, triggers the "character reched its destination" after 1 turning animation(frame) has played. If you have actions that must wait till a character reched its destination, then just add a couple of "wait until character X arrived at his destination" and you should be fine.

    Hope you undestand my bad english... ;-)

    Newbie

    40 Posts

  • #64, by TinTinMonday, 01. February 2016, 19:14 5 years ago
    I think so got it .
    Can we use Align character for face direction to door (for finish turning animation) and then play animation open the door?

    Forum Fan

    194 Posts

  • #65, by sebastianMonday, 01. February 2016, 20:11 5 years ago
    Maybe you could solve this with a good animation. smile I'm currently doing some tests with a new version of the script and it seems to work. But need some more time to test, though...

    Any news about this "new version"?

    Thread Captain

    2343 Posts

  • #66, by TinTinThursday, 19. May 2016, 07:37 5 years ago
    Sorry again for up old topic.
    I still don't understand that is 12 direction complete safety for handle this turn script?
    I want animate it today

    Forum Fan

    194 Posts

  • #67, by sebastianThursday, 19. May 2016, 08:21 5 years ago
    Theoretically yes.

    You have to set the 12 directions in visionaire itself. Even without this script it should be possible to let person face into more than 4 or 8 directions.
    As far as i understand you have to add the "more" directions in the explorer (ctrl+e).

    This script here only let the person you defined turn then smoothly between the startpoint and the next direction before he begins to walk. You have to add all directions you want the script to handle into the table of the script, so it knows what animation to call...

    Thread Captain

    2343 Posts

Write post