[FIXED] Simulating a command when the hero is frozen ?

Started by MetalZelda, June 18, 2017, 11:42:51 PM

Previous topic - Next topic
June 18, 2017, 11:42:51 PM Last Edit: June 18, 2017, 11:47:00 PM by MetalZelda
Hello

I ran out with a problem

I am working on cutscenes, that imply the hero to be frozen AND execute basic actions when the cutscene is active
the problem is, you can't simulate a command when the hero is frozen, I've tried to unfreeze him before the action occurs but when loading a spin attack from simulated command and if the player mispress the attack button, the animation is cancelled and the hero can move on it's own depending on the rules given (hero:unfreeze before the action or handling the command)

If the attack command is not pressed then the animation will play fine

I've tried to start a dummy menu like so, I also tried using sol.main:on_key_pressed, same

In this event, your input should do nothing except if a dialog is active ...
Code (lua) Select
function dummy:on_key_pressed(key)
  return not game:is_dialog_active()
end


But no matter what, even if I delete hero:freeze(), this prevent the hero from moving, but we can still cancel the simulated input, even if this rule (key_pressed) or on_command_pressed has been defined to prevent any input to interrupt the action

Anyone help ?

You can reproduce it simply

Code (lua) Select

game:simulate_command_pressed("attack")
sol.timer.start(1500, function()
  game:simulate_command_released("attack")
end)

Oh well, Haven't seen that the spin attack is canceled when the input is release, which is an event of an input press, this is fixed