Quote from: Diarandor on March 02, 2018, 10:24:00 PM
5) Don't use sensors or other entities. You do not need them, and your maps will get dirty. Do it with elegant code and without using entities, to keep things simple. That is the easiest way (which is not easy in any case).
I know and I agree, I'd much rather do it with code- but more than that, I'd rather it worked, haha. I had forgotten about entity:set_position(), that's a useful function and should work exactly as I want! Much better than creating a destination, I just had forgotten about that method. However, I'm still having problems I don't understand.
Here's my code for my blank map. This code seems pretty straightforward, but all that's being called is hero:teleport(). Everything after that isn't called.
Code (lua) Select
function map:on_started()
hero:teleport(game:get_value("respawn_map"))
hero:set_position(game:get_value("respawn_x"), game:get_value("respawn_y"), game:get_value("respawn_layer"))
print(game:get_value("respawn_x")) --for testing
sol.audio.play_sound("secret") --for testing
hero:set_direction(game:get_value("respawn_direction"))
end
I also tried writing this in a separate script and just having the script for the blank map requiring it. I'm at a loss here.