Author Topic: Bug freezing hero?  (Read 1927 times)

Diarandor

  • Hero Member
  • *****
  • Posts: 1045
  • Cats are cool! (ΦωΦ)
    • View Profile
Bug freezing hero?
« on: August 07, 2015, 06:36:48 pm »
Hi! I am using this code in the script of a map
Code: [Select]
local map = ...
function map:on_started()
  map:get_hero():freeze()
  sol.audio.play_sound("ok")
end
but the hero does not freeze (the sound plays, so the event is initialized). I suspect this could be a bug of the map:on_started() events. I have tried even with empty maps and nothing happens. This is very strange. Can anyone confirm this is not just me?

EDIT: I was trying to use this to make a cutscene for the intro. But since I don't need to display the hero I will use hero:set_enabled(false) instead of hero:freeze(). Anyway, this could be a problem to make cutscenes where the hero appears and we need to freeze him.
« Last Edit: August 07, 2015, 06:41:05 pm by Diarandor »
“If you make people think they're thinking, they'll love you. But if you really make them think, they'll hate you.”

Christopho

  • Administrator
  • Hero Member
  • *****
  • Posts: 1172
    • View Profile
Re: Bug freezing hero?
« Reply #1 on: August 07, 2015, 06:54:59 pm »
Try to freeze the hero in map:on_opening_transition_finished() instead.

Diarandor

  • Hero Member
  • *****
  • Posts: 1045
  • Cats are cool! (ΦωΦ)
    • View Profile
Re: Bug freezing hero?
« Reply #2 on: August 07, 2015, 07:04:20 pm »
Thanks a lot!!!  With that event it works fine. I had never used it.
So there is no bug.
“If you make people think they're thinking, they'll love you. But if you really make them think, they'll hate you.”

the bread

  • Jr. Member
  • **
  • Posts: 67
    • View Profile
Re: Bug freezing hero?
« Reply #3 on: August 07, 2015, 08:37:59 pm »
Another possible bug about freezing the hero: When I tried to freeze the hero when swimming, the swimming animation was replaced by the stopped one. I've attached a screenshot to this post.

Christopho

  • Administrator
  • Hero Member
  • *****
  • Posts: 1172
    • View Profile
Re: Bug freezing hero?
« Reply #4 on: August 07, 2015, 08:56:23 pm »
Freezed means changing the hero's state, so instead of swimming he does nothing. But you can still change the animation of the sprite.

Diarandor

  • Hero Member
  • *****
  • Posts: 1045
  • Cats are cool! (ΦωΦ)
    • View Profile
Re: Bug freezing hero?
« Reply #5 on: August 12, 2015, 05:03:05 pm »
Anyway, I want to point out that in the map script 0.lua of zsdx you wrote:
Code: [Select]
function map:on_started(destination)
  hero:freeze()
  ...
end
which does not freeze the hero. Although that's not important at all since you have no weapon at the begining, so no sound will start if you press the action command.
“If you make people think they're thinking, they'll love you. But if you really make them think, they'll hate you.”

Christopho

  • Administrator
  • Hero Member
  • *****
  • Posts: 1172
    • View Profile
Re: Bug freezing hero?
« Reply #6 on: August 12, 2015, 06:00:48 pm »
Nice catch :)
So he is not freezed, I did not know. It had no consequence because the game is suspended during this whole map due to dialogs (it is the intro map).