I am wondering how to get the hero in an item script.
I want to do this:
--slow the hero down
function item:on_map_changed(map)
hero:set_walking_speed(30)
end
I tried:
local item = ...
local game = item:get_game()
local hero = game:get_hero()
and
local item = ...
local game = item:get_game()
local map = item:get_map()
local hero = map:get_entity("hero")
and
local item = ...
local game = item:get_game()
local map = item:get_map()
local hero = map:get_hero()