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

  • #40, by SimonSTuesday, 30. December 2014, 21:56 10 years ago
    Is possible.
    			game.CurrentCharacter:to(angleDist(smt_direction, newdir) * 5, {Direction = newdir})
    

    In line 39, just remove * 5 or add * 2 or something like that, that's basicly a time in milliseconds, so making it smaller makes the animation faster, would like that:
    			game.CurrentCharacter:to(angleDist(smt_direction, newdir), {Direction = newdir})
    

    Thread Captain

    1581 Posts


  • #41, by AkcayKaraazmakThursday, 01. January 2015, 11:40 10 years ago
    Thank you Simon it made the rotation faster but it still didnt help to fix how it looks as you said. I have an idea, in your script, instead of rotating the character, how I can just call the animation data for the character. I have idle, walk, take, etc... and now rotate I'll do. And how I can call or load it into character, and after the rotation finished, I should again need to load the walk or the idle to the character.
    Ex:

    your script
    {
    load animation "rotate" into character

    when rotation finished again load idle or the walk into character according to mouse event

    Thank you again smile

    Great Poster

    440 Posts

  • #42, by SimonSSaturday, 03. January 2015, 14:47 10 years ago
    I tried a basic approach, you would need to change the name Animation0 to your animation, and that should be located in the character animations part.

    smt_turnactive = false
    smt_direction = game.CurrentCharacter.Direction
    smt_dest = game.CurrentCharacter.Position
    smt_destobj = game.CurrentCharacter.DestinationObject
    
    function angleDist(a,b)
    	return math.min(math.min( math.abs(a + 360 - b), math.abs(a - 360 - b)), math.abs(a - b))
    end
    
    function smoothTurningMainLoop3D()
    	local newstate = game.CurrentCharacter.AnimState
    	local newdir = game.CurrentCharacter.Direction
    	local c = game.CurrentCharacter
    	if smt_turnactive and newdir == smt_direction then
    		stopAnimation(getObject("Game.GameCurrentCharacter.CharacterCurrentOutfit.OutfitCharacterAnimations[Animation0]"))
    		c.DestinationObject = smt_destobj
    		c.Destination = smt_dest
    		smt_turnactive = false
    	end
    	if not smt_turnactive and smt_direction~=newdir then
    		local turn = false
    		if newstate == eWalkAnim and smt_state ~= eWalkAnim then
    			smt_dest = c.Destination
    			c.Destination = c.Position
    			smt_destobj = c.DestinationObject
    			turn = true
    		end
    		if newstate ~= eWalkAnim and smt_state == eWalkAnim then
    			turn = true
    		end
    		if turn then
    			smt_turnactive = true
    			local start = smt_direction
    			if math.abs(newdir - smt_direction - 360) < math.abs(newdir - smt_direction) and math.abs(newdir - smt_direction - 360) < math.abs(newdir - smt_direction +360) then
                            	start = smt_direction + 360
    			elseif math.abs(newdir - smt_direction + 360) < math.abs(newdir - smt_direction) then
    				start = smt_direction - 360
    			end
    			game.CurrentCharacter.Direction = start
    			startAnimation(getObject("Game.GameCurrentCharacter.CharacterCurrentOutfit.OutfitCharacterAnimations[Animation0]"))
    			game.CurrentCharacter:to(angleDist(smt_direction, newdir) * 2, {Direction = newdir})
    		end
    	end
    	smt_direction = newdir
    	smt_state = newstarte
    end
    
    registerEventHandler("mainLoop", "smoothTurningMainLoop3D")
    

    Thread Captain

    1581 Posts

  • #43, by AkcayKaraazmakSaturday, 03. January 2015, 15:24 10 years ago
    Simon, the call function for the character animation doesnt work. I also used the load animation for a test. There is a box object in the room and on click even I wrote execute script;

    startAnimation(getObject("Game.GameCurrentCharacter.CharacterCurrentOutfit.OutfitCharacterAnimations[Take]"))

    But its not loading the animation. Nothing happens, character just uses its idle animation

    Great Poster

    440 Posts

  • #44, by AkcayKaraazmakSaturday, 03. January 2015, 15:45 10 years ago
    I used the play animation "take" and wait. But when the take animation finishes it again plays the take animation forever till I click the mouse somewher and make the character walk. How I can stop the animation after its finished and make the character be on its idle animation again?

    Great Poster

    440 Posts

  • #45, by SimonSSaturday, 03. January 2015, 16:56 10 years ago
    Have you look into the log file if there is info on that ? The animation must be located in character animations and named "Talk", it's not enough that the model has an animation named that.

    Thread Captain

    1581 Posts

  • #46, by afrlmeSaturday, 03. January 2015, 17:51 10 years ago
    Hmm did you set the animation to loop infinite? If you play animation with wait enabled then it will loop because the loop is set to infinite. If loop infinite is not enabled then it should only loop for the specified amount of loops set in the properties tab.

    Imperator

    7278 Posts

  • #47, by AkcayKaraazmakSaturday, 03. January 2015, 21:53 10 years ago
    @ Yes Simon, In the outfits of the 3d character, I see all the animation names in the 3D Model Animation dropdown list, Walk, Idle, Take

    @ Lee, I also tried without "wait" parameter but it always show the animation in loop. But this is a 3d character animation and it doesnt have an option to selecet loop like the normal animations for the image sequances.

    In the timeline of the take animation on the last frame did edit-frame and then for the action I wrote ' Stop character "current character" ' .. Then take animation stops and character idle animation starts. BUT when I again click the same object then it doesnt load the take animation, it just continue on idle. And if I move the character little (I mean make the character walk little) and then click the same object it again plays the take animation but if I click again it doenst play the take animation. ....

    What wierd things happening really, I dont understand guys smile

    Great Poster

    440 Posts