Dark Inside Me, psychological horror adventure game - Trailer & Gameplays

  • #20, by AkcayKaraazmakThursday, 18. December 2014, 14:47 10 years ago
    @Simon, hey mate it worked very well, thank you realy. But how I may I use the character'a 3d turning data frames when characters is turning. Because now its just turning on its pivot, without character real turn animation.
    Lets say I have the walking animation 0-20 and turn is 21-30. So how I can play the frames 21-30 when the character turns with your script?

    Thank you very much!!!

    Great Poster

    440 Posts


  • #21, by afrlmeThursday, 18. December 2014, 15:25 10 years ago
    I think Simon's script is using the idle animations no?

    To customize the idle animation for the rotation you could:

    1. tack a frame onto the end of each idle animation, that you want use for the rotation frame
    2. activate set pause for each frame for idle animations
    3. adjust the pause value for the rotation animation frame (should be quite a low number, say 40ms or less)
    4. edit the first frame of each of your idle animations & open up the action dialog & create an execute a script action part containing something along the lines of...

    if not smt_turnactive then
     ActiveAnimations["idle_animation_name"].AnimationFirstFrame = 1
     ActiveAnimations["idle_animation_name"].AnimationLastFrame = 14 -- whatever total number of frames is minus 1 because we added rotation frame to the end
    else
     ActiveAnimations["idle_animation_name"].AnimationFirstFrame = 15
     ActiveAnimations["idle_animation_name"].AnimationLastFrame = 15 -- absolute total number of frames
    end
    

    ...quick note: although in the editor frame 1 is shown as frame 0, it is actually frame 1 when accessing/setting via Lua script.

    P.S: I've not tested this code. But it should work!

    Imperator

    7283 Posts

  • #22, by AkcayKaraazmakThursday, 18. December 2014, 15:47 10 years ago
    Frame_1 and Frame_14 are the start and end frames of walk anim, isnt it?

    Imm but when the character turns with Simon's code when its on its 10th frame of the walk-cycle, then with your script, anim will jump from frame 10 to 15 immidietly, but for a nice smooth rotation, character should turn after the last frame his of walk-cycle. Because rotation translation is made to match with the last frame of walk. If rotation anim starts at 15.

    Great Poster

    440 Posts

  • #23, by afrlmeThursday, 18. December 2014, 16:04 10 years ago
    Not sure, but just tested what I theorized & it's quite glitchy looking. To be honest I'm finding the way Simon's script works to be very very slow. It rotates way too slow for my liking.

    game.CurrentCharacter:to(angleDist(smt_direction, newdir) * 5, {Direction = newdir})
    
    -- to:(delay value, table to update, easing) 
    
    -- angleDist(smt_direction, newdir) * 5 -- is what is defining the walk time needed to rotate the character.
    

    ... I've not determined fully how his script works yet. You are talking about rotation while already walking? Ideally it's a good idea to not have this script triggered while character is already walking unless player clicks a new location & requires the character to stop & do a 180. In general while your character is walking around the scene they shouldn't be turning too sharply anyway while walking to destination, thus rotation should not be required - only before setting off or when character turns to face opposite direction.

    Imperator

    7283 Posts

  • #24, by AkcayKaraazmakThursday, 18. December 2014, 16:10 10 years ago
    So mate how can I force the character to rotate with Simon's script only after he finishes the walk cycle. Make him rotate just after walkcycle finishes which is lets say 14 ?

    Great Poster

    440 Posts

  • #25, by afrlmeThursday, 18. December 2014, 16:28 10 years ago
    I think I understand what you are wanting to do. Have it finish the current walk cycle animation & then use that frame number throughout the rotation animation frames no?

    You're making it even more complicated. In theory I suppose you could create an additional variable, value or condition which needs to be met before triggering the rotation function, then in frame 14 of your walk animation you could query if rotation_active = true then pause for frame pause value set rotation_active2 to true which would then have it rotate the character.

    It's a bit too complicated to get across in a few words like this.

    I believe it would be better to write a script that lets you utilize & control manually triggered character animations instead & then that way you can control the frame & which animation to trigger. It's more work than Simon's script but it would be a lot more customizable.

    All I will say regarding this matter for now: is just forget about it, until a later time, as it's just an aesthetic enhancement. Worry about developing the main parts of your game first as you can always come back later on & add improvements & enhancements towards the end. wink

    Imperator

    7283 Posts

  • #26, by AkcayKaraazmakThursday, 18. December 2014, 16:44 10 years ago
    Yea Lee, if there is no current solution or a script to solve it now, its better to continue working on other parts smile

    Great Poster

    440 Posts

  • #27, by AkcayKaraazmakFriday, 19. December 2014, 15:31 10 years ago
    Hey Lee, I put your code "if smt_turnactive then
    ActiveAnimations["Turn"].AnimationFirstFrame = 453
    ActiveAnimations["Turn"].AnimationLastFrame = 467
    end
    " as a execute script action.

    But nothing happens. I put the code on first and last frames of all directions (right, back, left, front) of the walk animation. Any idea mate?

    p.s, 453-467 are the frames for rotaion animation.

    Great Poster

    440 Posts

  • #28, by afrlmeFriday, 19. December 2014, 15:34 10 years ago
    You would have to add it to the last idle frame I think. But irrelevant as Simon' script works constantly in the background rendering whatever you are wanting to do void.

    Imperator

    7283 Posts

  • #29, by AkcayKaraazmakFriday, 19. December 2014, 15:48 10 years ago
    This weird really, Idle anim is 300 frames and I put the code on 300th frame also tried on 299th but when I click ok and close the edit frame win, then it puts the script on frame 5 smile ... I think there is a bug. Anyway I'm giving up for the character rotation. I think I should wait for vis to have some new advance features for 3d characters.

    Thank you so much for your help Lee and Simon.

    Great Poster

    440 Posts

  • #30, by afrlmeFriday, 19. December 2014, 17:16 10 years ago
    New advanced features for 3D characters? Well... I've no idea when that will happen. First things first for the dev team is bug squashing, although there are a few new features for the next release, but none of them are to do with the 3D side of the engine as far as I know.

    The 3D system is still in its infancy & will probably take them a while to iron out any issues with it before attempting to work on any new features for it. Personally I think VS should have stayed exclusively as a 2D engine, but a lot of people were asking for 3D/2.5D support & thus it eventually got added & then somewhat grumbled at! grin

    Imperator

    7283 Posts